Amazon SDE2 question 1

amazon logo
amazon
SDE II
April 2, 20253 reads

Summary

I interviewed with Amazon for an SDE2 role. The interview focused on Leadership Principles and a data structures and algorithms problem involving the design and implementation of an airplane seat booking system with specific allocation rules under time constraints.

Full Experience

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.

  1. Do seats be reserved side by side ? (Yes, first priority is side by side, if not random seat allocation)
  2. Do users get to choose which seat ? (No, for now, seats allocated by system)
  3. Is the reservation data available? (Assume you have an object in the input which has all the reservation details)

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.

Interview Questions (1)

Q1
Airplane Seat Booking System
Data Structures & AlgorithmsMedium

Imagine an Airplane reservation system where users choose flight, timings, no of seats, passenger details etc to book a flight. Now we are at the 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: 1) Do seats be reserved side by side? (Yes, first priority is side by side, if not random seat allocation) 2) Do users get to choose which seat? (No, for now, seats allocated by system) 3) Is the reservation data available? (Assume you have an object in the input which has all the reservation details). The interviewer asked to sacrifice the time complexity (not expecting optimal code). Asked to explain which data structure would suit the best and show how you would select seats with this data structure with a sample of code.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!