Loading...

Batch With Metadata

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

Domain
Python
Difficulty
easy
Seniority
junior, mid

Problem

The data loader writes records to an API in batches to avoid rate limits, and the caller needs to know which chunk it's on and whether it's the last one. Write a function that splits a list into fixed-size batches, each wrapped with its index and a flag indicating whether it's the final batch.

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.