cs4010_2026T1_Q2_NA.pdf
Application Development Lab · Quiz 2 · Jan 2026
← Course papers · Start practice / exam
Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.
Question 2 MSQ · 4.5 marks
A network monitoring system records the packet loss percentage of a router every minute. During
a congestion event, the packet loss first increases and after reaching a peak it decreases as the
network stabilizes.
Thus the array [[IMAGE:523f84682e36565b_2_2]] of packet loss values is bitonic (strictly increasing followed by
strictly decreasing).
The administrator wants to detect the minute when packet loss was maximum using an O(log n)
algorithm based on binary search.
Suppose we examine the middle element [[IMAGE:523f84682e36565b_2_3]] .
Let,
[[IMAGE:523f84682e36565b_2_4]] (left neighbor)
[[IMAGE:523f84682e36565b_2_5]] (right neighbor)
Which of the following facts allow us to correctly narrow the search space?




If [[IMAGE:523f84682e36565b_2_6]] , then x is the peak congestion value.

If [[IMAGE:523f84682e36565b_2_7]] , then the peak congestion lies in the right half of the array.

If [[IMAGE:523f84682e36565b_2_8]] , then the peak congestion lies in the left half of the array.

If [[IMAGE:523f84682e36565b_2_9]] , then the peak congestion lies in the left half of the array.

If [[IMAGE:523f84682e36565b_2_10]] , then the peak congestion lies in the right half of the array.

A published solution is not available for this question yet.
Question 3 MCQ · 4.5 marks
[[IMAGE:523f84682e36565b_3_11]]

[[IMAGE:523f84682e36565b_3_12]]

[[IMAGE:523f84682e36565b_4_13]]

[[IMAGE:523f84682e36565b_4_14]]

[[IMAGE:523f84682e36565b_4_15]]

A published solution is not available for this question yet.
Question 4 MCQ · 4.5 marks
Consider the following code snippet running in a browser. What will be the output on the console?
[[IMAGE:523f84682e36565b_4_16]]

Shield 99 99 42
Shield 10 99 42
Sword 99 99 42
Shield 99 42 42
A published solution is not available for this question yet.
Question 5 MCQ · 4.5 marks
Consider the following code snippet running on a browser. What is the output on the console?
[[IMAGE:523f84682e36565b_5_17]]

42 42 42
42 undefined undefined
42 undefined 42
undefined undefined undefined
A published solution is not available for this question yet.
Question 6 MCQ · 3.0 marks
A developer runs the following commands starting from main. Which diagram correctly shows the
repository's branch structure afterwards?
[[IMAGE:523f84682e36565b_5_18]]

[[IMAGE:523f84682e36565b_6_19]]

[[IMAGE:523f84682e36565b_6_20]]

[[IMAGE:523f84682e36565b_6_21]]

None of these.
A published solution is not available for this question yet.
Question 7 MCQ · 3.0 marks
Consider the below code:
[[IMAGE:523f84682e36565b_6_22]]
What will be the output of the above program, if executed?

Start
End
File Read
Start
File Read
End
File Read
Start
End
End
Start
File Read
A published solution is not available for this question yet.
Question 8 MCQ · 3.0 marks
Consider the below code:
[[IMAGE:523f84682e36565b_7_23]]
What happens when a request is made to “/”?

Middleware A runs first, then the route handler
The route handler runs first
Middleware is skipped
Server crashes
A published solution is not available for this question yet.
Question 9 MCQ · 3.0 marks
Consider the following relation Employee of a Company
[[IMAGE:523f84682e36565b_8_24]]
Which of the following options is correct?

The query returns employees who earn less than the company-wide maximum
salary and joined first in the company.
The query returns employees who earn less than the highest salary in their
department and joined earliest in their department.
The query returns employees who earn the minimum salary in their
department and joined earliest in their department.
The query returns employees who earn less than the department’s maximum
salary and joined before the latest hire in the department.
A published solution is not available for this question yet.
Question 10 MCQ · 3.0 marks
Consider the below code:
[[IMAGE:523f84682e36565b_8_25]]
What will the above code fetch?

All records with all columns from the table
One record with all columns from the table
Only the primary keys of the table
Nothing
A published solution is not available for this question yet.
Question 11 MCQ · 3.0 marks
Consider the middleware.
[[IMAGE:523f84682e36565b_9_26]]
What does the above middleware do?

Generates JWT tokens
Protects routes from unauthenticated access
Encrypts passwords
Connects to the database
A published solution is not available for this question yet.
Question 12 MSQ · 3.0 marks
Consider this repository structure and the .gitignore file shown below.
[[IMAGE:523f84682e36565b_9_27]]
[[IMAGE:523f84682e36565b_9_28]]
Which files will not be tracked by Git?


[[IMAGE:523f84682e36565b_9_29]]

[[IMAGE:523f84682e36565b_10_30]]

[[IMAGE:523f84682e36565b_10_31]]

[[IMAGE:523f84682e36565b_10_32]]

[[IMAGE:523f84682e36565b_10_33]]

A published solution is not available for this question yet.
Question 13 MSQ · 3.0 marks
Consider the following relation Orders:
[[IMAGE:523f84682e36565b_10_34]]
Which of the following option(s) is/are correct?

The query returns the 4 most recent orders in the database.
The query first sorts orders by most recent order_date, and for orders on the
same date by smallest amount first.
The query returns orders ranked 7 to 10 after sorting by (order_date DESC,
amount ASC).
The query skips the 6 newest orders and returns the next 4 orders based on
the sorting order.
A published solution is not available for this question yet.
Question 14 MCQ · 2.0 marks
What is the primary purpose of Node.js?
To run JavaScript in a browser
To compile JavaScript into machine code
To execute JavaScript on the server
To replace HTTP servers completely
A published solution is not available for this question yet.
Question 15 MCQ · 2.0 marks
Consider the below code:
[[IMAGE:523f84682e36565b_11_35]]
Which of the following HTTP methods will trigger this route?

POST
PUT
GET
DELETE
A published solution is not available for this question yet.
Question 16 MCQ · 2.0 marks
Consider the below code:
[[IMAGE:523f84682e36565b_11_36]]
What does the **create()** do?

Inserts the record directly into the database.
Deletes an existing record.
Opens a database connection.
Creates a new entity instance.
A published solution is not available for this question yet.
Question 17 MSQ · 2.0 marks
Which of the following statements about JWT are true?
JWTs are stateless authentication tokens.
They must be sent in request headers.
They must always be stored in databases.
They contain encoded payload information.
A published solution is not available for this question yet.