← Questions

Split a file iterator into balanced line-aligned parts

0
Together AIGoogleCodingLast asked Sep 2026

A coding interview question asked in Together AI's technical phone screen and at Google, last asked Sep 2026. It tests iterators, partitioning and filesystems.

A text file arrives through an iterator that yields string chunks of any size; a chunk can end in the middle of a line. Split the file into n ordered parts for parallel workers so that every line stays whole and the numbers of lines in…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

iterators · partitioning · filesystems

Your code and the AI tutor open when you unlock this question.