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 1531–1560 of 3276 results

  • LinkedInMediumSoftware Engineer
    Implement Fast Power with Negative Exponents

    This problem tests your ability to implement the exponentiation by squaring algorithm while correctly handling edge cases like negative exponents and integer overflow.

    Coding & AlgorithmsOnsiteAlgorithmsMathBit Manipulation
  • LinkedInMediumMachine Learning Engineer
    Implement K-Means and Explain Convergence

    This problem tests the implementation of the K-means clustering algorithm from scratch, requiring an understanding of the iterative refinement process, distance metrics, and the underlying mathematical objective.

    Coding & AlgorithmsTechnical ScreenClusteringUnsupervised LearningAlgorithms
  • LinkedInMediumData Engineer
    Implement a stack supporting max and popMax

    This question evaluates understanding of data structures and algorithmic complexity, focusing on designing a stack variant that supports efficient retrieval and removal of the current maximum while preserving stack behavior.

    Coding & AlgorithmsTechnical Screen
  • LinkedInMediumMachine Learning Engineer
    Implement alert queries and spike detection

    This problem tests your ability to process a stream of events with time-based constraints, requiring an efficient sliding-window approach and the use of monotonic data structures for spike detection.

    Coding & AlgorithmsOnsiteSliding WindowData StructuresStreaming
  • LinkedInMediumSoftware Engineer
    Implement an LRU cache with follow-ups

    This question evaluates understanding of core data structures and algorithms for designing an efficient LRU cache as well as knowledge of concurrency and synchronization for thread-safe access.

    Coding & AlgorithmsOnsite
  • LinkedInMediumData Scientist
    Implement fast sampling for weighted k-sided die

    This question evaluates understanding of probabilistic algorithm design, numerical stability, and efficient data-structure implementation for constant-time sampling from categorical distributions.

    Coding & AlgorithmsTechnical Screen
  • LinkedInMediumData Scientist
    Implement stream random sampling in Python

    This question evaluates understanding of streaming algorithms, uniform random sampling, and probabilistic guarantees for maintaining a fixed-size sample from an unbounded data stream (reservoir-sampling concepts).

    Coding & AlgorithmsTechnical Screen
  • LinkedInMediumSoftware Engineer
    Largest Sum of a Non-Empty Contiguous Subarray

    Given an integer array, return the largest sum of any non-empty contiguous subarray, including arrays in which every number is negative. This classic phone-screen problem tests efficient array processing and careful handling of edge cases such as all-negative input.

    Coding & AlgorithmsOnsite
  • LinkedInMediumSoftware Engineer
    Lexicographically Smallest Topological Order of a Dependency Graph

    Given n labeled nodes and directed precedence edges, return an ordering that respects every edge, choosing the lexicographically smallest valid ordering, or an empty list when a cycle makes ordering impossible. It tests topological sorting, cycle detection and deterministic tie-breaking.

    Coding & AlgorithmsOnsite
  • LinkedInMediumSoftware Engineer
    Longest Run of Ones After One Flip

    This problem tests your ability to manage a sliding window with a flexible constraint, specifically counting zeros to determine the maximum length of a sequence after a single modification.

    Coding & AlgorithmsTechnical ScreenSliding WindowTwo PointersArray
  • LinkedInMediumSoftware Engineer
    Maximum Product of a Contiguous Subarray With Negatives and Zeros

    Given an integer array that may contain negative numbers and zeros, return the largest product of any non-empty contiguous subarray. The problem tests careful reasoning about sign changes, zeros and single-element subarrays under tight input-size limits.

    Coding & AlgorithmsOnsite
  • LinkedInEasySoftware Engineer
    Merge Two N-ary Trees by Matching Node Keys

    Merge two rooted n-ary trees in which every node has an integer key, combining nodes only when their keys match under matching parents. Tests recursive tree traversal, matching children by key, handling roots with different keys, and producing a canonical preorder encoding of the merged tree.

    Coding & AlgorithmsTechnical Screen
  • LinkedInMediumSoftware Engineer
    Minimize adjacent-color assignment cost

    This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Minimize adjacent-color assignment cost states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

    Coding & AlgorithmsTechnical Screen
  • LinkedInEasySoftware Engineer
    Minimum index distance between two given words in a word list

    Coding problem: given a list of words and two different target words that both appear in it, return the smallest distance between an index of one word and an index of the other. It tests single-pass scanning with position tracking, handling of repeated occurrences, and time complexity analysis.

    Coding & AlgorithmsTechnical Screen
  • LinkedInMediumSoftware Engineer
    Reverse a linked list

    This question evaluates understanding of linked list data structures and proficiency manipulating pointers or references to perform in-place transformations when reversing a linked list. Commonly asked in Coding & Algorithms interviews, it gauges algorithmic thinking and practical application-level competency in list operations rather than purely conceptual theory.

    Coding & AlgorithmsOnsite
  • LinkedInMediumMachine Learning Engineer
    Sample index from probability distribution

    This question tests the ability to implement a weighted random sampling algorithm efficiently using prefix sums and binary search to achieve sub-linear query time.

    Coding & AlgorithmsOnsiteAlgorithmsProbabilityBinary Search
  • LinkedInMediumMachine Learning Engineer
    Sample uniformly from a circle’s area

    This question evaluates understanding of continuous probability distributions and geometric random sampling, testing whether a candidate recognizes how area-weighted uniformity differs from naive radial choices.

    Coding & AlgorithmsOnsite
  • LinkedInMediumSoftware Engineer
    Second-Smallest Value in a Min Tournament Tree in Logarithmic Time

    Given a full binary tournament tree stored in array order, where each internal node holds the smaller of its two children, return the second-smallest leaf value in logarithmic time. It tests reasoning about how a knockout structure constrains where the runner-up can be, array-based tree indexing, and justifying a partial search.

    Coding & AlgorithmsTechnical Screen
  • LinkedInMediumSoftware Engineer
    Shortest Substring Containing Every Character of a Pattern

    Return the shortest substring of a string that contains every character of a pattern with matching multiplicity, case-sensitively, choosing the leftmost substring on ties and an empty string when none exists. Tests efficient substring search and careful character-count bookkeeping.

    Coding & AlgorithmsOther
  • LinkedInHardSoftware Engineer
    Shortest Word Distance Queries

    Tests designing an inverted index and using two-pointer or binary search techniques to efficiently compute the minimum absolute index distance between word occurrences across repeated queries.

    Coding & AlgorithmsTechnical Screenhash-tabletwo-pointersbinary-search
  • LinkedInMediumSoftware Engineer
    Solve Cache, Window, and Heap Problems

    This question evaluates competency in advanced data structures and algorithmic techniques—specifically frequency-based cache design, sliding-window substring search, and heap-driven k-pair generation—along with time and space complexity analysis and robust edge-case handling.

    Coding & AlgorithmsOnsite
  • LinkedInMediumSoftware Engineer
    Solve common string and subarray problems

    Assesses core string and array manipulation skills by requiring string reversal and contiguous-subarray computations for maximum sum and maximum product, identified under the Coding & Algorithms category.

    Coding & AlgorithmsTechnical Screen
  • LinkedInMediumSoftware Engineer
    Solve min window & animal conflicts

    This question evaluates understanding of string algorithms, frequency-based sliding window techniques and hashmap/graph-based conflict detection, focusing on minimal substring search and modeling pairwise exclusions.

    Coding & AlgorithmsOnsite
  • LinkedInMediumSoftware Engineer
    Solve six algorithmic problems

    This multi-part question evaluates algorithmic problem solving, data-structure selection, complexity analysis, API design, and the handling of trees, arrays, grids, circular structures, and dynamic updates.

    Coding & AlgorithmsOnsite
  • LinkedInMediumSoftware Engineer
    Solve substring and top‑K pair problems

    This problem tests your ability to solve a sliding window string problem followed by a heap-based retrieval task for ranked items.

    Coding & AlgorithmsOnsiteSliding WindowHeapString Manipulation
  • LinkedInMediumMachine Learning Engineer
    Sort the values of a quadratic function applied to a sorted array in linear time

    Given an integer array sorted in ascending order and the coefficients of a quadratic function, apply the function to every element and return the results in sorted order in linear time. Tests reasoning about the shape of a parabola, handling of positive, negative and zero leading coefficients, and duplicate values.

    Coding & AlgorithmsTechnical Screen
  • LinkedInHardMachine Learning Engineer
    Sum Every Element of an N-Dimensional Array Readable Only by Index Lists

    Compute the sum of all elements of an array with any number of dimensions when the array exposes only its dimension sizes and a get method that reads one element from a full list of indices. It tests systematic enumeration of every index combination and exact handling of sums beyond the 32-bit range.

    Coding & AlgorithmsTechnical Screen
  • LinkedInMediumSoftware Engineer
    Traverse a Binary Tree in Zigzag Level Order

    Return binary-tree values level by level while alternating left-to-right and right-to-left order without changing level membership.

    Coding & AlgorithmsOnsite
  • Listen LabsMediumSoftware Engineer
    Parse a Truncated Streaming JSON Prefix of Strings and Nested Arrays

    Write a function that turns a truncated prefix of streamed JSON, made only of strings and nested arrays, into the value received so far. It tests careful parsing of half-received strings, unclosed arrays and input that ends after a comma, along with writing your own edge-case tests.

    Coding & AlgorithmsTechnical Screen
  • Listen LabsMediumSoftware Engineer
    Reconstruct a Warehouse Pick-List From a Dropped Scanner Feed

    Write a function that turns a scanner feed cut off mid-transmission into the best pick-list it can represent so far, recovering half-written labels and unfinished bin groupings. Tests careful state-machine parsing of truncated nested data.

    Coding & AlgorithmsTechnical Screenparsingstacksstrings