Amazon Interview Question for SDE1s


Country: United States




Comment hidden because of low score. Click to expand.
0
of 0 vote

I will have 2 types of parking here. For big cars and small cars. Small cars can be accommodated in big cars parking but not vice versa. .
Will have 2 queues for this.
Once the queue for small cars is full I will assign big cars pool or queue to small cars.

Here can be the classes

Class Garage
{
int id
}

Class SmallGarage : Garage
{
Car objId;
}

Class BigGarage : Garage
{
Car objId;
}

Will have multiple objects of smallGarage and BigGarage each inserted in a queue
As an when we have a car object we dequeue a queue and then enqueu in a queue with the car object assigned to that garage object.

- DashDash May 05, 2013 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More