Uber Interview Question

Build a text wrapper. For example, split a long sentence by some character limit only at spaces.

Interview Answers

Anonymous

Aug 27, 2019

It involved a bit of state tracking where I found the nearest space lower than previous space + char_limit. Deceptively hard question.

Anonymous

May 27, 2021

Simple. Don't look at the problem from the perspective of a text wrapper. Solve it as a puzzle as a bottom to top approach. Split all the words based on spaces and store them as a list. Starting with the first word in the list, measure the length of the word (by characters) and concatenate the next word to it if the condition doesn't meet your requirement.

Anonymous

Feb 3, 2021

In these sorts of interviews you really need to drill down and understand what the interviewer is looking for. A good way to simulate a real interview experience is to do a mock with one of the Uber Data Scientist experts on Prepfully, rated super strongly on TrustPilot... prepfully.com/practice-interviews