DSABeginnerReady

Stack, Queue, and Recursion Assessment

This assessment verifies the Stack, Queue, and Recursion module. Passing it contributes up to 6 points in the 30-35 score band.

Questions

8

Limit

85m

Pass

85%

Score

+6

Question 1multiple-choiceBeginner

8 pts

Ordering-model selection

Which statement best describes when to choose a stack versus a queue?

Question 2codingBeginner

13 pts

Stack implementation and invariant reasoning

Implement the core algorithm for valid parentheses/brackets. The input may contain non-bracket characters that should be ignored. Explain the invariant, edge cases, and complexity.

Question 3code-reviewIntermediate

13 pts

Auxiliary stack trade-off and duplicate handling

A candidate implements `getMin()` for a stack by scanning the entire stack every time it is called. The product calls `getMin()` after nearly every push in a stream of 2 million values. Review the risk and propose the stronger design, including duplicates.

Question 4scenarioIntermediate

14 pts

Production queue design and backpressure

A checkout service enqueues receipt-email jobs after successful payments. During a marketing campaign, producers create jobs faster than workers can process them. Design the queue behavior you would monitor and the operational policies you would add.

Question 5codingIntermediate

14 pts

Queue-based BFS and shortest unweighted paths

Given an unweighted grid where `0` means open and `1` means blocked, return the shortest number of moves from the top-left cell to the bottom-right cell, or `-1` if unreachable. Explain why a queue is the correct structure.

Question 6code-reviewIntermediate

13 pts

Recursion safety, call-stack depth, and cycle handling

A recursive folder-size function works in tests, but production customers can upload deeply nested folder trees and symbolic links can create cycles. Review the risks and propose a safer design.

Question 7scenarioIntermediate

13 pts

Backtracking search design and pruning

A shift scheduler must assign engineers to shifts. Each shift needs one engineer, engineers have availability constraints, and no engineer can exceed two shifts. Explain a backtracking approach, the pruning rules, and the complexity risk.

Question 8multiple-choiceIntermediate

12 pts

Assessment-grade backtracking explanation

Which answer is strongest for a backtracking interview problem such as subsets, permutations, or combination sum?