Amazon SDE II | Hiring process | [Offer]

7
Aug 27, 2024

INTERVIEW EXPERIENCE:-
Basic introduction then started with DSA questions....

https://www.geeksforgeeks.org/problems/easy-string2212/1
A bit modification in this question...
Modifications :-
i) String consisted only lowercase letters.
ii) If a character occured more than 9 times then we have to return "9" + "that char" and continue counting again.
Sample case 1:- "aaaaaaaaaaaaaabbeee"
Output:-"9a5a2b3e"

Sample case 2 :- "abcde"
Output :- "1a1b1c1d1e"

Got it right in a single go... was pretty simple and straight forward. (O(n) approach).

https://www.geeksforgeeks.org/check-if-leaf-traversal-of-two-binary-trees-is-same/
Exact Same question was asked.

First I gave a wrong approach of level order traversal then interviewer made me realise its wrong by giving another sample case then i figured out the correct approach and coded it.

Comments (0)