Loading...

Batch Records

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

Domain
Python
Difficulty
medium

Problem

Records need to be split into fixed-size batches before writing to the database. Divide the list into sublists of at most n elements; the final batch may be smaller if the total doesn't divide evenly.

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.