Felt like sharing the questions, so that one can have more understanding of what questions were being asked in Amazon.
Maximum Units on a truck:
You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]:
numberOfBoxesi is the number of boxes of type i.
numberOfUnitsPerBoxi is the number of units in each box of the type i.
You are also given an integer truckSize, which is the maximum number of boxes that can be put on the truck. You can choose any boxes to put on the truck as long as the number of boxes does not exceed truckSize.
Return the maximum total number of units that can be put on the truck.
The question actually was somewhat different but boils down to the same question pasted above. There were some confusing statements given in the question but with clear observation the question appears to be same.
The link to the question: https://leetcode.com/problems/maximum-units-on-a-truck/
The link to the other question: https://leetcode.com/discuss/interview-question/1412479/amazon-online-assessment-fetchitemstodisplay
I completed two of the above questions in 30 mins of which allocated time is 70 mins.(Easy-moderate)
Before the coding section, there was a debugging section where we need to debug the bugs in the code. (7 questions 20 mins Level: Easy)
After the coding section, there was an aptitude section.(24 questions 35 mins). Anybody with proper focus can do these questions.
This was followed by some work-style questions.
Code once submitted can't be modified!!!
EDIT1: C++17 is not supported! No auto loops and advanced stuff. Even improper cast of unsigned int and int gives you an error.
I've recieved my interview confirmation mail and I'm going to give the interview very soon.
Happy Coding.. :)