google swe l4 phone screening | rejected

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-04-22Added By Anonymous
Source: Link

question:

given a list of tickets(start_time, end_time) and a number N. find how many active tickets were there at time t where 0<= t < N.


my approach:

1.sort tickets by start_time and then end_time in asc order
2.use two pointers i=0, j=0 to create a window
3.for any time t, size of window will give no of active tickets for that time
4.for time t+1 move pointer j to include more tickets and move pointer i to remove expired tickets


time complexity: O(nlogn)


I was able to code and explain the approach. inteviewer even said "all the best for your loop round", but got a call that feedback was -ve.

Comments