Amazon SDE II | Hiring process | [Offer]
Company: Amazon
Role: SDE II
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
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 occurred 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 straightforward. (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 realize its wrong by giving another sample case then I figured out the correct approach and coded it.