Amazon | SDE-2 | Offer accepted 2022

amazon logo
amazon
sde-2Offer
September 14, 20240 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.

Full Experience

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.

Interview Questions (13)

Q1
Rotting Oranges
Data Structures & AlgorithmsMedium

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.

Q2
Number of Islands
Data Structures & AlgorithmsMedium

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.

Q3
Meeting Scheduler
Data Structures & AlgorithmsMedium

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.

Q4
Lowest Common Ancestor of a Binary Tree
Data Structures & AlgorithmsMedium

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).”

Q5
3Sum
Data Structures & AlgorithmsMedium

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.

Q6
House Robber
Data Structures & AlgorithmsMedium

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.

Q7
Longest Substring Without Repeating Characters
Data Structures & AlgorithmsMedium

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

Q8
Best Time to Buy and Sell Stock II
Data Structures & AlgorithmsMedium

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.

Q9
Can I Win
Data Structures & AlgorithmsMedium

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.

Q10
Design a Parking Lot
System DesignHard

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.

Q11
Low-Level Design for StackOverflow
System DesignHard

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.

Q12
Design Amazon Locker Service
System DesignHard

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.

Q13
Design a URL Shortener
System DesignHard

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.

Preparation Tips

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.

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!