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 121–150 of 1080 results
- AnthropicMediumSoftware EngineerImplement a Least-Recently-Used Cache
This question evaluates a candidate's ability to design and implement an efficient in-memory cache with eviction behavior, testing understanding of data structure selection, state management, and time/space complexity under capacity constraints.
Coding & AlgorithmsOnsite - AnthropicHardSoftware EngineerImplement a Longest-Match Tokenizer
Design and implement a greedy longest-match text tokenizer that validates vocabulary, supports configurable unknown-token coalescing, and emits token IDs alongside their exact substring matches.
Coding & AlgorithmsOnsitetriestringnlp - AnthropicHardSoftware EngineerImplement a hierarchical file store
This problem tests your ability to design a hierarchical file system data structure and implement operations for directory traversal, file manipulation, and path normalization.
Coding & AlgorithmsOnsiteTreeTrieData Structures - AnthropicMediumMachine Learning EngineerImplement a web crawler using a provided API
This problem tests your ability to design a multi-threaded web crawler that efficiently traverses a site while respecting domain constraints and avoiding redundant work.
Coding & AlgorithmsOnsiteConcurrencyGraph TraversalBFS - AnthropicMediumMachine Learning EngineerImplement an extensible prefix tree
This question evaluates the ability to design and implement an extensible prefix tree (trie), covering competencies in Unicode-aware string handling, memory and time optimization, concurrency or thread-safety considerations, and support for operations like insert, search, startsWith, countPrefix and erase.
Coding & AlgorithmsOnsite - AnthropicMediumSoftware EngineerImplement crawler, dedup, and persistent LRU
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 crawler, dedup, and persistent LRU states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsOnsite - AnthropicMediumSoftware EngineerImplement file deduplication at scale
Implement streaming file deduplication that filters by size, fingerprint and hash, then compares bytes to rule out hash collisions. It covers large-file chunking, batched disk I/O, parallelizing across cores or machines, a dry-run report, and hard links that never cross devices. Follow-ups turn it into a command-line tool that handles symbolic links, unreadable files, error cases, and options to move or delete duplicates.
Coding & AlgorithmsOnsite - AnthropicHardSoftware EngineerImplement staircase printing and distributed mode/median
This set of problems evaluates implementation correctness and attention to formatting for a staircase-printing routine alongside distributed-algorithms reasoning for computing a global mode/median, testing algorithmic thinking, I/O handling, synchronization, and communication-cost trade-offs in the Coding & Algorithms domain.
Coding & AlgorithmsOnsite - AnthropicMediumSoftware EngineerImplement thread-safe blocking queue
This question evaluates competency in concurrent programming, synchronization primitives, and implementation of thread-safe bounded blocking queues within the Coding & Algorithms domain.
Coding & AlgorithmsOnsite - AnthropicMediumSoftware EngineerIn-Memory Key-Value Database with Nested Transactions
Design an in-memory key-value store supporting nested transactions with begin, commit, rollback, get, set, and delete operations.
Coding & AlgorithmsOnsiteData StructuresStackDesign - AnthropicMediumSoftware EngineerLRU Cache
This question tests the ability to combine a hash map and a doubly linked list to implement an LRU cache with O(1) performance for both get and put operations.
Coding & AlgorithmsOnsiteHash MapDoubly Linked ListDesign - AnthropicMediumSoftware EngineerPath Resolution with Symbolic Links
Implement a filesystem path resolution function that normalizes paths containing '.', '..', and symbolic links while detecting cycles.
Coding & AlgorithmsOnsitestring parsingstacksimulation - AnthropicMediumSoftware EngineerSame-Domain Web Crawl (BFS)
Implement a breadth-first search crawler that traverses pages starting from a seed URL, filtering for pages sharing the same domain and properly deduplicating visited URLs.
Coding & AlgorithmsOnsitebfsgraphstring-parsing - 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 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 - 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 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 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 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 - 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 - AppleMediumSoftware EngineerFind the K Closest Pairs in a Sorted Array
Implement an algorithm to find the k pairs of elements with the smallest absolute difference in a strictly increasing sorted array.
Coding & AlgorithmsOnsiteHeapTwo PointersSorted Array - AppleMediumMachine Learning EngineerImplement Kubernetes Service Dependency Queries
This question evaluates proficiency with data structures and algorithms for service inventory operations, including deterministic filtering, attribute matching, graph traversal for transitive dependency resolution, and status propagation across service graphs.
Coding & AlgorithmsOnsite - AppleMediumSoftware EngineerImplement a FIFO Queue Using Two Stacks
This problem tests the ability to adapt data structure behaviors by implementing a First-In-First-Out (FIFO) queue using only Last-In-First-Out (LIFO) stacks.
Coding & AlgorithmsOnsiteData StructuresStacksQueues - AppleMediumMachine Learning EngineerImplement permutations and image retrieval
This question evaluates algorithmic implementation and computational thinking across combinatorics, image processing, and vector similarity—specifically testing permutation generation, 2D convolution with explicit boundary handling, and nearest-neighbor retrieval for image embeddings.
Coding & AlgorithmsOnsite - AppleMediumSoftware EngineerImplement rotation, LRU cache, streaming median, cycle detection
This question evaluates understanding of array/matrix manipulation, cache and data structure design, streaming algorithms for median maintenance, and graph theory for cycle detection, with emphasis on algorithmic complexity analysis and handling of edge cases.
Coding & AlgorithmsOnsite - AppleMediumSoftware EngineerRefactor rock–paper–scissors for config and ties
This question evaluates a candidate's proficiency in object-oriented design, configuration injection, extensibility, state tracking (including ties), and testability when refactoring a Rock–Paper–Scissors tournament to support configurable rounds.
Coding & AlgorithmsOnsite - AppleMediumData ScientistRemove shortest subarray to sort array
This question evaluates proficiency in array algorithms, algorithmic efficiency (linear time and constant-space reasoning), and handling edge cases related to non-decreasing order, within the Coding & Algorithms domain.
Coding & AlgorithmsOnsite