Amazon Interview Questions
Amazon interviews are known for their rigor and focus on leadership principles (LPs). The process typically includes an online assessment, phone screen, and a full-day loop of 4-5 interviews. They heavily weigh problem-solving, data structures and algorithms (DSA), system design, and behavioral responses aligned with their 16 LPs. Expect a mix of technical and LP-based questions with a bar-raiser ensuring quality.
What Amazon interviews focus on
Data Structures & Algorithms
Amazon emphasizes strong fundamentals in DSA with medium-to-hard LeetCode-style problems. Candidates should be comfortable with arrays, strings, trees, graphs, dynamic programming, and complexity analysis.
System Design
For senior roles (SDE2+), system design interviews test ability to architect scalable, fault-tolerant distributed systems. Commonly discussed designs include URL shorteners, chat systems, and Amazon-like e-commerce.
Behavioral / Leadership Principles
Behavioral questions are based on Amazon's 16 Leadership Principles (e.g., Customer Obsession, Ownership, Dive Deep). Use the STAR method to provide concrete examples of past work experiences.
Domain & Coding Proficiency
Depending on the role, domain-specific knowledge (e.g., AWS, machine learning, iOS) may be tested. Coding on a whiteboard or shared editor is standard for all technical interviews.
Common Amazon interview questions
- Tell me about a time you disagreed with your manager. How did you handle it? (Leadership Principle: Have Backbone; Disagree and Commit)What a strong answer covers
- Disagreement with manager over technical approach
- Used data and customer impact to support my view
- Proposed alternative solution with cost-benefit analysis
- Accepted manager's final decision and committed fully
- Maintained professional relationship and delivered on time
View a sample answer
A disagreement arose when my manager wanted to use a monolithic architecture for a new microservice to speed up deployment, while I believed microservices would better scale. I scheduled a one-on-one to present my reasoning, backed by performance benchmarks and a risk analysis of future scaling costs. After listening, my manager explained the team's current capacity constraints. I acknowledged the trade-offs and committed to the monolithic approach, suggesting we document refactoring checkpoints. We delivered ahead of schedule, and the structured checkpoints later enabled a smooth migration. The key was respectful debate and then unified execution.
- Design a URL shortening service like TinyURL. (System Design)What a strong answer covers
- Key generation: Hash (MD5, base62) vs. counter (ZK, Snowflake)
- Storage: Relational for mapping, Redis for caching hot URLs
- Redirection: 301 (permanent) vs 302 (temporary)
- Scaling: Database sharding by hash, CDN for short links
- Additional features: Custom slugs, expiration analytics
View a sample answer
A URL shortener maps long URLs to short keys (e.g., 7 characters from base62 encoding). Requirements include high availability, low latency redirects (P99 < 50ms), and ability to handle billions of URLs. A common approach uses a counter (e.g., distributed ID generator like Snowflake or Redis incr) to produce unique IDs, then encode them to base62. The mapping is stored in a relational DB (e.g., Aurora) with a Redis cache in front for hot URLs. Redirection uses 301 status for cached mappings to reduce load. For scaling, the database is sharded by hash of the short key. CDN (CloudFront) caches the redirect response. Additional features: custom aliases (check uniqueness via secondary index), expiration (TTL in cache + DB cleanup), and click analytics (asynchronous log processing with Kinesis). A common pitfall is not planning for key collisions at scale—using a centralized counter avoids that. Trade-off: counter-based keys are predictable (security through obscurity?); hashing may require collision resolution.
- Given an array of integers, find two numbers that add up to a specific target. (Coding, commonly reported)What a strong answer covers
- Hash map to store complement values O(n) time
- Edge cases: no solution, multiple valid pairs, negative numbers
- Return indices as per problem specification
- Follow-up: sorted array two-pointer approach
- Space complexity O(n) due to map
View a sample answer
The classic solution uses a hash map to store each element's complement (target minus current value) as we iterate. For each number, check if it exists in the map; if yes, return the indices. If not, store the current number's complement with its index. This yields O(n) time and O(n) space. Edge cases include an empty array (return empty) and no solution (return empty). For sorted arrays, a two-pointer technique reduces space to O(1).
- Describe a project where you had to make a trade-off between speed and quality. What did you decide and why? (LP: Bias for Action vs. Insist on the Highest Standards)What a strong answer covers
- Trade-off between speed (fast delivery) and quality (polished features)
- Chose to launch MVP with core functionality to gather user feedback
- Deferred advanced features and technical debt to subsequent iterations
- Measured success via user engagement metrics post-launch
- Iterated based on feedback, eventually achieving high quality
View a sample answer
As the tech lead for a new notification system, the team debated between a fully featured, low-latency system (quarters of development) and a simpler, faster MVP. I argued for the MVP because user needs were uncertain. We launched in 6 weeks with basic email and SMS, skipping push notifications and advanced templating. Engagement metrics (click-through rate, open rate) were 30% higher than expected, validating the core concept. We then prioritized push notifications and custom templates in the next two quarters based on customer requests. By deferring non-critical features, we captured market opportunity and avoided building unnecessary complexity. The trade-off meant some early adopters experienced limited functionality, but regular updates communicated our commitment to quality. Ultimately, the product achieved high standards without sacrificing speed to market.
- Implement a function to serialize and deserialize a binary tree. (Coding, Binary Tree)What a strong answer covers
- Serialize: Preorder traversal with marker for null nodes
- Deserialize: Queue to process nodes in order
- Time complexity O(n), space O(n) for both
- Handles empty trees and all data types
- Alternative: BFS with level markers
View a sample answer
Serialization converts a binary tree to a string (e.g., list of node values separated by commas with 'null' for missing children). A common approach uses preorder traversal: recursively concatenate root, then left, then right, appending 'null' for empty children. Deserialization takes the token list, uses a queue (or iterator), and builds the tree recursively: dequeue the next value; if 'null', return None; else create node, set left from recursion, right from recursion. Complexity is O(n) time and O(n) space for the recursion stack and output list. Edge cases include an empty tree (serialize to empty string, deserialize returns None). The method works for any node values that can be serialized to strings.
- Explain a time you significantly improved a process or product. What steps did you take? (LP: Ownership, Deliver Results)What a strong answer covers
- Identified manual deployment process as bottleneck causing delays
- Proposed continuous integration/deployment pipeline with automated testing
- Led cross-team effort to implement CI/CD using Jenkins and Docker
- Reduced deployment time from 2 hours to 10 minutes per release
- Resulted in faster iteration, fewer errors, and improved team morale
View a sample answer
Our deployment process required manual steps including merging branches, running tests locally, and SSH-ing to servers. This frequently caused errors and late releases. I proposed a CI/CD pipeline using Jenkins and Docker, with automated unit and integration tests, plus blue/green deployments. I presented a ROI analysis showing a potential 70% reduction in deployment time. After approval, I led a team of three engineers to set up Jenkins pipelines, containerize the application, and configure staging environments. The rollout was phased: first for non-critical services, then core services. Post-implementation, deployment time dropped from 2 hours to 10 minutes, and production incidents decreased by 40%. The key was perseverance resolving initial resistance from senior devs and ensuring thorough documentation. This ownership directly improved team velocity and product stability.
- Design a real-time chat system like WhatsApp or Messenger. (System Design, commonly reported)What a strong answer covers
- Real-time communication via WebSockets for low latency
- Message persistence with NoSQL (Cassandra) for scale
- Chat sessions and synchronization using message sequencing (Lamport clocks)
- Offline support using push notifications and last-seen ID
- Scalability through horizontal sharding and connection pooling
View a sample answer
A design for real-time chat must handle millions of concurrent connections, low latency (<100ms), and message ordering. Key components: Connection Manager (WebSocket servers behind a load balancer like HAProxy), Message Service (asynchronous processing via Kafka/RabbitMQ), and Data Storage (Cassandra for chat history, DynamoDB for session/metadata). Each WebSocket server maintains connections per user; routing uses consistent hashing (e.g., by user ID) for sticky sessions. Messages are published to a Kafka topic per chat room; consumers write to DB and fan out to recipients' WebSocket nodes using Redis pub/sub or internal RPC. Message ordering within a chat requires a sequence number (e.g., Lamport timestamp from the server). Offline delivery: store messages with a last-read marker; push via FCM/APNs. For presence, use a shared cache (Redis) of online users with heartbeats. Scaling: horizontally partition chat sessions by user ID hash; each node handles a subset. A common pitfall is assuming eventual consistency is acceptable for ordering—chats require strong ordering guarantees, handled via single-threaded processing per chat partition. Trade-offs: persistence vs. performance (batch writes vs. immediate writes).
- Find the longest substring without repeating characters. (Coding, Sliding Window)What a strong answer covers
- Sliding window with two pointers and hash set to track characters
- Expand right pointer while characters are unique
- When duplicate found, move left pointer until no duplicate
- Keep maximum window length
- Time complexity O(n), space O(min(n, alphabet size))
View a sample answer
The longest substring without repeating characters can be found using a sliding window approach. Maintain two indices (left and right) representing the current window, and a hash set (or map) of characters in the window. Iterate the right pointer, adding each character to the set. If a duplicate is encountered, increment left pointer, removing characters from set, until the duplicate is gone. Update the max length after each step. This yields O(n) time and O(1) space (since alphabet size is constant). Edge cases: empty string (return 0), all unique (return length of string). A follow-up asks for the substring itself, which can be tracked by storing the window's start when max is updated.
Tips to prepare
- Internalize the 16 Leadership Principles and prepare 2-3 STAR stories per principle that demonstrate them in action.
- Practice coding on a whiteboard or without an IDE to simulate the interview environment; focus on clear communication of your thought process.
- For system design, study the basics of scalability, load balancing, caching, databases (SQL vs NoSQL), and practice designing popular systems.
- Always ask clarifying questions before diving into a solution; Amazon values customer obsession and understanding requirements deeply.
- Prepare to discuss trade-offs and alternative approaches; interviewers want to see your ability to weigh options and make informed decisions.
Frequently asked
What are the typical rounds in an Amazon interview?
The process includes an online assessment (OA) with coding and work style questions, a phone screen, and an on-site (or virtual) loop of 4-5 interviews consisting of two coding, one system design (for senior roles), and two behavioral/LP-focused interviews.
How difficult is the Amazon interview?
Amazon interviews are considered challenging, with a high bar for problem-solving and LP alignment. Success requires solid DSA, system design knowledge, and authentic behavioral examples.
How long does the Amazon interview process take?
From application to offer, it typically takes 2-4 weeks for the OA and phone screen, and another 1-2 weeks to schedule the on-site loop, depending on role and location.
What does Amazon value most in candidates?
Amazon values problem-solving ability, alignment with Leadership Principles (especially Customer Obsession and Ownership), and the ability to dive deep into technical decisions.
How can I stand out in the Amazon interview?
Show deep knowledge of Amazon's principles by tailoring your stories to them, demonstrate a bias for action, and clearly articulate your thought process in technical problems. Being data-driven and customer-focused also sets candidates apart.
Practice Amazon-style questions with instant AI feedback
Upload your resume and Offersly runs a tailored mock interview, scores your answers across relevance, depth, clarity and correctness, and shows you exactly what to fix.