amazon logo
Amazon· SDE II

Amazon | SDE II | Rejected | 4 YOE (Tier-1)

Experience
4 years
Posted
24 Jun 2026
67 reads

Summary

I completed a virtual SDE II interview at Amazon, solving the "Number of Atoms" coding problem and a Dive Deep behavioral question, but was ultimately rejected.

How it went

Applied for SDE II at Amazon. Virtual round (~60 min): 1 coding + 1 LP.

Coding: Number of Atoms (LC 726)

  • Clarified input + edge cases, explained approach, then coded the stack-of-maps solution (push a map on "(", on ")" multiply popped map by the count and merge down, parse atoms + counts while scanning, sorted output via std::map). It worked.
  • Interviewer kept pushing for the optimal solution. Stack-of-maps is O(n^2) due to repeated merges; I couldn't get to the better approach in time and ran out of time.

LP: 1 behavioral question (Dive Deep), standard STAR with follow-ups.

Verdict: Rejected

Questions asked (1)

  1. 01

    Number of Atoms

    Data Structures & Algorithms · Hard

    Given a chemical formula string containing element symbols, parentheses, and numeric multipliers, return a string that lists each atom followed by its count (if greater than 1) in lexicographically sorted order. The formula may include nested parentheses, and counts apply to the group inside the parentheses.

    Example: Input: "Mg(OH)2" Output: "H2MgO2".

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Amazon recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!