The Chunked Reader
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L3
Problem
A batch shipper can only send `chunk_size` log lines per request, so a run of `lines` has to be split into successive batches before it goes out. Split `lines` into batches of at most `chunk_size` in their original order, and return the batches as a list of lists.
Summary
Too big for one payload. Ship it in pieces.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.