Applied on career portal without referral. Had to finish OA within 7 days of receiving OA link.
Platform : HackerRank
OA was divided in 2 parts : DSA and Behavioral
Part-1 : Consists of two DSA questions which we need to complete within 105 mins with code explanation
Question 1 (Difficulty : Easy , Topic : Math)
Given an integer denoting a total number of wheels, help Amazon Logistics find the number of different ways to choose a fleet of vehicles from an infinite supply of two wheeled and four-wheeled vehicles such that the group of chosen vehicles has that exact total number of wheels. Two ways of choosing vehicles are considered to be different if and only if they contain different numbers of two-wheeled or four-wheeled vehicles.
For example, if our array wheels = [4,5,6] our return array would be res = [2, 0,2]. Case by case, we can have 1 four-wheel or 2 two wheel to have 4 wheels. We cannot have 5 wheels. We can have 1 four-wheel and 1 two wheel or 3 two-wheel vehicles in the final case.
Question 2 (Difficulty : Medium , Topic : Math+Prefix-Sufix Sum)
The Amazon Kindle Store is an online e-book store where readers can choose a book from
a wide range of categories. It also provides the ability to bookmark pages the user wishes to return to later. A book is represented as a binary string having two types of pages:
• '0': an ordinary page
• '1': a bookmarked page
Find the number of ways to select 3 pages in ascending index order such that no two adjacent selected pages are of the same type.
book = '10111'
Output : 3
This was a good question compared to question 1 as one might think to solve this using DP as it consists of making choice(take/not-take) at every point but DP will give TLE. I had done this question befor thanks to OA experience shared by someone on LC and this question does not exist on any platform as far as I know , so I didn't had hard time solving this one and question 1 was just a beginer level so I completed both questions and passed all TC's in around 12 mins and in next 15 mins explained in detail both approaches with example and why approach I had taken is better than any other approach and of course time and space complexity for both of them. Over all it took me around 30 mins to complete this part.
After part 1 we can take a break without any time restrictions
Part - 2 : No time constrain
It took me around 10 mins in this part, also an advise to briefly go throuh Amazon's LP for this part. This part consists of selecting an option for given questions so no need to worry much about this part
Verdict : Got Interview call on very next day(Around 18 hrs to be precise) of completing OA.