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 61–90 of 1706 results
- AmazonMediumSoftware EngineerCompute tree diameter
This question evaluates understanding of binary tree algorithms, recursion versus iterative traversal strategies, and competence in algorithmic analysis including time and space complexity and handling deep-recursion stack overflow when computing a tree's diameter.
Coding & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerCount Connected Components in an Undirected Graph
This question tests the ability to traverse an undirected graph using graph search algorithms to identify and count disjoint subgraphs.
Coding & AlgorithmsTechnical ScreenGraphsBFSDFS - AmazonMediumSoftware EngineerCount Customers Who Visited on Multiple Dates
Tests data manipulation, hash set/map aggregation, and date deduplication to identify users with repeat visits across distinct calendar days.
Coding & AlgorithmsTechnical ScreenHash TableCountingString - AmazonMediumSoftware EngineerCount regions with DFS
This question evaluates proficiency in graph traversal and grid-based connected-component detection using depth-first search on a binary m x n grid, along with algorithmic complexity analysis and techniques to avoid revisiting cells.
Coding & AlgorithmsTechnical Screen - AmazonHardSoftware EngineerCount unique Morse-code word transformations
This question evaluates a candidate's ability to implement string transformations based on a fixed character-to-code mapping and to identify distinct results, testing competencies in encoding, string manipulation, and deduplication.
Coding & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerCourse Prerequisite Feasibility
This question tests the ability to detect cycles in a directed graph to determine if a set of academic courses with prerequisite constraints can be completed.
Coding & AlgorithmsTechnical ScreenGraphDFSTopological Sort - AmazonMediumSoftware EngineerCreate a Binary Tree from Parent-Child Descriptions
Construct one valid binary tree from unordered parent-child descriptions that identify left and right links. Reuse node identities across records, support children appearing before parents, and return the unique root.
Coding & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerDesign 2D DP on a DAG
Design 2D DP on a DAG 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 & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerDesign LCA with flexible inputs and rule
This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Design LCA with flexible inputs and rule states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerDesign a hierarchical locking tree
This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Design a hierarchical locking tree states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerDesign a weighted random value generator
This problem tests your ability to implement efficient weighted random selection using prefix sums and binary search, and handling state updates.
Coding & AlgorithmsTechnical ScreenBinary SearchHash MapProbability - AmazonMediumSoftware EngineerDetect and Break a Cycle in a Singly Linked List
Tests detection and resolution of cycles in singly linked lists using two-pointer techniques with constant auxiliary space.
Coding & AlgorithmsTechnical Screenlinked-listtwo-pointersfloyds-algorithm - AmazonMediumSoftware EngineerDetect cycles in lists and graphs
This question evaluates understanding of cycle detection in linked lists and directed graphs, assessing competencies in pointer manipulation, graph traversal strategies, and reasoning about algorithmic time and space complexity within the Coding & Algorithms domain.
Coding & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerDetect words formed by multiple dictionary parts
This question evaluates proficiency in string processing, selection and use of appropriate data structures and algorithms (hashing, tries), dynamic programming and memoization, and complexity analysis for large inputs and edge-case handling within the Coding & Algorithms domain.
Coding & AlgorithmsTechnical Screen - AmazonMediumData ScientistDetermine Length of Longest Unique Substring
This question evaluates string-processing skills and algorithmic problem-solving, including handling character uniqueness and performance considerations. Commonly asked in Coding & Algorithms interviews to assess a candidate's ability to implement efficient solutions and reason about time/space trade-offs, it targets practical application rather than purely conceptual understanding.
Coding & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerDetermine Whether All Courses Can Be Completed
This problem tests your ability to model dependencies using a directed graph and detect cycles to determine if a set of tasks can be completed.
Coding & AlgorithmsTechnical ScreenGraphTopological SortDFS - AmazonEasySoftware EngineerDetermine Whether One Person Can Attend Every Meeting
This problem tests your ability to handle interval sorting and linear-time overlap detection to ensure no two meetings conflict.
Coding & AlgorithmsTechnical ScreenSortingIntervalsGreedy - AmazonMediumSoftware EngineerDetermine Whether Package Weights Can Be Safely Arranged
Tests array manipulation, counting techniques, and greedy or constraint-satisfaction logic to determine if an array can be permuted so no two adjacent elements sum to ten or more.
Coding & AlgorithmsTechnical ScreenGreedyCountingArray - AmazonMediumSoftware EngineerDetermine Whether a Binary Tree Is a Valid BST
Determine whether an entire breadth-first encoded binary tree obeys the strict BST invariant. Use ancestor bounds rather than only parent-child checks, reject duplicates, handle numeric extremes, and discuss an iterative approach for deep trees.
Coding & AlgorithmsTechnical Screen - AmazonMediumApplied ScientistDetermine if all courses can be completed
This problem tests your ability to model prerequisites as a directed graph and detect cycles to determine if a valid topological ordering exists.
Coding & AlgorithmsTechnical ScreenGraphsTopological SortDFS - AmazonHardSoftware EngineerEvaluate IP Access Rules
This question evaluates knowledge of IPv4 addressing, CIDR subnet matching, and access-control rule resolution, assessing competency in bitwise address reasoning, prefix-length precedence, and rule tie-breaking.
Coding & AlgorithmsTechnical Screen - AmazonHardSoftware EngineerFind Two-Word Compound Words
This problem tests string manipulation, hash set lookups, and the ability to efficiently identify compound words formed by the concatenation of exactly two distinct words from a provided collection.
Coding & AlgorithmsTechnical ScreenStringsHash SetAlgorithms - AmazonEasySoftware EngineerFind all cells reachable by downhill flow
This question evaluates graph traversal and reachability reasoning on a 2D elevation grid, testing algorithmic problem-solving, complexity analysis, and handling of monotonic flow constraints.
Coding & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerFind concatenated words in list
This question evaluates proficiency in string manipulation, efficient lookup structures (e.g., hashing/trie) and dynamic programming or recursion for word segmentation, testing algorithmic efficiency and data-structure selection within the Coding & Algorithms domain.
Coding & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerFind first unique character
Find first unique character 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 & AlgorithmsTechnical Screen - AmazonMediumSoftware EngineerFind max equal-frequency block count for each prefix
This problem tests your ability to efficiently manage character frequency tracking while processing string prefixes, using hash maps or frequency arrays to validate partitioning conditions.
Coding & AlgorithmsTechnical ScreenStringsDynamic ProgrammingHash Map - AmazonMediumSoftware EngineerFind shortest subarray to restore order
This question evaluates array manipulation and algorithmic problem-solving skills, focusing on understanding how local subarray sorting affects global order, edge-case reasoning (already-sorted arrays, duplicates, strictly decreasing sequences), and complexity analysis within the Coding & Algorithms domain.
Coding & AlgorithmsTechnical Screen - AmazonMediumApplied ScientistFind shortest transformation steps in a word graph
This question evaluates a candidate's ability to model string transformations as a graph, apply graph traversal and shortest-path reasoning, and manage efficient string-based search and data-structure choices within the Coding & Algorithms domain.
Coding & AlgorithmsTechnical Screen - AmazonEasySoftware EngineerFind the Earliest Pair with a Target Sum
Tests array traversal and hash table lookups to find a two-sum pair that minimizes the second index, running in linear time and space.
Coding & AlgorithmsTechnical Screenarrayhash-tabletwo-sum - AmazonMediumSoftware EngineerFind the K-th Smallest Value in Two Sorted Arrays
Given two nondecreasing integer arrays and a one-based integer k, return the k-th smallest value in their combined multiset. Work through the function contract, boundary cases, correctness argument, and time and space complexity expected in a production-quality solution.
Coding & AlgorithmsTechnical Screen