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 391–420 of 3276 results
- AnthropicHardSoftware EngineerSimulate Threshold Infection Efficiently
Simulate a synchronous threshold-based infection process on a grid using an incremental multi-source BFS to achieve optimal linear time complexity.
Coding & AlgorithmsOnsiteBFSGraphMatrix - AnthropicMediumSoftware EngineerSimulate stack traces from logs
This question evaluates stack-based simulation for computing exclusive execution time in nested function call logs and stream-processing concepts for handling equal timestamps, slight reordering, and detection of N consecutive categorical events.
Coding & AlgorithmsOnsite - AnthropicMediumSoftware EngineerSolve programming task with follow-ups
This question evaluates algorithmic problem-solving skills, including core algorithm implementation, handling a consecutive-N-element constraint, and designing an optimization that leverages suffix-related information.
Coding & AlgorithmsTechnical Screen - AnthropicMediumSoftware EngineerTime-Based Key-Value Store
Design a versioned key-value store that supports storing values at specific timestamps and retrieving the most recent value at or before a given timestamp.
Coding & AlgorithmsOnsitebinary-searchhash-tabledesign - AnthropicMediumSoftware EngineerWord Search in a Letter Grid
This problem tests the ability to implement a backtracking search on a 2D grid, optimized with a Trie data structure to efficiently search for multiple strings simultaneously.
Coding & AlgorithmsOnsiteTrieBacktrackingDFS - AntraMediumSoftware EngineerCharacter Frequency Count in a String
This problem tests your ability to manipulate strings and utilize hash maps to count character frequencies while maintaining the original order of character appearance.
Coding & AlgorithmsTechnical ScreenStringsHash MapAlgorithms - AntraMediumSoftware EngineerLongest Substring Without Repeating Characters
This problem tests your ability to implement an efficient sliding window technique using a hash map to track character indices and maintain a valid substring constraint.
Coding & AlgorithmsTechnical ScreenSliding WindowHash MapString - AppleMediumSoftware EngineerCapture Enclosed O Regions in an X/O Grid Using Union-Find Instead of Flood Fill
Given a grid of X and O cells, capture every region of edge-connected O cells that does not touch the border by turning it into X, using a disjoint-set (union-find) structure instead of flood fill. Tests union-find implementation, mapping grid cells to set indices and correct border handling.
Coding & AlgorithmsTechnical Screen - AppleHardSoftware EngineerCompute conflicts and minimum meeting rooms
This question evaluates the ability to reason about interval overlaps and resource allocation, testing algorithmic thinking and efficient handling of time-interval data in scheduling contexts and belongs to the Coding & Algorithms domain.
Coding & AlgorithmsTechnical Screen - AppleMediumSoftware EngineerCompute island size in grid
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 island size in grid states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsTechnical Screen - AppleMediumSoftware EngineerCompute minimum required meeting rooms
This question evaluates understanding of interval scheduling and resource-allocation concepts, proficiency with data structures for detecting temporal overlaps (heap and sweep-line paradigms), and the ability to analyze time and space complexity while handling edge cases.
Coding & AlgorithmsTechnical Screen - AppleHardData ScientistCompute optimal matrix-chain multiplication order
This question evaluates dynamic programming, algorithmic analysis, and sensitivity reasoning for matrix-chain multiplication, and it belongs to the Coding & Algorithms domain; it is commonly asked because it tests understanding of optimal substructure, trade-offs in parenthesization, and correctness versus greedy heuristics.
Coding & AlgorithmsOnsite - AppleMediumSoftware EngineerCompute top three scores per student
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 top three scores per student states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsTechnical Screen - AppleMediumSoftware EngineerConvert a Roman Numeral to an Integer
This problem tests your ability to parse string-based symbols while applying conditional arithmetic logic to handle additive and subtractive Roman numeral rules.
Coding & AlgorithmsOnsiteStringsHash MapMath - AppleMediumSoftware EngineerCopy a Linked List with Random Pointers
This problem tests your ability to manipulate linked structures and manage pointer state without using extra hash maps for space optimization.
Coding & AlgorithmsOnsiteLinked ListPointer ManipulationAlgorithms - AppleMediumSoftware EngineerCount Islands in a Binary Grid
This problem tests your ability to perform graph traversal on a 2D grid while adhering to strict memory constraints and preserving the integrity of the original data structure.
Coding & AlgorithmsTechnical ScreenGraphsBFSIterative Traversal - AppleHardSoftware EngineerCount subarrays with sum equals k
This problem tests your ability to optimize subarray sum calculations using prefix sums and hash maps to achieve linear time complexity.
Coding & AlgorithmsTechnical ScreenArraysHash MapPrefix Sum - AppleMediumSoftware EngineerCount the Nodes in a Chain Reachable Only Through Left and Right Links
Starting from one node of a chain in which every node links only to its left and right neighbors, count the nodes in the whole chain. It tests traversal in both directions from an arbitrary node, handling of chain ends and single-node chains, and the design of your own test cases.
Coding & AlgorithmsTechnical Screen - AppleMediumMachine Learning EngineerDebug a PyTorch U-Net shape mismatch
This question tests your ability to calculate the output dimensions of convolutional layers in a U-Net architecture and resolve shape mismatches caused by cropping or padding requirements during feature map concatenation.
Coding & AlgorithmsTechnical ScreenPyTorchComputer VisionU-Net - AppleMediumSoftware EngineerDecode a Run-Length Encoded String Where a Missing Count Means One
Implement a decoder for run-length encoded strings in which each lowercase letter is followed by an optional repeat count, so that a5b3c becomes aaaaabbbc. It tests careful string parsing, multi-digit counts, letters written without a count, and writing your own test cases.
Coding & AlgorithmsTechnical Screen - AppleMediumSoftware EngineerDesign a rolling five-minute hit counter
This question evaluates understanding of data-structure selection, amortized time complexity, space-time trade-offs, sliding-window state management for expiring events, and the ability to design a concise API with unit tests.
Coding & AlgorithmsTechnical Screen - AppleMediumSoftware EngineerDesign a snapshotable key-value store
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 snapshotable key-value store states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsTechnical Screen - AppleMediumSoftware EngineerDesign card deck with shuffle and order
This question evaluates understanding of data modeling and API design for a deck abstraction, algorithmic handling of randomization and sorting, and the ability to analyze time and space complexity.
Coding & AlgorithmsOnsite - AppleMediumSoftware EngineerDetermine Whether an Undirected Graph Is Two-Colorable
Determine whether an undirected graph with disconnected components, potential self-loops, and parallel edges can be colored using two colors such that no two adjacent vertices share the same color.
Coding & AlgorithmsTechnical Screengraphbfsdfs - AppleHardData EngineerEncode and Rebuild a Binary Tree
This question evaluates skills in data structure serialization and deserialization, binary tree representation, and algorithmic design for deterministic data formats.
Coding & AlgorithmsTechnical Screen - AppleMediumSoftware EngineerFind All Tree Nodes at Distance K
This problem tests tree traversal, graph representation (converting a tree to an undirected graph), and breadth-first search (BFS) to find nodes at a specific distance.
Coding & AlgorithmsOnsiteTreesGraphsBFS - AppleEasySoftware EngineerFind Common Prefix Across Strings
This question tests the ability to manipulate strings and iterate through arrays to find the longest common prefix among a list of words, emphasizing efficiency and edge-case handling.
Coding & AlgorithmsTechnical ScreenStringsArraysAlgorithms - AppleMediumData ScientistFind Maximum Sum of Contiguous Subarray Length k
This question evaluates skill in array manipulation and computing aggregate metrics over fixed-length intervals, along with understanding of algorithmic complexity and trade-offs between runtime and memory.
Coding & AlgorithmsTechnical Screen - AppleMediumMachine Learning EngineerFind Minimum Processing Rate
This problem tests your ability to use binary search on a search space to find an optimal minimum processing rate that satisfies a global deadline constraint.
Coding & AlgorithmsTechnical ScreenBinary SearchGreedyOptimization - AppleMediumData ScientistFind Smallest Missing Positive Integer in O(n) Time
This question evaluates a candidate's skill in array algorithms and in-place algorithm design, emphasizing understanding of time and space complexity and handling edge cases when identifying the smallest missing positive integer.
Coding & AlgorithmsOnsite