Loading...

The Impersonator

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
senior

Problem

The streaming ingestion layer buffers events before flushing to the warehouse. The buffer must process events in arrival order (FIFO), but the only collection primitive available in the lightweight runtime is a stack. Build a queue class backed by two internal stacks that preserves first-in-first-out ordering for enqueue and dequeue operations.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.