Flat Memory
A medium Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- medium
- Seniority
- mid
Interview Prompt
An external sort spills sorted runs to disk, then folds them back a pair at a time to keep memory flat. Each `primary` buffer keeps its own `filled` values in order at the front and reserves exactly enough zeroed slots at the tail to absorb the `incoming` run, which is itself already sorted. Combine the two into one ascending sequence using only the room `primary` already holds, and return that buffer. An empty `incoming` leaves the buffer unchanged.
Summary
Two sorted runs, one buffer, no scratch space. Fold them together where they already live.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision