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 driving 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. 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, in the order they occur.
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