Amazon SDE-2 Interview Questions.

amazon logo
amazon
SDE-2USA
June 27, 20254 reads

Summary

The candidate details their Amazon SDE-2 interview, which consisted of four rounds. These rounds covered Low-Level Design for file filtering, a complex 2D grid problem on radio tower communication, vertical order traversal for a binary tree, and the design of a distributed movie ticket booking system.

Full Experience

Location: USA

Round 1(LLD):

WAS ASKED TO SHARE SCREEN FOR THIS ROUND. Expectation was to write a maintainable and extendable code. Given a base path list/return all the files which match the below conditions.
  • Files with .xml extension
  • Files less than 5MB
Follow Up question to include a file range in the file search

Round 2:

Given a 2D grid whose spaces consist of emptiness, radio towers, and mountains, determine which radio towers are able to communicate with one another.

Each radio tower’s signal travels in 4 directions from the tower (UP, DOWN, LEFT, RIGHT), and the signal will travel indefinitely until it either hits a mountain, or hits another radio tower.

Expected input: int[][] grid, where each space is either:

  • 0: Empty space
  • 1: Radio tower
  • 2: Mountain

Expected output: Some representation showing which towers can talk to which others (maybe a Map<Coordinate, List<Coordinate>> to map each tower to the towers it can see (adjacency list), but we can be flexible on the output as long as it’s understandable)

Follow-up Question: Towers are given an intensity need to traverse up to the intensity only and consider overlap of signal from another tower as a valid connection.

Round 3:

  • Given a tree, Can you print the nodes in a vertical order.
Imagine that the nodes are also supposed to be parsed left to right.
                2
             *     *
           3         4
        *   *     *    *
      5     6     8      7
    *   *
   9     1

output: 9, 5, 3, 1, 2, 6, 8, 4, 7

Round 4:

Design a distributed ticket booking system for a movie theater chain with 500 locations across the country. The system needs to handle concurrent bookings. Interviewer was more interested in API design and DB schema than the High Level SD

Interview Questions (4)

Q1
File Search System with Filters
Data Structures & Algorithms

Design a system that, given a base path, can return all files matching specific conditions: files with a '.xml' extension and files less than 5MB. A follow-up question included extending this to search for files within a specified size range.

Q2
Radio Tower Communication Network
Data Structures & AlgorithmsHard

Given a 2D grid consisting of empty spaces (0), radio towers (1), and mountains (2), determine which radio towers are able to communicate with one another. A radio tower's signal travels indefinitely in 4 directions (UP, DOWN, LEFT, RIGHT) until it hits a mountain or another radio tower. The expected output is a representation like an adjacency list (e.g., Map<Coordinate, List<Coordinate>>). The follow-up involved towers having an intensity, meaning signals only travel up to that intensity, and considering signal overlap from other towers as a valid connection.

Q3
Vertical Order Traversal of a Binary Tree
Data Structures & AlgorithmsMedium

Given a binary tree, print its nodes in vertical order. Nodes at the same vertical level should be parsed from left to right. An example tree and its corresponding vertical order output were provided.

Q4
Distributed Movie Ticket Booking System Design
System DesignHard

Design a distributed ticket booking system for a movie theater chain with 500 locations across the country. The system must handle concurrent bookings. The interviewer emphasized API design and database schema over high-level system architecture.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

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