Google | L3 | Phone Screen | Question

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-03-10Added By Anonymous
Source:Β Link
🧭 Experience: 1 year 8 months (Product Based)
βœ… Outcome: Rejected
πŸ’° Compensation: unknown
πŸ“ Location: unknown
🏒 Company: Google
πŸŽ“ Education: NIT
🎁 Benefits: unknown
πŸ“… Offer Date: unknown

You are given:
1. Intern Class (internName, wantsRoommate - Boolean)
2. Apartment Class (apartmentId, numBedrooms)

Given lists of interns and apartments, design an algorithm to optimally assign interns to apartments while considering their roommate preferences and available bedrooms.
β€’ β€œOptimal” is undefined, so you may define it logically.
β€’ You can modify the Intern and Apartment classes.
β€’ Apartments can have any number of bedrooms.

It was a doable question but I panicked and couldnt give the optimal solution. Also, messed up the time complexity. It was my first time appearing for a big tech. If someone is in a similar situation my advice would be to give some mock interviews before appearing for the actual interview.
Comments