DSAAdvancedReady

Dynamic Programming Assessment

This assessment verifies the Dynamic Programming module. Passing it contributes up to 13 points in the 61-73 score band.

Questions

8

Limit

105m

Pass

85%

Score

+13

Question 1scenarioAdvanced

13 pts

Recognizing overlapping subproblems and designing memo keys

A pricing engine recursively evaluates discount choices across months. Many branches eventually reach the same `(monthIndex, remainingCredits)` pair and then recompute the same suffix. Explain whether DP applies, define the state, recurrence idea, and what must be included in the memo key.

Question 2code-reviewAdvanced

12 pts

Converting repeated recursion into DP

A candidate solves climbing stairs with naive recursion: `ways(n) = ways(n - 1) + ways(n - 2)` and no cache. Review the performance problem, give the memoized or tabulated fix, and state complexity.

Question 3codingAdvanced

15 pts

2D DP state design and recurrence

Design a 0/1 knapsack solution for campaign selection under a fixed budget. Each campaign has cost and value and can be selected at most once. Define `dp[i][b]`, transition, base cases, answer, and complexity.

Question 4code-reviewAdvanced

13 pts

1D DP compression and dependency safety

A teammate optimizes subset-sum DP from 2D to 1D and iterates budget from low to high for each number. The problem is 0/1: each number can be used once. Review the bug and correct the iteration order.

Question 5codingAdvanced

13 pts

2D grid DP and fill order

Given a non-empty grid of non-negative risk values, return the minimum risk path from top-left to bottom-right moving only right or down. Define state, fill order, boundary handling, and complexity.

Question 6scenarioAdvanced

13 pts

Two-string DP state design

A document comparison feature needs the longest common subsequence length between two strings. A candidate tries to greedily match each character in the first string to the earliest possible character in the second. Explain why greedy is unsafe and define a DP solution.

Question 7scenarioAdvanced

13 pts

Memoization versus tabulation production judgment

A recommendation planner has millions of theoretical states, but business rules make only a small fraction reachable from a request. Another offline report needs values for every state. Choose memoization or tabulation for each and defend the trade-off.

Question 8multiple-choiceAdvanced

11 pts

Assessment-grade DP explanation

Which answer best demonstrates SkillSkore-level DP reasoning?