Python Interview Questions
Python is the first thing nearly every data interview tests, usually around strings, hashing and arrays. These 65+ questions come from 36 companies. Start solving and check your level of preparation.
By topic
By company
Airbnb4
OpenAI4
Stripe4
DoorDash3
Netflix3
Perplexity3
Pinterest3
Target3
Zillow3
Amazon2
Best Buy2
Cohere2
Databricks2
Etsy2
Instacart2
Lyft2
Meta2
Robinhood2
Scale AI2
Uber2
Walmart2
Anthropic1
Capital One1
Datadog1
DraftKings1
Google1
Hugging Face1
LinkedIn1
Mastercard1
Microsoft1
Peloton1
Salesforce1
Sierra1
Visa1
Wayfair1
Workday1
All the questions
- Anagram checkPython
Etsyeasy - Any duplicate transaction ids?Python
Visaeasy - Back off between retriesLLM
Scale AIeasy - Best week of salesPython
Targeteasy - Busiest request hourPython
Lyfteasy - Chunk a document for embeddingRAG
Perplexityeasy - FactorialPython
Googleeasy - Find a price in a sorted listPython
Best Buyeasy - First item bought twicePython
Instacarteasy - First unique characterPython
Amazoneasy - FizzBuzzPython
Microsofteasy - Longest streak of successful paymentsPython
Stripeeasy - Lowest and highest farePython
Lyfteasy - Median order valueStatistics
Airbnbeasy - Merge sales by regionPython
Targeteasy - Merge sorted delivery timesPython
DoorDasheasy - Mirror promo codesPython
Airbnbeasy - Missing order numberPython
Walmarteasy - Move zero-sale days to the endPython
Best Buyeasy - Normalize hashtagsPython
Pinteresteasy - Price changes month to monthPython
Zilloweasy - Remove duplicates, keep the orderPython
Netflixeasy - Reverse the wordsPython
LinkedIneasy - Rotate a shift schedulePython
Walmarteasy - Split requests into batchesPython
Stripeeasy - Turn a reply into a labelLLM
Cohereeasy - Ask again until the JSON parsesLLM
OpenAImedium - Balanced bracketsPython
Salesforcemedium - Best single tradePython
Robinhoodmedium - Best stretch of daysPython
Robinhoodmedium - Check a structured replyLLM
Databricksmedium - Compress a status logPython
Ubermedium - Customers who came backPython
Targetmedium - Drop near-duplicate chunksRAG
Perplexitymedium - Fill the context windowRAG
Anthropicmedium - First and last position of a userPython
Metamedium - Flatten a category treePython
Amazonmedium - Fuse two ranked listsRAG
Hugging Facemedium - Group anagramsPython
Pinterestmedium - Invert team assignmentsPython
Capital Onemedium - Kth largest orderPython
Instacartmedium - Longest run of consecutive daysPython
Pelotonmedium - Merge viewing sessionsPython
Netflixmedium - Most common review wordPython
Etsymedium - Most visited locationPython
DoorDashmedium - Outliers by z-scoreStatistics
Stripemedium - Pick the model that costs leastLLM
Perplexitymedium - Pull the JSON out of a replyLLM
OpenAImedium - Read a nested settingPython
Mastercardmedium - Retry a failed model callLLM
OpenAImedium - Retry a rate limit, not a bad requestLLM
Databricksmedium - Sort employee recordsPython
Workdaymedium - Standard deviation of scoresStatistics
DraftKingsmedium - The 95th percentileStatistics
Datadogmedium - Top chunks by cosine similarityRAG
Coheremedium - Top pin categoriesPython
Pinterestmedium - Trim a conversation to a budgetLLM
Sierramedium - Two homes that match a budgetPython
Zillowmedium - Where a new price fitsPython
Zillowmedium - Which products repeat?Python
Wayfairmedium - Correlation between metricsStatistics
Metahard - Let the model use a toolLLM
OpenAIhard - Longest palindrome in a namePython
Airbnbhard - Longest trip without repeat citiesPythonPremium
Airbnbhard - Score an answer against the truthLLM
Scale AIhard - Search a rotated schedulePythonPremium
Uberhard - Stretches that hit a targetPythonPremium
DoorDashhard - Three transactions that cancel outPython
Stripehard - Two episodes before landingPython
Netflixhard
Questions last reviewed 19 October 2026.