Amazon Python Interview Questions 2026

Published July 22, 2026 · Updated July 22, 2026

5 real Python interview questions asked at Amazon. Upvoted by engineers who cleared the loop. Covers Technical, Scenario rounds.

5 questions
206 engineers asked
279 upvotes
Company: Amazon
Technology: Python

All Python Questions Asked at Amazon

Amazon Medium Technical round JavaPythonJavaScript

Given an array of integers and a target sum, return all unique triplets that sum to the target. Discuss time and space complexity. Then extend the problem to k-sum and analyze how recursion depth changes performance for large k.

↑ 54 upvotes · 47 engineers asked this · SDE2
Amazon Medium Technical round JavaPython

Given an array of integers, find the length of the longest subarray with a sum equal to zero. Explain the prefix sum + HashMap approach and why the naive O(n2) solution is unacceptable for large inputs.

↑ 51 upvotes · 32 engineers asked this · SDE1
Amazon Medium Technical round JavaPython

Serialize and deserialize a binary tree. Implement both functions and explain why BFS serialization makes deserialization simpler than DFS. What is the time and space complexity?

↑ 44 upvotes · 27 engineers asked this · SDE1
Amazon Hard Scenario round 4–7 YearsPythonKafka

You have a Spark job that ingests 500GB of clickstream data daily. It is failing with OOM errors on the executor. How do you debug and fix it?

↑ 108 upvotes · 86 engineers asked this · Data Engineer
Amazon Medium Technical round 2-5 yearsPython

Explain how Python's dictionary achieves average O(1) lookup. What happens internally when two keys hash to the same bucket?

↑ 22 upvotes · 14 engineers asked this · SDE2

Practice these questions with AI feedback

Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.

Build my study plan →

More Amazon Questions

Amazon AWS Questions Amazon Java Questions

Python Questions at Other Companies

Google Python Questions Meta Python Questions

Browse by company

Amazon Google Microsoft Flipkart Swiggy Meta Apple Netflix Uber Airbnb Stripe Razorpay PhonePe Paytm Zomato Salesforce Oracle Adobe LinkedIn Atlassian Accenture Deloitte Wipro Infosys TCS Capgemini PayU General Anthropic OpenAI TikTok JPMorgan Walmart Spotify DoorDash Goldman Sachs Revolut Canva Capital One Lyft SAP Siemens Shopify Grab Cognizant LTIMindtree Myntra Hotstar Twitter Snowflake

Frequently asked questions

Given an array of integers and a target sum, return all unique triplets that sum to the target. Discuss time and space complexity. Then extend the problem to k-sum and analyze how recursion depth changes performance for large k.
Given an array of integers and a target sum, return all unique triplets that sum to the target. Discuss time and space complexity. Then extend the problem to k-sum and analyze how recursion depth changes performance for large k.
Given an array of integers, find the length of the longest subarray with a sum equal to zero.
Given an array of integers, find the length of the longest subarray with a sum equal to zero. Explain the prefix sum + HashMap approach and why the naive O(n2) solution is unacceptable for large inputs.
Serialize and deserialize a binary tree. Implement both functions and explain why BFS serialization makes deserialization simpler than DFS. What is the time and space complexity?
Serialize and deserialize a binary tree. Implement both functions and explain why BFS serialization makes deserialization simpler than DFS. What is the time and space complexity?
You have a Spark job that ingests 500GB of clickstream data daily. It is failing with OOM errors on the executor. How do you debug and fix it?
You have a Spark job that ingests 500GB of clickstream data daily. It is failing with OOM errors on the executor. How do you debug and fix it?
Explain how Python's dictionary achieves average O(1) lookup. What happens internally when two keys hash to the same bucket?
Explain how Python's dictionary achieves average O(1) lookup. What happens internally when two keys hash to the same bucket?