cs4010_2026T2_Q2_NA.pdf
Application Development Lab · Quiz 2 · May 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 MCQ · 4.5 marks
**Minimum Coin Change using Dynamic Programming**
You are given an unlimited supply of coins of different denominations and a target amount. Your
task is to determine the minimum number of coins required to make the target amount exactly. If
it is not possible to form the target amount, the algorithm should report that no solution exists.
A common Dynamic Programming approach solves this problem by computing the minimum
number of coins required for all smaller amounts before calculating the answer for the target
amount.
Which of the following statements is NOT true about solving the Minimum Coin Change problem
using Dynamic Programming?
We can define each subproblem as finding the minimum number of coins
required to make every amount from 0 up to the target amount.
The minimum number of coins required for a larger amount can be computed
using the optimal solutions already obtained for smaller amounts.
A Dynamic Programming solution stores the minimum number of coins
required for each intermediate amount so that these values can be reused instead of being
recomputed.
The order in which the Dynamic Programming table is filled (for example,
solving larger amounts before smaller ones without already having their answers) does not affect
the correctness of the algorithm.
A published solution is not available for this question yet.
Question 3 MCQ · 4.5 marks
Consider the below express code.
[[IMAGE:6dc645839161d71e_3_2]]
When a GET request is made to the route [[IMAGE:6dc645839161d71e_3_3]] , what will be logged in the server logs?


A
B
C
A
B
B
C
A
C
A published solution is not available for this question yet.
Question 4 MCQ · 4.5 marks
Consider the below code.
[[IMAGE:6dc645839161d71e_3_4]]
What will be returned in the response for the below request
[[IMAGE:6dc645839161d71e_3_5]]


20
50
undefined
Runtime Error
A published solution is not available for this question yet.
Question 5 MCQ · 4.5 marks
Consider the below code.
[[IMAGE:6dc645839161d71e_4_6]]
Assume that bcrypt generates a unique random salt for every call, so the same salt is never
reused. What will be the output of the above program?

Runtime Error
true
false
The behavior is unpredictable
A published solution is not available for this question yet.
Question 6 MSQ · 3.0 marks
Which of the following are valid ways to create a **shallow** copy of an array?
[[IMAGE:6dc645839161d71e_4_7]]

[[IMAGE:6dc645839161d71e_4_8]]

[[IMAGE:6dc645839161d71e_4_9]]

[[IMAGE:6dc645839161d71e_4_10]]

A published solution is not available for this question yet.
Question 7 MSQ · 3.0 marks
Which of the following statements about Entity design is/are correct?
Each entity generally represents one database table.
Every entity must have exactly one string column.
Primary keys uniquely identify each record.
Entity decorators help ORM map classes to database tables.
A published solution is not available for this question yet.
Question 8 MCQ · 3.0 marks
Consider the below javascript program.
[[IMAGE:6dc645839161d71e_5_11]]
What will be the output of the above program?

Runtime Error
undefined
2
3
A published solution is not available for this question yet.
Question 9 MCQ · 3.0 marks
Consider the below nodejs server code.
[[IMAGE:6dc645839161d71e_5_12]]
Assume the server is running locally. What happens when a request is made to the URL
[[IMAGE:6dc645839161d71e_5_13]] ?


The response completes successfully.
The client keeps waiting because the response never ends.
The server crashes immediately.
Node.js automatically calls [[IMAGE:6dc645839161d71e_6_14]] .

A published solution is not available for this question yet.
Question 10 MCQ · 3.0 marks
Consider the below nodejs server code.
[[IMAGE:6dc645839161d71e_6_15]]
Assume the server is running locally. What will be returned when a request is made to the URL
[[IMAGE:6dc645839161d71e_6_16]] ?


Home (with status code 200)
About (with status code 200)
Page Not Found (with status code 404)
Internal Server Error (with status code 500)
A published solution is not available for this question yet.
Question 11 MCQ · 3.0 marks
Consider the following relation:
**Product(product_id, product_name, category, price)**
The following SQL query is executed:
[[IMAGE:6dc645839161d71e_7_17]]
Which of the following best describes the output?

The four most expensive products in the Electronics category.
The 3rd, 4th, 5th and 6th most expensive products in the Electronics category.
All Electronics products except the two most expensive ones.
The 3rd, 4th, 5th and 6th cheapest products in the Electronics category.
A published solution is not available for this question yet.
Question 12 MCQ · 3.0 marks
Consider the below typeORM entity.
[[IMAGE:6dc645839161d71e_7_18]]
Assume the corresponding table already exists. Which of the following operations will successfully
insert a new record?

[[IMAGE:6dc645839161d71e_7_19]]

[[IMAGE:6dc645839161d71e_8_20]]

[[IMAGE:6dc645839161d71e_8_21]]

[[IMAGE:6dc645839161d71e_8_22]]

A published solution is not available for this question yet.
Question 13 MCQ · 3.0 marks
Consider the below middleware implementation.
[[IMAGE:6dc645839161d71e_8_23]]
What is the potential issue in the above implementation?

If [[IMAGE:6dc645839161d71e_8_24]] throws an exception, the server may return an unhandled
error.

Missing Authorization header.
JWT verification always returns false.
There is no issue.
A published solution is not available for this question yet.
Question 14 MCQ · 2.0 marks
Consider the following sequence of Git commands.
[[IMAGE:6dc645839161d71e_9_25]]
Which of the following statements is true?

The latest changes are already committed.
The latest changes are staged.
The latest changes exist only in the working directory.
Git automatically creates another commit.
A published solution is not available for this question yet.
Question 15 MCQ · 2.0 marks
Consider the below typeorm query operation.
[[IMAGE:6dc645839161d71e_9_26]]
What is the potential issue in the above logic?

[[IMAGE:6dc645839161d71e_9_27]] always returns an array.

If no matching record exists, accessing [[IMAGE:6dc645839161d71e_9_28]] may cause a runtime
error.

TypeORM automatically creates a default user.
There is no issue.
A published solution is not available for this question yet.
Question 16 MCQ · 2.0 marks
Consider the below middleware implementation.
[[IMAGE:6dc645839161d71e_10_29]]
What will be returned if a GET request is made to the route [[IMAGE:6dc645839161d71e_10_30]] ?


[[IMAGE:6dc645839161d71e_10_31]]

[[IMAGE:6dc645839161d71e_10_32]]

[[IMAGE:6dc645839161d71e_10_33]]

[[IMAGE:6dc645839161d71e_10_34]]

A published solution is not available for this question yet.
Question 17 MSQ · 2.0 marks
Which of the following [[IMAGE:6dc645839161d71e_10_35]] compiler options are correctly matched with their
purpose?

[[IMAGE:6dc645839161d71e_10_36]] → Specifies the source folder.

[[IMAGE:6dc645839161d71e_11_37]] → Specifies where compiled JavaScript files are generated.

[[IMAGE:6dc645839161d71e_11_38]] → Specifies the JavaScript version to generate.

[[IMAGE:6dc645839161d71e_11_39]] → Ignore all TypeScript errors.

A published solution is not available for this question yet.