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 1321–1350 of 1706 results
- SnapchatHardMachine Learning EngineerImplement 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 EngineerImplement 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 EngineerRemove 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 - SnapchatMediumSoftware EngineerSolve 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 - SnapchatMediumSoftware EngineerSolve 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 EngineerAnswer 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 EngineerAssign 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 EngineerBuild 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 - SnowflakeMediumSoftware EngineerCheck Whether a Proposed Course Order Respects Every Prerequisite
Given courses, prerequisite pairs and a proposed order, decide whether the order lists every course exactly once and places each course after all of its prerequisites. It tests position indexing, permutation checks and careful handling of missing or repeated courses.
Coding & AlgorithmsTechnical Screen - SnowflakeHardSoftware EngineerCheck if each recipe is a contiguous subsequence
This problem tests your ability to efficiently determine if one sequence exists as a contiguous segment within another using pattern matching techniques.
Coding & AlgorithmsTechnical ScreenArraysKMP AlgorithmPattern Matching - SnowflakeMediumSoftware EngineerCollect a Binary Tree's Outer Boundary Values Anticlockwise
Given a binary tree stored as child-index arrays, return its boundary values anticlockwise: the root, the left boundary, the leaves from left to right and the right boundary from bottom to top, whose total is the boundary sum. It tests precise traversal rules and edge cases.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerCompute Effective Letter Permissions in a DAG
Compute the effective lowercase letter permissions for every node in a directed acyclic graph (DAG), where granted permissions propagate transitively to all descendants while explicit denials apply only locally.
Coding & AlgorithmsTechnical ScreenDAGtopological-sortbit-manipulation - SnowflakeMediumSoftware EngineerCompute Progressive Income Tax in Cents from Bracket Limits
Given progressive tax brackets as upper limits with percentage rates and an income in whole dollars, return the total tax owed in cents. It tests careful handling of bracket boundaries, partly filled brackets and exact integer arithmetic instead of floating point.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerCompute height after deletions; enumerate valid delete sets
This question evaluates competence in binary tree manipulation and combinatorial search, covering promotion-based node deletion, height computation across forest components after root deletion, enumeration of deletion sets with deduplication, pruning strategies, and time/space complexity analysis.
Coding & AlgorithmsTechnical Screen - SnowflakeHardSoftware EngineerCompute height of tree with deleted nodes; minimize deletions
This question evaluates understanding of tree data structures, connectivity after node deletions, and optimization for minimizing additional removals, and is categorized under Coding & Algorithms. It is commonly asked to assess reasoning about tree pruning and height computation under constraints, testing both conceptual understanding of tree properties and practical algorithmic implementation.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerCompute task order with prerequisites
This question evaluates proficiency in graph algorithms—particularly topological ordering and cycle detection—along with the use of efficient data structures for representing dependencies and analyzing time and space complexity.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerCompute total time to finish all courses
This problem tests your ability to model task dependencies using a directed graph and calculate the earliest completion time for all tasks, effectively identifying the critical path in a project schedule.
Coding & AlgorithmsTechnical ScreenGraphTopological SortDynamic Programming - SnowflakeMediumSoftware EngineerDecide Whether Repeatedly Summing Squared Digits Reaches 1
Starting from a positive integer, repeatedly replace it by the sum of the squares of its digits and decide whether the sequence reaches 1 or falls into a cycle. It tests cycle detection on an implicit sequence and reasoning about why the values stay bounded.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerDecide Whether an Undirected Graph Can Be Colored with Three Colors
Given an undirected graph with up to fifteen nodes, decide whether every node can receive one of three colors so that no edge joins two nodes of the same color. It tests backtracking search with pruning and reasoning about odd cycles and cliques.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerDeep-Copy a Linked List with Random Pointers
Implement a deep copy of a linked list where each node has both a next pointer and an arbitrary random pointer, ensuring all reachable nodes and relationships are replicated without modifying the original list.
Coding & AlgorithmsTechnical ScreenLinked ListHash TableGraph - SnowflakeMediumSoftware EngineerDelete the Fewest Tree Nodes to Meet a Height Limit
Find a minimum-cardinality set of tree-node deletions under child-promotion semantics using height-budget dynamic programming and explicit solution reconstruction.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerDesign an in-memory filesystem and circular queue
This question evaluates a candidate's skills in data-structure and algorithm design, API specification, correctness reasoning, and time/space complexity analysis within the Coding & Algorithms domain by combining an in-memory hierarchical filesystem design with a fixed-size circular queue implementation.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerDesign error detection and propagation algorithms
This question evaluates algorithm design and complexity-analysis skills across search and graph problems, specifically log search for first-error detection, reachability and failure propagation in directed service dependency graphs, and longest-path reasoning under cycle or DAG assumptions.
Coding & AlgorithmsTechnical Screen - SnowflakeHardSoftware EngineerDesign transactional in-memory key-value store
This question evaluates understanding of in-memory key–value store semantics, transactional and nested transaction behavior, and practical competencies in hash-based data structures and thread-safety for concurrent access.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerDetermine Whether an Undirected Graph Is 3-Colorable
This problem tests knowledge of graph theory, specifically constraint satisfaction, and the ability to implement a backtracking algorithm to solve NP-complete problems on small constraints.
Coding & AlgorithmsTechnical ScreenGraphBacktrackingRecursion - SnowflakeMediumSoftware EngineerEvaluate an Arithmetic Expression with Parentheses, Unary Minus and Four Operators
Evaluate an arithmetic expression string with non-negative integers, addition, subtraction, multiplication, division truncating toward zero, parentheses and a unary minus. It tests tokenizing, operator precedence, left-to-right evaluation and deeply nested parentheses without eval.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerEvaluate arithmetic expression with variables
This question evaluates implementation skills for a linear-time expression parser and evaluator, covering tokenization, variable substitution, operator precedence and associativity (including unary +/−), parentheses handling, integer arithmetic semantics (division truncation), error detection, and adherence to O(L) time and space constraints.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerFewest Buses Needed to Cover Every Scheduled Trip
Given scheduled trips with start and end times, return the fewest buses needed so that no bus runs two trips at once, where a bus may start a trip the moment its previous one ends. It tests reasoning about maximum interval overlap and boundary handling.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerFewest Node Additions and Removals to Make a Binary Tree Perfect
Given a binary tree described by left and right child arrays, return the fewest single-node additions and leaf removals that turn it into a perfect binary tree, which is 0 exactly when it is already perfect. Tests tree traversal and reasoning about tree shape, including very deep, skewed trees.
Coding & AlgorithmsTechnical Screen - SnowflakeMediumSoftware EngineerFewest Semesters to Finish All Courses Taking At Most k per Semester
Given up to fifteen courses with prerequisites and a cap of k courses per semester, return the fewest semesters needed to take every course. It tests why simple greedy choices fail and how to search the space of partial plans efficiently.
Coding & AlgorithmsTechnical Screen