InterviewDB Experience · USA

Spaces Between Us: Justify Text to a Fixed Line Width

Interview Experience

Round 1 - Coding Problem Given a list of words and a maximum line width W, format the words so that each line is exactly W characters wide using full justification. Extra spaces are distributed as evenly as possible from left to right. The last line is left-justified. Example Follow-ups How do you distribute spaces when the extra count is not divisible evenly by the number of gaps? A line with a single word — how do you pad it correctly? What changes if you must right-justify the last line inste…

Full Details

🔒

Unlock all Glean questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a glean interview during the phone round.

It covers the following topics: System Design, Coding, Phone, Onsite .