Google | L4 | On site | Bangalore

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2024-11-18Added By Anonymous
Source: Link
🧭 Experience: The candidate was asked a scheduling question during the On-Site Round 2 for an L4 position at Google. They attempted to use a basic scheduling algorithm but missed some edge cases. ✅ Outcome: unknown 💰 Compensation: unknown 📍 Location: Bangalore 🏢 Company: Google 🎓 Education: unknown 🎁 Benefits: unknown 📅 Offer Date: unknown I was being asked this question today on On-Site Round 2 for L4 position of Google Software Engineer. Tried applying basic scheduling algorithm to schedule the meetings and exclude the part where it is 'Do Not Schedule'. Although I missed covering a few edge cases. Couldn't think of any other solution. Any other alternative solutions? -------------------------------- You have a list of meetings in your calendar with a start and end time. You are very busy, so meetings can overlap. You also have one "Do Not Schedule" interval during which you don't attend any meeting. Any meeting schedule that overlaps with a DNS slot is automatically cut such that it does not overlap with the DNS slot anymore. Return a list of non-overlapping time intervals when you are in a meeting. Meeting | ____ _______________ ___ | _____ ________ __ DNS | xxxx -------------------------------------------------> t RES. | ______ ____xxxx_______ ___ __ Sample input (for simplicity, all intervals include the left point and exclude the right point): Meetings: [(1, 7), (5, 10), (12, 30), (22, 30), (40, 50), (60, 70)] DNS: (18, 25) Sample output: [(1, 10), (12, 18), (25, 30), (40, 50), (60, 70)]
Comments