Two-Column Layout: Best Divider Position
Asked at Waymo · Coding Questions · Difficulty: Medium · Last asked Nov 14, 2025
A table has two text columns that share a fixed total width `W`. A vertical divider sits at an integer position `w`: the left column gets width `w` and the right column gets width `W - w`. Each column places its words in order, greedily: a word goes on the current line if it fits (words on one line are separated by one unit of space), otherwise it starts a new line. A column's height is its number of lines, or 0 if it has no words. Choose the divider that makes the taller column as short as possible.
Loading the problem…
More Waymo interview questions
- ML System Design: Choose Passenger Drop-off Location
- ML Coding: Debug a NumPy / Tensor Framework
- L5+ Behavioral: Policy vs Efficiency Trade-offs & Leadership
- Project Deep-Dive + ML Fundamentals Discussion
- Pickup Request Scheduler (OO Design)
- Build an Arithmetic Expression to Reach a Target