Loading...

The Double-Ended Gateway

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

Domain
Python
Difficulty
medium
Seniority
mid, senior

Problem

A task scheduling system needs a data structure that supports efficient insertion and removal from both ends. Implement a deque class with push_front, push_back, pop_front, pop_back, peek_front, peek_back, and is_empty methods. Do not use collections.deque.

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.