Amazon Data Scientist Coding & Algorithms Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Generate Synthetic Clickstream Data with Python Function
Scenario The analytics team needs to generate synthetic click-stream records to test a new reporting pipeline before real traffic arrives. Question Wr...
Solve Search Insert Position Using Binary Search
Scenario Live coding round for an Amazon Applied Scientist position; candidate must solve LeetCode 35 (Search Insert Position) without helper librarie...
Calculate 7-Day Rolling Average for Energy Consumption
Scenario Hiring manager wants a quick coding exercise to verify programming fluency. Question Write a Python function that takes a list of daily energ...
Identify Number Pairs Adding to Target in Array
Scenario Coding round to identify all number pairs that add up to a target in an array containing duplicates. Question Given an integer array (may con...
Implement Reservoir Sampling; Analyze Time and Space Complexity
Scenario Process an unbounded stream of user IDs and maintain a uniform random sample of k users in memory. Question Implement reservoir sampling for ...
Determine Maximum Path Length in Directed Acyclic Graph
Scenario A backend service represents task dependencies as a directed graph; you need to understand how deep the longest dependency chain can get. Que...
Design a Scalable, Fault-Tolerant Distributed Order System
Scenario Round covering distributed-system design and algorithm implementation. Question Design a highly available, low-latency distributed order-proc...
Implement and Analyze 'Merge k Sorted Lists' Algorithm
Scenario Algorithm coding challenge during the final interview round. Question Implement LeetCode 23 ‘Merge k Sorted Lists’ and explain your complexit...
Implement Function to Determine Mode and Prime Numbers
Scenario Implementing utility algorithms within a data-processing library. Question Write a function that returns the mode of an integer list; if all ...
Implement BFS to Find Shortest Path in Graph
Scenario Social network needs to compute the shortest friend-distance between two users in an undirected graph containing millions of nodes. Question ...
Solve two-sum variants at scale
Base task: Given nums = [3, 1, 2, 2, 4] and target = 4, return the 0-based index pair (i, j) with i < j such that nums[i] + nums[j] = target. If multi...
Implement a high-throughput web crawler safely
Design and code (pseudocode acceptable) a multi-threaded web crawler that favors breadth-first discovery while continuously running analysis tasks on ...
Generate primes up to n efficiently
Implement a function that returns all prime numbers in the inclusive range 1..n. Requirements: handle n up to 10^7 efficiently (time and memory); retu...
Compute array modes with ties and no-mode rule
Write a function that returns the mode(s) of an integer array. Requirements: if all values are unique, return an empty list (there is no mode); allow ...
Implement streaming k-way merge with constraints
Implement a function merge_k(iterators, N) that returns the first N items of the global ascending order from k sorted, potentially unbounded iterators...
Solve stock, BFS path, and merge intervals
Solve three coding problems; justify complexity and corner cases. A) Best Time to Buy/Sell Stock (one transaction): Given prices[0..n-1] (integers), r...
Solve subset-count and kth-factor problems
Two Independent Tasks A) Maximum Count Under Sum Constraint You are given an integer array arr and an integer budget n. Return the maximum number of e...
Implement list overlap and dense-ranked word frequencies
Part A — Multiset overlap count Implement count_overlap(a: List[int], b: List[int]) -> int that returns the size of the multiset intersection of a and...
Solve Algorithmic Challenges in Online Coding Assessments
Scenario Online assessment requiring implementation of common algorithmic problems. Question Given an array of integers and a target, return indices o...
Design Efficient Data Structure for Median Retrieval
Scenario Senior problem-solving round assessing algorithmic thinking under time pressure. Question Design a data structure that supports inserting int...