8 pts
Ordering-model selection
Which statement best describes when to choose a stack versus a queue?
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
8 pts
Which statement best describes when to choose a stack versus a queue?
13 pts
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.
13 pts
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.
14 pts
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.
14 pts
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.
13 pts
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.
13 pts
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.
12 pts
Which answer is strongest for a backtracking interview problem such as subsets, permutations, or combination sum?