Amazon SDE2 question 1
I had an interview with Amazon where 40-45 minutes were about LPs
In the next 15-20 minutes, I was asked about how I code "seat booking system"
Question: Imagine Airplane reservation system where users choose flight, timings, no of seats, passenger details etc to book a flight. Now we are at seat booking stage. How would you allocate and book seats? Tell me which data structure you use and Write the code.
Initial 5 mins among 20 mins went for clarifications.
Folks! you have 15 mins left. How will you go about this?
This looks like a mix of design + DSA with 15 mins time constraint.
I am only aware about the structure of 45 mins interview. But at Amazon, with LPs, we barely get enough time to follow the structure.
note: The interviewer asked to sacrifice the time complexity (not expecting optimal code). Asked to explain which data sttucture would suit the best and show how you would select seats with this data structure with a sample of code.