Katkat

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 2611–2640 of 3276 results

  • SnapchatMediumMachine Learning Engineer
    Evaluate an Integer Arithmetic Expression String With Operator Precedence

    A coding problem to evaluate a string expression of non-negative integers with addition, subtraction, multiplication and integer division, respecting operator precedence and left-to-right order, with no parentheses and no eval. It tests parsing, precedence handling and truncating integer division.

    Coding & AlgorithmsTechnical Screen
  • SnapchatMediumMachine Learning Engineer
    Find K Nearest Points

    This question tests the ability to efficiently find the k-closest points to an origin in a 2D plane, focusing on heap-based or selection-based data structures.

    Coding & AlgorithmsOnsiteHeapGeometryQuickSelect
  • SnapchatMediumSoftware Engineer
    Find Maximum Island Perimeter

    This problem tests grid traversal techniques (DFS/BFS) and the ability to calculate boundary contributions within a connected component in a 2D matrix.

    Coding & AlgorithmsTechnical ScreenDFSBFSGrid
  • SnapchatMediumMachine Learning Engineer
    Find Shortest Clear Grid Path

    Solve the shortest clear path in an n by n binary grid using BFS in 8 directions. Covers blocked endpoints, visited marking, path length, correctness, complexity, and weighted-move follow-ups.

    Coding & AlgorithmsOnsite
  • SnapchatMediumMachine Learning Engineer
    Find all quadruplets summing to target

    This problem tests your ability to optimize nested loops using a two-pointer approach to achieve a time complexity better than brute force when searching for subsets of a fixed size that sum to a target value.

    Coding & AlgorithmsOnsiteArraysTwo PointersSorting
  • SnapchatMediumSoftware Engineer
    Find index of first unique character

    Find index of 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
  • SnapchatMediumSoftware Engineer
    Find max node-value range across components

    This problem tests your ability to traverse an undirected graph to identify connected components and perform aggregations over the nodes within each component.

    Coding & AlgorithmsTechnical ScreenGraphDFSBFS
  • SnapchatHardMachine Learning Engineer
    Find the Smallest Range Covering K Sorted Lists

    Tests multi-pointer tracking and priority queue fundamentals to find the narrowest bounding interval containing at least one element from each of k sorted lists.

    Coding & AlgorithmsTechnical ScreenHeapSliding WindowGreedy
  • SnapchatMediumSoftware Engineer
    Find top co-purchased products

    This question evaluates algorithmic problem-solving and data engineering skills, focusing on computing and ranking co-occurrence frequencies, choosing efficient data structures for pairwise counts, and contrasting offline batch implementation with streaming updates.

    Coding & AlgorithmsOnsite
  • SnapchatMediumSoftware Engineer
    Handle cards, islands, Trie, median

    These problems evaluate proficiency in core data structures and algorithmic problem-solving, covering grouping/counting techniques, grid-based island detection, trie (prefix tree) design, and streaming median computation within the domain of data structures and algorithms.

    Coding & AlgorithmsTechnical Screen
  • SnapchatHardSoftware Engineer
    Implement LRU cache and prime products array

    This question evaluates proficiency in implementing efficient mutable data structures and in enumerating combinatorial results, specifically testing understanding of LRU cache eviction behavior and generation of all non-empty subset products from a set of primes.

    Coding & AlgorithmsOnsite
  • SnapchatHardSoftware Engineer
    Implement a Leaky Bucket Limiter

    This problem tests your ability to implement a thread-safe rate limiter using the Leaky Bucket algorithm, requiring careful management of timestamps and shared state.

    Coding & AlgorithmsOnsiteConcurrencyRate-LimitingAlgorithms
  • SnapchatMediumSoftware Engineer
    Implement a Timestamped Counter

    This problem tests your ability to design a data structure that handles time-series data and performs efficient range-based queries using binary search.

    Coding & AlgorithmsTechnical ScreenBinary SearchData StructuresTime Series
  • SnapchatMediumSoftware Engineer
    Implement a custom list with iterator and map

    This problem tests your understanding of linked list internals, the Iterator design pattern, and the application of higher-order functions in a custom data structure.

    Coding & AlgorithmsTechnical ScreenLinked ListsDesign PatternsIterator
  • SnapchatHardSoftware Engineer
    Implement a size-bounded LRU cache

    This problem tests your ability to extend the standard LRU cache pattern to support items with heterogeneous 'weights', requiring a data structure that maintains access order while managing a cumulative capacity constraint.

    Coding & AlgorithmsOnsiteLRUHash MapDoubly Linked List
  • SnapchatMediumSoftware Engineer
    Implement binary search for boundary index

    This question evaluates a candidate's ability to implement binary search for boundary indices, including correct handling of duplicates, providing iterative and recursive variants, and reasoning about time and space complexity.

    Coding & AlgorithmsOnsite
  • SnapchatHardMachine Learning Engineer
    Implement calculator and graph connectivity

    This question evaluates proficiency in parsing and arithmetic expression evaluation (including operator precedence and nested parentheses) alongside implementation of disjoint-set (Union-Find) data structures for computing graph connected components.

    Coding & AlgorithmsTechnical Screen
  • SnapchatMediumSoftware Engineer
    Implement sin(x) with precision constraints

    This question evaluates understanding of numerical methods, floating-point arithmetic, and algorithmic implementation in the Coding & Algorithms domain by requiring an approximation of the sine function under explicit error bounds.

    Coding & AlgorithmsTechnical Screen
  • SnapchatMediumSoftware Engineer
    Maximize correct guesses in a hat line puzzle

    This problem tests your ability to devise a deterministic strategy for a group of people to maximize correct guesses about their own attributes based on observed information from others.

    Coding & AlgorithmsOnsiteLogicParityGreedy Strategy
  • SnapchatMediumSoftware Engineer
    Radar Overlaps and Undetected Crossing of a Rectangular Room

    Two-part geometry coding problem about circular radars placed inside a rectangular room. For each radar, list every other radar whose coverage overlaps it, then decide whether a point object can travel from the left wall to the right wall without entering any radar's coverage.

    Coding & AlgorithmsOnsite
  • SnapchatMediumSoftware Engineer
    Remove the Maximum Number of Connected Stones

    Determine the maximum number of stones that can be removed from a 2D grid where a stone may only be removed if another stone shares its row or column. This tests graph modeling, connected components, and Union-Find or BFS/DFS traversals.

    Coding & AlgorithmsTechnical ScreenGraphUnion-FindDFS
  • SnapchatHardMachine Learning Engineer
    Render an Organization Chart and Find Skip-Level Pairs

    Build and render an organization tree with ordered indentation, infer its root, and return exactly two-level manager-descendant pairs.

    Coding & AlgorithmsOnsite
  • SnapchatMediumSoftware Engineer
    Solve Open the Lock BFS

    This question evaluates the ability to model the lock as a state-space and apply graph traversal and shortest-path techniques (breadth-first search) to determine minimal move sequences under constraints.

    Coding & AlgorithmsTechnical Screen
  • SnapchatHardSoftware Engineer
    Solve Three Algorithmic Tasks

    This set of three problems evaluates competencies in algorithm design and data structures, specifically efficient range counting on timestamped events, constrained selection/matching from double-sided cards, and merging multiple sorted lists.

    Coding & AlgorithmsOnsite
  • SnapchatMediumSoftware Engineer
    Solve Three Coding Problems

    This problem tests your ability to efficiently manage dynamic, sliding-window data streams and geometric grid traversal using graph search techniques.

    Coding & AlgorithmsOnsiteHeapsSliding WindowBFS
  • SnapchatMediumSoftware Engineer
    Solve a two-jug measuring problem

    This question evaluates algorithm design, state-space modeling, graph-search techniques (BFS/DFS) and number-theoretic reasoning (gcd), along with handling edge cases and analyzing time and space complexity in the Coding & Algorithms domain.

    Coding & AlgorithmsTechnical Screen
  • SnowflakeMediumSoftware Engineer
    Answer Repeated Lookup Queries Efficiently

    This problem tests binary search proficiency and the ability to optimize performance for repetitive computational tasks using memoization.

    Coding & AlgorithmsTechnical ScreenBinary SearchCachingEfficiency
  • SnowflakeMediumSoftware Engineer
    Assign Each Person the Nearest Cake in a One-Dimensional Row

    Given a one-dimensional row marking empty spots, people and cakes, return for each person the index of the nearest cake, breaking ties toward the smaller index. It tests linear scanning techniques for nearest-neighbor queries on a line and careful handling of ties and boundaries.

    Coding & AlgorithmsTechnical Screen
  • SnowflakeMediumSoftware Engineer
    Build a Top-Down Reporting Forest from Employee-Manager Pairs

    Given employee-to-manager pairs of integer IDs, build the top-down reporting forest with every top-level manager as a root, and return it as a preorder listing of IDs and depths. Tests finding the roots, building child lists, deterministic sibling ordering, and handling long reporting chains.

    Coding & AlgorithmsOnsite
  • SnowflakeMediumSoftware Engineer
    Build a Tree Whose Nodes Hold the Original Tree's Subtree Sums

    Given a rooted tree as a parent array with a value on every node, return a same-shaped tree whose nodes hold the sum of each original subtree. It tests aggregating children before parents without hitting recursion limits, and leaving the original tree unchanged.

    Coding & AlgorithmsTechnical Screen