Uber | Phone Screen | San Francisco | Horrible
Company: Uber
Role: unknown
Interview Stage: Phone Screen
Location: San Francisco
Year: unknown
Original Post Content:
1. Given const radius, list of numbers find the first block where size = contagious 10. Return the starting index
When we say block its akin to visited of that number and visited of prev/next number by radius- here its one.
If number is 4, then we block 3,4,5
Block mark = (Radius+number) and (Radius-number)
Eg :
radius=1, List of numbers= [2,5,7,9,15,17]
Solution:
After block marking we generate a list - [1,2,3,4,5,6,7,8,9,10,14,15,16,17,18]
return index 1
2. Given varying radius, real number find the first block where size = contagious 10. Return the starting index/number in this case.
Eg : [ (1.2,3.44) , (3,4.22)(,6,8.5).......]
Solved the first one using visit array and keeping start index/end index.
Solved the 2nd using the same concept.
No Sorting!!
Interviewer was really really bad/unhelpful. Hardly spoke. 90% of the words he said was okay.
Only response I got was 'okay'. Not sure if this was a solution.