## Uber Interview Question for Software Engineers

Country: United States
Interview Type: In-Person

Comment hidden because of low score. Click to expand.
1
of 1 vote

Looking for interview experience sharing and coaching?

Visit aonecode.com for private lessons by FB, Google and Uber engineers

Our ONE TO ONE class offers

SYSTEM DESIGN Courses (highly recommended for candidates for FLAG & U)
ALGORITHMS (conquer DP, Greedy, Graph, Advanced Algos & Clean Coding),
latest interview questions sorted by companies,
mock interviews.

Our students got hired from G, U, FB, Amazon, LinkedIn and other top tier companies after weeks of training.

Feel free to email us aonecoding@gmail.com with any questions. Thanks!

Solution to 2/5: The number of minutes in a day is constant. Create an array of size 60*24 minutes in a day. Mark true on meeting schedules.

``````public boolean meetingOverlap(int[][] meetings) {
boolean[] schedule = new boolean[24 * 60];
for(int[] time:meetings) {
for(int i = time[0]; i <= time[1]; i++) {
if(schedule[i]) return true;
schedule[i] = true;
}
}
return false;
}``````

Comment hidden because of low score. Click to expand.
0
of 0 vote

There is another very neat alternative than creating a large boolean bucket array, radix sort.

``````// radix_sort is Theta(n)
// all of these, by definition will have same no digits :: max 4
no_digits = size ( meetings[0].start, 10 )
for ( inx : [no_digits-1:-1] ){
bucket = mset ( meetings ) as { int ( (str(\$.start))[inx] ?? 0 ) }
meetings = fold( [0:10] ,list() ) as {
continue( \$.o !@ bucket )
\$.p += bucket[\$.o] }
}
meetings // return
}
def is_overlap(meetings){
exists ( [1:size(meetings)] ) where {
meetings[\$.o - 1].end >= meetings[\$.o].start
}
}``````

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.