Google | L3 | Phone Screen | Question

Anonymous User
889
Mar 10, 2025

Experience: 1 year 8 months (Product Based)
College: NIT
Applied directly.

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.

Verdict: Rejected

Comments (3)