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 361–390 of 1080 results

  • GleanMediumSoftware Engineer
    Rank Every Cell of a Distinct-Value Matrix Consistently Within Its Row and Column

    Replace every value in a matrix of distinct integers with the smallest rank such that larger values outrank smaller ones within each row and column. Tests processing values in sorted order, tracking per-row and per-column state, and the one-dimensional special case.

    Coding & AlgorithmsOnsite
  • GleanMediumSoftware Engineer
    Shortest Manhattan Distance Between Any X and Any Y in a String or Grid

    Find the shortest distance between any X and any Y, first in a string and then in a 2D grid using Manhattan distance, returning -1 when one letter is missing. Tests moving from a linear scan to multi-source breadth-first search and reasoning about efficiency on large grids.

    Coding & AlgorithmsOnsite
  • GleanMediumSoftware Engineer
    Simulate Modulo-Assigned Document Indexers with Wrap-Around and Rank the Busiest

    Simulate documents assigned to indexers by index modulo m, falling through to the next free indexer with wrap-around and dropping documents when all are busy, then report processed totals, the busiest indexer and the top-k share. Tests event simulation, finding the next free slot efficiently and precise tie rules.

    Coding & AlgorithmsOnsite
  • GleanMediumSoftware Engineer
    Sort in Linear Time an Array Where At Most One Element Was Moved Out of Place

    Given an array that was sorted until one element was moved to another position, return it sorted again in linear time without a full sort. Tests locating the displaced element in either direction, handling duplicates and already-sorted input, and reasoning about O(n) time with constant extra space.

    Coding & AlgorithmsOnsite
  • Goldman SachsMediumSoftware Engineer
    Collect the Most Rocks with Upward and Rightward Moves

    Tests dynamic programming on a grid to find an optimal path from the bottom-left to top-right corner using constrained directional moves.

    Coding & AlgorithmsOnsitedynamic-programminggridmatrix
  • Goldman SachsMediumSoftware Engineer
    Maximize Element Frequency with Limited Increments

    Tests sorting and sliding window techniques to maximize an element's frequency within an increment budget.

    Coding & AlgorithmsOnsitearraysliding-windowsorting
  • Goldman SachsMediumSoftware Engineer
    Rolling Ball Maze Reachability

    This problem tests your ability to model a grid-based movement simulation as a graph reachability problem, requiring efficient state traversal.

    Coding & AlgorithmsOnsiteBFSGraphsSimulation
  • Goldman SachsEasySoftware Engineer
    Search for a Target in a Matrix Sorted by Rows and Columns

    Tests the ability to search efficiently in a 2D grid sorted along both dimensions by exploiting boundary invariants to achieve an O(m + n) time complexity.

    Coding & AlgorithmsOnsitearraysmatrixbinary-search
  • GoogleMediumSoftware Engineer
    Arrange Crops into Connected Regions in Rectangular and Two-Square Gardens

    Arrange exact crop counts into connected grid regions, prove a rectangular construction, and analyze the geometry needed for a two-square garden follow-up.

    Coding & AlgorithmsOnsite
  • GoogleEasySoftware Engineer
    Assign the Minimum Fleet to Rental Reservations

    Determine the minimum fleet size and a deterministic vehicle assignment for a list of rental reservations using interval scheduling and priority queues.

    Coding & AlgorithmsOnsiteGreedyHeapIntervals
  • GoogleMediumSoftware Engineer
    Boolean Expression Tree with Leaf Flips

    This problem tests recursive tree evaluation logic and the ability to optimize updates by propagating changes only to necessary ancestors.

    Coding & AlgorithmsOnsiteTreesRecursionBoolean Logic
  • GoogleEasySoftware Engineer
    Build a next-word frequency predictor

    This problem tests your ability to process sequential text data, efficiently store word adjacency frequencies, and retrieve the most likely successor.

    Coding & AlgorithmsOnsiteHash MapData StructuresString Processing
  • GoogleEasySoftware Engineer
    Busiest Rental Car

    This problem tests your ability to manage state and apply custom sorting logic to simulate resource allocation across time intervals.

    Coding & AlgorithmsOnsiteHash MapSimulationGreedy
  • GoogleMediumSoftware Engineer
    Calculate Highway Tolls from Ordered Checkpoint Logs

    Tests tracking vehicle state across interleaved chronological event streams and computing distance-based segment tolls regardless of travel direction or checkpoint repetition.

    Coding & AlgorithmsOnsitehash-tablearrayssimulation
  • GoogleMediumSoftware Engineer
    Choose Non-Overlapping Weighted Jobs to Maximize Total Profit

    Choose a set of jobs, each with a start time, end time and profit, so that no two chosen jobs overlap and the total profit is as large as possible. It tests sorting intervals, defining an optimal-substructure recurrence, and finding the latest compatible earlier job efficiently for large inputs.

    Coding & AlgorithmsOnsite
  • GoogleMediumSoftware Engineer
    Choose One Blocker Removal for the Fastest Grid Signals

    Determine at most one obstacle to remove in a grid to minimize the maximum time for signals to reach all target cells from multiple sources.

    Coding & AlgorithmsOnsiteBFSGraphMatrix
  • GoogleMediumSoftware Engineer
    Compute a Depth-Weighted Sum of a Nested List

    Implement and compare recursive and iterative traversals to compute the depth-weighted sum of an arbitrarily nested list of integers, handling deep nesting and edge cases.

    Coding & AlgorithmsOnsitedfsbfsstack
  • GoogleMediumSoftware Engineer
    Compute shortest delivery route with dangerous stops

    This question evaluates understanding of graph traversal and shortest-path techniques under constraints, including avoidance of forbidden nodes, multi-criteria optimization (minimizing dangerous-node visits then steps), and reasoning about augmented state and visited-structure design.

    Coding & AlgorithmsOnsite
  • GoogleMediumMachine Learning Engineer
    Compute sum over consecutive-step subarrays

    This problem tests your ability to identify contiguous subarrays that follow an arithmetic progression with a common difference of 1 (consecutive steps) and calculate the sum of elements within these subarrays efficiently.

    Coding & AlgorithmsOnsiteArraysMathSliding Window
  • GoogleMediumSoftware Engineer
    Compute the Union of Two Sorted Interval Lists

    Merge two sorted lists of disjoint closed intervals into a single sorted list of disjoint intervals in linear time.

    Coding & AlgorithmsOnsiteIntervalsTwo PointersMerge Sort
  • GoogleHardFrontend Engineer
    Count Islands with Diagonal Connectivity

    Practice counting binary-grid components when diagonal neighbors connect, changing the usual four-direction island definition.

    Coding & AlgorithmsOnsite
  • GoogleEasySoftware Engineer
    Count Rectangle Coverage on a Grid

    Implement an algorithm to compute cell-by-cell coverage counts for an n x n grid given multiple inclusive rectangular regions.

    Coding & AlgorithmsOnsitematrixprefix-sumdifference-array
  • GoogleMediumSoftware Engineer
    Count Up-Right/Right/Down-Right Grid Paths Through Ordered Checkpoints

    Count the paths across an n by m grid from the bottom-left to the bottom-right cell when each move goes up-right, right or down-right, optionally passing through checkpoints in a required order, modulo a large prime. It tests column-by-column dynamic programming and reducing memory use.

    Coding & AlgorithmsOnsite
  • GoogleMediumSoftware Engineer
    Count user sessions from logs

    This question evaluates a candidate's ability to parse and process large-scale event logs, perform sessionization based on time gaps, handle out-of-order records and memory constraints, and reason about time and space complexity and optimization strategies in the Coding & Algorithms domain.

    Coding & AlgorithmsOnsite
  • GoogleMediumSoftware Engineer
    Decompress encoded string with nested repeats

    This question tests the ability to handle nested structures using recursion or a stack-based approach to expand string patterns based on repetition factors.

    Coding & AlgorithmsOnsiteStackRecursionString Manipulation
  • GoogleMediumSoftware Engineer
    Dependency-Safe Deletion Order

    Tests directed graph modeling, cycle detection, and Kahn's algorithm using a min-heap to produce a lexicographically smallest topological sort.

    Coding & AlgorithmsOnsiteTopological SortHeapGraph
  • GoogleEasySoftware Engineer
    Design compressed vector and compute dot product

    This problem tests your ability to design a memory-efficient data structure for sparse or repetitive vector data and implement an arithmetic operation without fully decompressing the representation.

    Coding & AlgorithmsOnsiteArraysTwo PointersData Structures
  • GoogleMediumSoftware Engineer
    Design structure for insert and k-th largest

    This problem tests your ability to design a dynamic data structure that maintains elements while efficiently querying the k-th largest value, necessitating a balance between insertion speed and retrieval performance.

    Coding & AlgorithmsOnsiteData StructuresHeapBinary Search Tree
  • GoogleMediumSoftware Engineer
    Determine All Players with Fixed Rankings

    Determine which players in a competition have a uniquely determined ranking given a set of pairwise match outcomes.

    Coding & AlgorithmsOnsitegraphbfsdfs
  • GoogleMediumSoftware Engineer
    Determine Whether a Word Exists in a Graph

    This problem tests the ability to implement a depth-first search (DFS) with backtracking to find a specific sequence within a grid, while managing state to avoid reusing the same path.

    Coding & AlgorithmsOnsiteDFSBacktrackingGraphs