The Min Tracker
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
- L4
Interview Prompt
Implement a class MinStack supporting push(x), pop(), and get_min(). All three operations must run in O(1) time. get_min returns the current minimum element in the stack without removing it. The test harness drives your class through a top-level function run_operations(operations, arguments). It is given two parallel lists: operations is a list of operation names and arguments is a list of argument lists. The first operation is always "MinStack" (with an empty argument list), which constructs a fresh stack. For each subsequent operation it calls the matching method on the instance with the unpacked arguments. run_operations returns a parallel list of results, one per operation: None for the constructor, None for push, None for pop, and the current minimum (an int) for get_min.
Summary
The stack remembers the best it ever saw.
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