The Dynamic Container
A hard Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L4
Interview Prompt
You're implementing a dynamic array from scratch (the kind that backs a built-in `list`) and exercising it with a replay log of commands in `ops`, where each entry's first element names the operation: `['append', val]` adds `val` to the end, `['get', index]` reads the element at that position, `['size']` reads the current element count, and `['remove', index]` deletes the element at that position and shifts everything after it one place left. Manage your own backing storage that grows as elements are added rather than leaning on the standard library to resize for you. Replay the commands in order and return the values produced by the `get` and `size` operations only, in the order they occur, since `append` and `remove` produce no output.
Summary
Grow your own storage before the standard library does it for you.
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