Amazon | India | SDE1 New grad | Phone Interview
Anonymous User
906

The interview was held on Amazon Chime.
The interviewer started with asking me to describe any project that I had worked on. This was followed by 2 coding questions.

Question 1
Given a stream of numbers, find the number of groups that can be formed using the maximum number of elements such that each group satisfies the following constraints -

Group constraints

  1. Each group can have only 2 or 3 elements
  2. The sum of elements in the group should be divisible by 3

Ex: 1,2,3,5,7,12,14,18,24
Ans: 3
[(1,2,3),(5,7,12),(18,24)]

PS: You can skip elements also

Question 2
Given a 2D matrix consisiting of only 0s and 1s where each row and column is sorted in the non-increasing order, give an optimal solution to count the number of 0s.

Ex:
1 1 1 0
1 1 0 0
1 0 0 0
0 0 0 0

Ans: 10

The first question didn't go well :( but a very big thank you to the leetcode community! I've improved a lot by practicising on leetcode and hope to continue to do so.

Comments (6)