Amazon.com Interview Question
1,566 Interview Reviews |
Back to all Amazon.com Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Engineering at Amazon.com:
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (2)
1 of 1 people found this helpful
-What's the capacity of the parking lot?
-What's the avg/max/variance of the rate of vehicle input? output?
-What's the tolerance for traffic jam at entrance? exit?
-Who are the users? Are they regulars or use the lot only once?
-How many entrances? Exits?
-What's the devel time requirmenment?
-Is this code a one-off or be reused?
Since this is just an interview, I'll assume that this parking lot has 100 spots, one entrance, which is also the exit and that the input/output rates are low enough that traffic jams are non-issue. When the vehicle enters, the ticket booth issues a time-stamped ticket to the vehicle. When the vehicle leaves, the ticket booth accepts the ticket, notifies the vehicle of the costs and accepts payment. It assumes well behaved drivers that always pay correct amount with exact change.
class TicketBooth{
public:
Ticket onVehicleEnter();
Price onVehicleExit(Ticket);
void acceptPayment(Money);
}
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up



0 of 0 people found this helpful
by Praveen:
Design: Check-in and Check-Out, Payment module.
Check-in and Check-out is used to get check-in time, check-out is used to validate the payment.
Payment Module - will contain, verifying the ticket, calculating stay time, validating the credit card / accepting cash, rendering change etc, and charging the amount and giving back the charged ticket successfully.
We can define each of the above functionalities into different classes/ methods.
If anyone thinks has a better solution please post.