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 781–810 of 1080 results

  • OtherMediumData Scientist
    Write mini-batch gradient descent

    This question evaluates understanding and implementation of optimization algorithms for machine learning, specifically mini-batch gradient descent, and measures competency in numerical optimization, algorithmic implementation, and training dynamics within the Coding & Algorithms domain for Data Scientist roles.

    Coding & AlgorithmsOnsite
  • Otter.AiMediumSoftware Engineer
    Fewest Adjacent-GCD Operations to Turn Every Array Element into 1

    Given an array of positive integers, find the fewest operations that make every element 1, where each operation replaces one of two neighboring values with their greatest common divisor, or return -1 if it cannot be done. Tests GCD properties, lower-bound reasoning and careful case analysis on small arrays.

    Coding & AlgorithmsOnsite
  • PalantirEasySoftware Engineer
    Find Shortest Paths in Road Network

    This question evaluates understanding of graph data structures and shortest-path concepts, including correct modeling of undirected edges, unweighted versus weighted pathfinding, and algorithmic time and space complexity.

    Coding & AlgorithmsOnsite
  • Palo Alto NetworksMediumSoftware Engineer
    Find Maximum Rectangle in Bar Chart

    This question evaluates algorithmic problem-solving and data structure proficiency in computing the maximum rectangular area within a histogram-like array, focusing on contiguous segment analysis and range-based aggregation.

    Coding & AlgorithmsOnsite
  • Palo Alto NetworksMediumSoftware Engineer
    Find normalized list difference efficiently

    This question evaluates competency in computing normalized list differences, including string normalization, collection comparison, duplicate handling, and time and space complexity reasoning.

    Coding & AlgorithmsOnsite
  • Palo Alto NetworksMediumSoftware Engineer
    Mirror a binary tree and analyze complexity

    This question evaluates understanding of binary tree manipulation and traversal methods, emphasizing recursion and iterative approaches as well as the ability to reason about time and space complexity.

    Coding & AlgorithmsOnsite
  • PayPalMediumData Scientist
    Count Word Frequency and Print Top Three Words

    This question evaluates proficiency in basic Python programming, string/text processing, frequency counting and sorting algorithms, reflecting core competencies for data manipulation tasks.

    Coding & AlgorithmsOnsite
  • PayPalMediumMachine Learning Engineer
    Maximize ones with limited flips

    This question evaluates proficiency with array algorithms, particularly sliding-window and two-pointer reasoning, complexity analysis, and the ability to adapt solutions for streaming data.

    Coding & AlgorithmsOnsite
  • PayPalMediumSoftware Engineer
    Minimize a String Using Allowed Swaps

    This question evaluates understanding of graph connectivity and constrained string reordering, along with proficiency in applying efficient data structures and algorithms for handling large inputs.

    Coding & AlgorithmsOnsite
  • PayPalMediumMachine Learning Engineer
    Search a word in a grid

    This question evaluates proficiency in grid traversal and stateful search techniques such as depth-first search and backtracking, including visited-state management and pruning strategies within the Coding & Algorithms domain.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Calculate 95% Bootstrap Confidence Interval for Order Values

    This question evaluates a data scientist's competence in statistical inference using bootstrap resampling, proficiency with numerical computing for large sample operations, and attention to performance optimization.

    Coding & AlgorithmsOnsite
  • PinterestMediumSoftware Engineer
    Compute reachable cells for a cleaning robot

    This problem tests graph traversal techniques (BFS/DFS) on a 2D grid, focusing on efficient coordinate management and state representation when navigating obstacles.

    Coding & AlgorithmsOnsiteBFSGraph Traversal2D Grid
  • PinterestHardSoftware Engineer
    Count Distinct Active Pins per Time Segment from Overlapping Interaction Logs

    Process overlapping pin interaction logs to calculate the number of distinct active pins over continuous time segments. Tests interval merging, line sweep techniques, and boundary handling.

    Coding & AlgorithmsOnsitesweep-lineintervalssorting
  • PinterestMediumSoftware Engineer
    Cross-reference logs to flag spam numbers

    This question evaluates proficiency with data structures (such as hash maps), parsing and deduplication, frequency counting, input validation, and analysis of time and space complexity.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Decode and Explain Ambiguity in Compression Strings

    This question evaluates parsing of compact count-value encodings, reasoning about ambiguous encodings, and combinatorial enumeration of all valid decodings.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Design Algorithm to Minimize Payments in Expense-Sharing App

    This question evaluates algorithm design and optimization skills, focusing on modeling multi-party transactions and minimizing the number of settlement operations.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Design Data Structure for Sparse Matrices Operations

    This question evaluates a candidate's ability to design efficient data structures and implement algorithms for sparse matrix storage and operations, emphasizing space-efficient representations, matrix arithmetic, and computational complexity reasoning.

    Coding & AlgorithmsOnsite
  • PinterestMediumSoftware Engineer
    Design adjustable ID allocator

    A Pinterest software-engineer onsite coding problem: design an adjustable ID allocator over a fixed [0, 999] ID space with named, contiguous, non-overlapping bucket ranges. It covers initial allocation (packing from desired sizes and validating/normalizing proposed ranges), a resize operation that grows or shrinks a bucket by consuming adjacent free space and then minimally shifting or borrowing from neighbors under a deterministic policy, plus complexity analysis, boundary-case testing, and concurrency handling.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Determine Pin Connections Through Common Boards

    This question evaluates graph modeling and connectivity concepts, including representing boards and pins as relationships and reasoning about reachability and minimal connection paths.

    Coding & AlgorithmsOnsite
  • PinterestMediumSoftware Engineer
    Fewest Buses to Ride Between Two Stops on Looping Bus Lines

    A coding problem about bus lines that loop through fixed lists of stops: find the fewest buses a rider must board to travel from a source stop to a target stop, or report that the target cannot be reached. It tests modeling transfers between lines as a graph and keeping the search efficient when many lines share stops.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Find available reservation time slots

    This question evaluates a candidate's ability to reason about time-interval data and temporal normalization, testing competencies in interval manipulation, conflict detection, and algorithmic problem-solving for scheduling contexts.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Find list pair with maximum overlap

    This question evaluates proficiency with set operations and similarity metrics (Jaccard), scalable algorithm design and complexity analysis for large datasets, and the ability to handle streaming updates and deterministic tie-breaking.

    Coding & AlgorithmsOnsite
  • PinterestMediumSoftware Engineer
    Find the Minimum Number of Coins for an Amount

    Tests dynamic programming and breadth-first search techniques to find the minimum number of coin denominations required to reach a target value, including edge cases like zero and unreachable sums.

    Coding & AlgorithmsOnsitedynamic-programmingbfsarrays
  • PinterestMediumMachine Learning Engineer
    First Word Matching Each Prefix Query

    This problem tests your ability to efficiently query a list of strings to find the first occurrence that matches a given prefix, focusing on optimal space-time tradeoffs using tree-based or map-based indexing.

    Coding & AlgorithmsOnsiteTrieHash MapString Processing
  • PinterestMediumMachine Learning Engineer
    Hierarchical Access Control for an Advertising Platform

    This problem tests graph traversal algorithms and efficient membership checking within a directed acyclic graph (DAG) representing hierarchical organizational permissions.

    Coding & AlgorithmsOnsiteGraphsDAGBFS/DFS
  • PinterestMediumData Scientist
    How to Design a Proportional Randomized Sampler?

    This question evaluates proficiency in randomized algorithms and probabilistic sampling, with emphasis on numerical precision, large-weight handling, and memory-versus-accuracy trade-offs. Commonly asked in Coding & Algorithms interviews for data-science roles, it assesses practical application ability grounded in conceptual understanding of numerical stability and relevant data-structure choices.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Implement Data Structure for Top-K Elements in Streams

    This question evaluates competency in streaming algorithms, dynamic data structures for maintaining top-K elements in real time, and scalability considerations for handling large or distributed input streams.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Implement Function to Return First n Prime Numbers

    This question evaluates algorithmic problem-solving and basic number-theory competency by requiring generation of prime numbers with attention to correctness and performance characteristics.

    Coding & AlgorithmsOnsite
  • PinterestMediumData Scientist
    Implement LRUCache with O(1) Operations and Thread Safety

    This question evaluates a candidate's ability to implement a constant-time LRU cache and reason about thread-safety and concurrent access, testing data structure design and concurrency competencies in the Coding & Algorithms domain.

    Coding & AlgorithmsOnsite
  • PinterestMediumSoftware Engineer
    Implement sparse matrix storage, addition, and multiplication

    This problem tests your ability to design a memory-efficient representation for sparse matrices and implement arithmetic operations while leveraging the sparsity of the data.

    Coding & AlgorithmsOnsiteArraysHash MapsLinear Algebra