DataDriven
LearnPracticeInterviewDiscussDailyJobs

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

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write your python solution with real code execution
  4. Get instant feedback and a hire/no-hire decision

Related

  • All Mock Interviews
  • Practice Mode (untimed)
  • Python Interview Questions
  • Data Engineering Interview Prep Guide
  • Practice Problems
  • Daily Challenge