Design line-preserving file chunker pipeline

Quick Overview

This question evaluates expertise in designing distributed data pipelines with precise file chunking, line-boundary preservation, exactly-once semantics, buffering and partial-line handling, compression trade-offs, parallelization, and fault tolerance.

Design line-preserving file chunker pipeline

Company: Google

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design a data pipeline that reads many text files of varying sizes and emits output files of exactly 100 MB each, preserving line boundaries and ensuring every input line appears exactly once in the output. Specify how to handle partial lines at boundaries, buffering, compression, parallelism, and fault tolerance with exactly-once output without duplicates or omissions.

Overview: This question evaluates expertise in designing distributed data pipelines with precise file chunking, line-boundary preservation, exactly-once semantics, buffering and partial-line handling, compression trade-offs, parallelization, and fault tolerance.

|Home/System Design/Google
Google logo
Google
Sep 6, 2025
hardSoftware EngineerTechnical ScreenSystem Design
8
0

System Design: Pack Text Lines into Exact 100 MB Output Files

Design a data pipeline that reads many text files of varying sizes and emits output files of exactly 100 MB each. The pipeline must:

  • Preserve line boundaries (never split a line across files).
  • Ensure every input line appears exactly once in the output (no duplicates, no omissions).
  • Support high parallelism.
  • Handle buffering and partial lines at boundaries.
  • Address compression choices and their impact on file sizing.
  • Provide fault tolerance with exactly-once output semantics.

Provide a detailed design that specifies:

  1. How input files are read and split across workers, handling partial lines at split boundaries.
  2. How lines are grouped into exactly 100 MB output files while preserving boundaries.
  3. Buffering strategies for efficient I/O.
  4. Compression options and their implications for the "exactly 100 MB" requirement.
  5. Parallelization strategy and scaling behavior.
  6. Fault tolerance and exactly-once output (no duplicates or omissions) under retries.

Assume line-delimited UTF-8 text input (LF or CRLF). If you need to make minimal assumptions, state them explicitly.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...