Amazon Interview Question for SDE-2s


Country: United States
Interview Type: In-Person




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

Following is the minimal DB design required to support the requirement

UserPriceTrackingData
User_id | Item_id | Price limit | expiry_date

ItemPrice
Item_id | Price

User
User_id | User_email

API's exposed:
1) UpdatePrice, params: item_id, price
Prices will be updated using UpdatePrice api and will be stored in ItemPrice table.
2) AddTrackingData, params: user_id, item_id, tracking price
User can enter price tracking data using AddTrackingData will be stored in UserPriceTrackingData with request expiry_date set to, say, 30 days later. If the price is already below the tracking price, a email is sent straightaway.

Worflow:
Whenever UpdatePrice is called to update the price, a background task will try match the UserPriceTrackingData entry for the item with tracking price larger than the new price. If a match is found, an email is sent.To expedite it, we can cache the tracking data for the most frequently updated items.

- Brandy August 10, 2015 | 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