Tech IndustryJul 20, 2019

System Design : design airport

Was asked this at Amazon interview, with very little details on the requirements, except that he's interested in some sort of sequence diagram for how to orchestrate different planes landing and taking off. I was like, ok, given that I have no actual knowledge of air traffic control, I can only abstract this away to a simplified model. So I said, I have a server called AirTrafficControl, and my clients are planes. And a client would issue a request for land, and server would look for any open "lanes" for landing, and if found, will issue a response saying 'accepted', and include the landing number to the plane, and plane would acknowledge and then the server would place a lock on the that lane as reserved, blah blah. Then after the above simplified model, I started talking about scalability: multiple planes requesting at the same time, how to search for a free lane quickly, how to do locking, how to horizontally scale the AirTrafficControl Server, and the databases, etc. But he seems disinterested in what I am saying, and again starts asking for a 'sequence diagram', and asks 'what happens if 2 planes collide in the air? Wouldn't there be a minimum distnace between 2 airplanes otherwise they'll crash into each other while landing?". I'm like ok, so let's implement a queuing system, and each item in the queue is an airplane currently occupying a given air way, and implement time delta between the time an item is placed into a queue and the next item is set to arrive, and we block any puts into the queue until time delta is over a certain threshold, blah blah. At this point I'm grasping for air (no pun intended) as I still am not clear exactly what he's interested in hearing. And then time is up. Note this whole thing was only about 20-30 mins long as we spent 20 mins talking about the LP stories in the beginning. Is 'designing an airport' a classic system design question? What typical things should one be focused on for this problem?

Add a comment
Booking.com 仆街 冚家鏟 Jul 20, 2019

OOP

Goldman Sachs faith91 Jul 20, 2019

@OP please tell me you clarified with the recruiter in the beginning as to whether he wanted you to come up with object oriented design or system design? Because that is the first question you should be asking! I ask this because, to me, it looks like an OOPs question but you keep on mentioning system design! Also, the sequence diagram further consolidated my thought for me!

Flagged by the community.
Amazon MsSanchez Jul 20, 2019

Yes! OP did misstep by diving into system design, but interviewer is the one who really fucked up. Bad, immature interviewer looking for one specific answer, and unable to engage meaningfully with OP.

Microsoft gonadd Jul 20, 2019

what has it do with Indians my friend

Expedia Group nXbI53 Jul 20, 2019

I don't know if this is a common question. But was thinking of asking this question myself.

This comment was deleted by the original commenter.
Oracle icecap Jul 20, 2019

See, this is what you don’t get. It’s not a leetcode problem. You are totally missing the point. It’s not a graph problem not a queuing problem only. It’s more than that. And that my friend differentiates senior vs leetcoders. Op didn’t even understand what the interviewer was looking for

Bloomberg 1337c4lyfe Jul 20, 2019

How about we compare offers next week and we go from there? I might be missing the point, I might not answer that and other contrived “problems” to the imagination of some “interviewers”, but that doesn’t determine my level.

Microsoft tpot Jul 20, 2019

Luck plays a big part in interviewing. Good thing is there is enough and more opportunities that you can simply prepare for this situation and move on to the next one and deal with a similar question better the next time you find yourself in this kinda tough spot.

Tibco software ToTK28 Jul 20, 2019

Mediator design pattern

This comment was deleted by the original commenter.
Amazon Waze Jul 20, 2019

A sequence diagram is by definition a sequence of events. But this could be at the OOP level or system architecture level. But overall this is a really bad question to ask for system design. Air traffic control is a niche complicated area that a regular SDE wouldn't have context and domain knowledge to even start designing the system.

Davey leetRabbit Jul 20, 2019

Is sequence diagram same as UML ?

ForRent HpDp30 Jul 21, 2019

Yes, one of the types of UML diagram.

Chase piv OP Jul 21, 2019

Yea so even today I don't know how to answer that question

Davey leetRabbit Jul 21, 2019

I think you gave a good answer considering the ambiguous environment..Thanks for sharing the question. This will definitely help you and ppl like me to focus on OOP and try to understand difference between system design and oops .. how much YOE you have if I may ask..