Amazon interview Experience | Set 409 (For SDE-I)
Maximum profit by buying and selling a share at most k times
You have two lane road and there are two sensors,
Hey geek! It's time to become a success story instead of reading them. Check out our most renowned DSA Self Paced Course, now at a student-friendly price and become industry ready. And if you are looking for a more complete interview preparation resource, check out Complete Interview Preparation Course that will prepare you for the SDE role of your dreams!
Feeling prepared enough for your interview? Test your skills with our Test Series that will help you prepare for top companies like Amazon, Microsoft, TCS, Wipro, Google and many more!
- Sensor A only covers Right lane.
- Sensor B covers both Left and Right lane.
Input of the function is two arrays filled with 24 hours of data and value/item of array is tuple having direction and time. find following things,
- Total no of cars on Right and Left lane.
- Min and Max speed at sensor A.
- Min and Max speed at sensor B.
Finding no 1 is easy.
Only issue is with 2,3 as we don’t have any unit of distance given anywhere. I asked him he told that’s a problem ?
This what we can do without distance we can at-least find the minimum and maximum time for sensor A and B just traversing an array but after that finding a distance that’s still a mystery to me ? in last few minutes he told me take a guess and do it but no enough time.
Build an UBER platform no code discussion about how will you do it,
- How will handle locations (most updated) of the driver ?
- How will update the location of the driver (architecture of app or service to update) ?
- Find nearest driver ? (We can filter all drivers based on location)
- What if two cities are merged like Redmond and Bellevue then other car might be close but in second city where city filter want work ?
- How do you scale same app to other countries (like china) ?
- One you find the nearest driver how do pick them ? (I said ratings)
- What would do consider as good ratings ?
- Once you have 10 driver with 4.8 ratings how will you send the request ?
- What will you do if all 10 drivers receives and accepts 10 request simultaneously ?
Build Eclipse IDE. Told me to write down class diagram of all components.
- How will you handle Character Set ?
- How will you handle up key ?
- How will you handle code pre compilations ? different highlighting rules ?
- Where will be text render events in editor or page and why ?
No offer by the way.
In SDE-I two designing questions. I didn’t expected that. Even though i have done some designing over past 2 years but never attempted problem as big as an IDE.
Hope this helps and PEACE.
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.