Panda Guru LogoPanda
Guru

Amazon SDE-2 | India | Feb 2025 | [Rejected]

Round 1

Questions:

  1. Intro
  2. Are 2 binary trees balanced?
  3. In a BST, 2 elements are swapped, tell the 2 elements.
    • This had to be done in place without using any extra array. Already gave the extra array approach.
    • If you give an approach too early, they will tell you to come up with a better approach.
  4. There was one more question I don't fully remember; it was fairly easy.
  5. Leadership Principle question - don't remember.
Candidate's Approach
  • Explained the approach for the BST question, which was similar to the Lowest Common Ancestor (LCA) method.
  • Wasn't able to fully code on paper but the interviewer seemed content with the explanation.
Interviewer's Feedback

No feedback provided.


Round 2

Questions:

  1. Intro
  2. Given a string, tell the lexicographical position of the string amongst all its combinations.
    • Applied some Permutations and Combinations (PnC), gave the mathematical approach first and then coded the same.
  3. Given arrival and departure time of the trains, tell the number of platforms required so that all trains can be accommodated at any given time.
Candidate's Approach
  • Started with a stack approach for the train scheduling problem, but was prompted to provide a better approach without extra space.
  • Suggested a two-pointer approach but couldn't come up with it on the spot, so coded the stack approach instead.
  • Remembered an edge case and switched to a min-heap approach, explaining the code with the edge case.
  • The two-pointer approach suggested by the interviewer failed at the same edge case that the stack approach did, leading to the interviewer being satisfied with the candidate's approach.
Interviewer's Feedback

No feedback provided.