Loading...
The Page Turner
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
Build a class that takes a list of pages, where each page is itself a list of items, and lazily produces one item at a time across all pages in sequence. The class must implement the standard Python iterator protocol so it works in any for loop or next() call.
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.