amazon logo
Amazon· sde-2

Amazon | SDE-2 | Offer accepted 2022

Result
Offer
Posted
14 Sept 2024
270 reads

Summary

I successfully interviewed at Amazon multiple times for an SDE-2 position and ultimately accepted an offer in 2022. This post details the diverse range of coding and design questions I encountered across different interview rounds.

How it went

I had the opportunity to interview at Amazon on several occasions, which eventually led to me receiving and accepting an offer for an SDE-2 role in 2022. To help others, I've compiled a comprehensive list of the questions I faced during these processes, grouping them by the specific rounds they appeared in.

Questions asked (13)

  1. 01

    Rotting Oranges

    Data Structures & Algorithms · Medium

    Given a grid representing a field of oranges, where 0 represents an empty cell, 1 represents a fresh orange, and 2 represents a rotten orange. Every minute, any fresh orange that is 4-directionally adjacent to a rotten orange becomes rotten. Determine the minimum number of minutes that must elapse until no fresh oranges remain. If it's impossible for all fresh oranges to rot, return -1.

    Open the problem
  2. 02

    Number of Islands

    Data Structures & Algorithms · Medium

    Given an m x n 2D binary grid which represents a map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.

    Open the problem
  3. 03

    Meeting Scheduler

    Data Structures & Algorithms · Medium

    Given the availability time slots for two people (slots1 and slots2) and a meeting duration, find the earliest time slot that works for both people and is at least of the given duration. Each slot is represented as [start, end]. Assume start < end and all times are non-negative integers.

    Open the problem
  4. 04

    Lowest Common Ancestor of a Binary Tree

    Data Structures & Algorithms · Medium

    Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”

    Open the problem
  5. 05

    3Sum

    Data Structures & Algorithms · Medium

    Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets.

    Open the problem
  6. 06

    House Robber

    Data Structures & Algorithms · Medium

    You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses were broken into on the same night. Given an integer array nums representing the amount of money in each house, return the maximum amount of money you can rob tonight without alerting the police.

    Open the problem
  7. 07

    Longest Substring Without Repeating Characters

    Data Structures & Algorithms · Medium

    Given a string s, find the length of the longest substring without repeating characters.

    Open the problem
  8. 08

    Best Time to Buy and Sell Stock II

    Data Structures & Algorithms · Medium

    You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then immediately sell it on the same day. Find the maximum profit you can achieve.

    Open the problem
  9. 09

    Can I Win

    Data Structures & Algorithms · Medium

    In the "Can I Win" game, two players take turns picking numbers from a common pool of integers ranging from 1 to maxChoosableInteger. The first player to accumulate a total sum of numbers that is equal to or greater than desiredTotal wins. Once a number is picked, it cannot be used again. Determine if the first player can win, assuming both players play optimally.

    Open the problem
  10. 10

    Design a Parking Lot

    System Design · Hard

    Design a parking lot system that supports multiple types of vehicles (e.g., motorcycles, cars, buses) and efficiently allocates the nearest empty parking slot. Consider using a data structure like a min-heap to optimize the slot allocation process.

  11. 11

    Low-Level Design for StackOverflow

    System Design · Hard

    Design the low-level architecture for a platform similar to StackOverflow. Your design should cover core entities such as users, questions (posts), answers, comments, tags, and votes. Detail the database schema (tables, relationships) and define the necessary APIs for key functionalities like posting a question, answering, commenting, and voting.

  12. 12

    Design Amazon Locker Service

    System Design · Hard

    Design a high-level system for a locker delivery service, similar to Amazon Lockers. The design should focus on key aspects such as managing the availability of individual locker units, ensuring data consistency during the booking and reservation process, and generating secure, unique one-time passwords (OTPs) for customers to access their assigned lockers.

  13. 13

    Design a URL Shortener

    System Design · Hard

    Design a scalable URL shortener service. This system should take a long URL as input and return a short, unique URL. Consider how to generate short codes, handle redirects, ensure high availability, and manage potential collisions or expired URLs. Discuss database choices, distributed systems considerations, and API design.

How they prepared

I diligently prepared by practicing a wide array of LeetCode problems and diving deep into system design concepts. For those interested in understanding my full preparation strategy and the resources I utilized, you can find a more detailed account in my Google Preparation Blog.

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!