AMAZON | PHONE SCREEN | USA

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-09-20Added By Anonymous
Source: Link

Company: Amazon
Role: unknown
Interview Stage: Phone Screen
Location: USA
Year: unknown

Original Post Content:

Had phone interview with amazon today.
Below is the question close to my memory, I was able to solve it using brute force iteration and time was up :(

Consider a catalogue of products that has discount information valid for [startTime , endTime].
Consider a user always places a "well timed order" such that his discount is always maximized.
Given a catalogue information, what is the maximum discount a user can get if he places a well timed order

Id Product startTime EndTime Discount
1 Book 11:00Am 12:00pm 50
2 Phone 12:10Pm 1:30pm 20
3 dress 12:50Pm 2:00pm 10
4 Desk 1:00Pm 2:00pm 35

Here considering the user places order at 1PM his discount can be 35 + 10 + 20 = 65

Comments