practice a little every day, paws crossed ♡
Coding & Algorithms Interview Questions
Practice 9403 coding, system design and machine learning questions from 546 companies, sorted by role, topic and interview round. Every question has step-by-step hints, a code runner that supports 8 languages and an AI mentor; members also get the full solution walkthrough.
- 9403
- Questions
- 546
- Companies
- 11
- Topics
- 8
- Languages
Showing 31–60 of 1080 results
- AmazonMediumSoftware EngineerCompute fruit spoilage time in a grid
This question evaluates a candidate's understanding of graph traversal concepts, grid-based state propagation, and reachability analysis in time-evolving systems.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerCompute optimal locker placement with obstacles
This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Compute optimal locker placement with obstacles states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerCompute product excluding index without division
This question evaluates array-manipulation and algorithmic problem-solving skills, focusing on computing a product-for-each-index using prefix and postfix accumulation concepts while reasoning about edge cases such as zeros, negative numbers, and integer overflow.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerCompute the Median After Each Stream Insertion
This problem tests your ability to maintain dynamic statistics in a data stream using efficient data structures to achieve logarithmic insertion and constant-time retrieval.
Coding & AlgorithmsOnsiteHeapsData StreamsSorting - AmazonMediumSoftware EngineerCount expressions reaching a target sum
This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Count expressions reaching a target sum states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsOnsite - AmazonMediumApplied ScientistDesign LFU cache with distributed extension
This question evaluates understanding of cache design and frequency-based eviction policies, efficient data structures that support O(1) operations, and techniques for approximate frequency estimation and summarization in distributed streaming environments.
Coding & AlgorithmsOnsite - AmazonMediumData ScientistDesign a Scalable, Fault-Tolerant Distributed Order System
This question evaluates system-design and algorithmic competencies, combining distributed-systems concepts — high availability, low-latency architecture, scalability levers, and fault-tolerance mechanisms — with practical binary-tree traversal and time–space complexity analysis.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerDesign a fixed-capacity circular queue
This question evaluates understanding of fixed-capacity circular queue data structures, array-based indexing, modular arithmetic, and the requirement for constant-time (O(1)) enqueue/dequeue operations.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerDesign a no-repeat top-frequency music player
Design a no-repeat frequency-based music player with addUserSongs and getNextSong APIs. Covers max-heap data structures, lazy deletion, cycle resets, mid-cycle song additions, and complexity.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerDesign rolling-window top-K click tracker
Design rolling-window top-K click tracker evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerDetect cycle in a directed graph
This question evaluates mastery of graph algorithms and graph theory concepts—specifically directed cycle detection—and assesses the ability to reason about algorithmic correctness and to analyze time and space complexity for competing approaches.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerDetermine string segmentability with dictionary
This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Determine string segmentability with dictionary states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerEscalation Stack That Resolves the Most-Reported Issue First
Design a support-escalation structure where resolving an issue always clears whichever one currently has the most open reports, breaking ties by the most recently reported occurrence. Tests combining frequency and recency so both operations run in O(1).
Coding & AlgorithmsOnsitestackhash-mapdesign - AmazonHardSoftware EngineerFind a Valid Course Order
This problem tests your ability to detect cycles in a directed graph and perform a topological sort to resolve dependencies.
Coding & AlgorithmsOnsiteGraphsTopological SortKahn's Algorithm - AmazonMediumSoftware EngineerFind longest common contiguous subarray
This question evaluates a candidate's proficiency in array and substring algorithm design, including concepts such as dynamic programming, hashing, and efficient search techniques.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerFind returning users from access logs
This question evaluates skills in time-series data processing, timestamp parsing and time-zone normalization, scalable stream or batch handling for logs that exceed memory, algorithmic complexity analysis, and test-case design for edge conditions such as midnight boundaries and duplicate events.
Coding & AlgorithmsOnsite - AmazonMediumApplied ScientistFind shortest path in a grid with obstacles
This question evaluates understanding of pathfinding in grid-based environments, graph traversal concepts, and algorithmic complexity when navigating obstacles and boundary constraints in an unweighted 2D search space.
Coding & AlgorithmsOnsite - AmazonHardSoftware EngineerFind the Closest Version by Date
This problem tests your ability to efficiently search through chronologically ordered records and handle binary search logic with custom comparison rules.
Coding & AlgorithmsOnsiteBinary SearchArraysAlgorithms - AmazonMediumSoftware EngineerFind the Kth Smallest Value in a Binary Search Tree
Deserialize a level-order serialized binary search tree and find its kth smallest element using an efficient in-order traversal.
Coding & AlgorithmsOnsitebinary-search-treetree-traversalstack - AmazonMediumSoftware EngineerFind the Minimum Processing Rate to Meet a Deadline
This problem tests the ability to determine a minimum threshold using binary search on the answer space, combined with modular arithmetic and ceiling division.
Coding & AlgorithmsOnsiteBinary SearchMathOptimization - AmazonHardSoftware EngineerFind the Most Common Visit Pattern
This problem tests your ability to process chronological event data to identify the most frequent 3-step sequence, requiring efficient data structures to handle large volumes of user logs.
Coding & AlgorithmsOnsiteHash MapSortingSliding Window - AmazonMediumSoftware EngineerFind the Most Frequent Request IDs
Implement an algorithm to identify the top k most frequent request IDs from a stream of log events, breaking frequency ties by smaller ID values and handling cases where k exceeds the number of unique IDs.
Coding & AlgorithmsOnsitehash-tableheapsorting - AmazonMediumFrontend EngineerFormat a Forest of Nested Comments
This problem tests your ability to reconstruct hierarchical relationships from flat input data and format them into a visual tree representation with specific character-based connectors.
Coding & AlgorithmsOnsiteRecursionTree TraversalString Formatting - AmazonMediumSoftware EngineerImplement Cache and Rotate Matrix
This two-part question evaluates competency in data structure design and in-place array manipulation, specifically the ability to implement an LRU cache with O(1)-average operations (including recency management, updates, and evictions) and to rotate an n x n matrix 90 degrees clockwise in place without extra space.
Coding & AlgorithmsOnsite - AmazonMediumApplied ScientistImplement K-means and solve interval/frequency tasks
This multi-part question evaluates understanding of K-means clustering, interval-merging algorithms, and frequency-based top-k retrieval, assessing competencies in unsupervised learning concepts, algorithmic problem solving, data structures, and complexity analysis.
Coding & AlgorithmsOnsite - AmazonMediumSoftware EngineerImplement LRU cache with O(1) ops
This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Implement LRU cache with O(1) ops states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsOnsite - AmazonMediumApplied ScientistImplement Multi-Head Attention from Scratch in NumPy
This problem tests your understanding of Transformer components by requiring an implementation of Multi-Head Scaled Dot-Product Attention using only NumPy, emphasizing matrix manipulations and numerical stability.
Coding & AlgorithmsOnsiteTransformersNumPyAttention - AmazonMediumApplied ScientistImplement PyTorch training loop
This question evaluates practical implementation skills in PyTorch, focusing on model and device management, batch-wise training mechanics, gradient handling, and optimizer interaction.
Coding & AlgorithmsOnsite - AmazonMediumData ScientistImplement Reservoir Sampling; Analyze Time and Space Complexity
This question evaluates understanding of streaming randomized algorithms and probabilistic reasoning—specifically reservoir sampling—along with analysis of time and space complexity and use of hash-based structures for duplicate detection; it is in the Coding & Algorithms domain and tests both conceptual probability invariants and practical implementation skills. Such problems are commonly asked to gauge a candidate's ability to design one-pass, linear-time solutions for unbounded data streams and to reason about algorithmic correctness and resource bounds in technical interviews.
Coding & AlgorithmsOnsite - AmazonMediumApplied ScientistImplement Top-p (Nucleus) Sampling in NumPy
This problem tests your ability to implement the nucleus sampling algorithm from scratch using NumPy, focusing on probability distribution processing and efficient array masking.
Coding & AlgorithmsOnsiteNumPyNLPProbability