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 1–26 of 26 results

  • AirwallexMediumBackend Engineer
    Maximum Triangle Path Sum, Overall and Through a Required Cell

    Given an integer triangle where each step moves to one of the two adjacent cells in the next row, return the maximum top-to-bottom path sum and the maximum sum among paths forced through a given cell. Tests dynamic programming on a triangle and adapting it to a constrained follow-up.

    Coding & AlgorithmsOther
  • AmazonMediumSoftware Engineer
    Count the Distinct Binary Search Tree Shapes for Keys 1 to n

    Count how many structurally different binary search trees can store the keys 1 through n exactly once, for n up to 19. It tests reasoning about how tree shapes decompose and counting combinatorial structures efficiently instead of building every tree.

    Coding & AlgorithmsOther
  • AmazonMediumSoftware Engineer
    Highest-total path through a binary tree encoded in level order

    A coding problem that asks for the largest sum of any non-empty path in a binary tree given in level order, where a path may bend at one node and need not include the root or a leaf. It tests recursive reasoning over trees, correct handling of negative values, and careful decoding of the input format.

    Coding & AlgorithmsOther
  • AmazonMediumSoftware Engineer
    Maximum Profit Assigning Tasks to Exact-Skill Workers Plus One Wildcard Worker

    Assign tasks to workers whose skill must exactly equal each task's requirement, with one extra worker who may take any single task, and return the maximum total profit. It tests making the best use of limited workers per skill level, the single wildcard worker, and large sums that exceed 32 bits.

    Coding & AlgorithmsOther
  • AmazonMediumSoftware Engineer
    Search for a Value in a Matrix Sorted as One Continuous Sequence

    Decide whether a target value appears in a matrix whose rows are sorted and whose every row starts above the previous row's last value. It tests exploiting that ordering to search in logarithmic time and handling single-row, repeated-value and boundary cases correctly.

    Coding & AlgorithmsOther
  • AmazonMediumSoftware Engineer
    Versioned Integer Array with Snapshots and Point-in-Time Reads

    A coding problem about a fixed-length integer array that supports point updates, numbered snapshots of the whole array, and reads of any position as of an earlier snapshot, processed as a list of operations. It tests designing a versioned data structure that stays fast and memory-efficient when snapshots are frequent.

    Coding & AlgorithmsOther
  • AsanaMediumSoftware Engineer
    Pick the K Values Nearest a Target in a Sorted Integer Array

    A coding exercise on a sorted integer array: return the k elements nearest a target value in ascending order, where equal distances favor the smaller value. It tests exploiting sorted order, handling targets outside the array's range, and treating duplicate values correctly.

    Coding & AlgorithmsOther
  • Capital OneMediumSoftware Engineer
    Simulate a Bank Ledger With Validated Transfers, Deposits and Withdrawals

    A coding exercise that simulates a bank's in-memory ledger: apply an ordered sequence of transfers, deposits and withdrawals across numbered accounts and report which requests succeed. It tests careful validation of account numbers and balances, ordered state updates, and 64-bit arithmetic.

    Coding & AlgorithmsOther
  • GoogleMediumSoftware Engineer
    Evaluate a Lisp-Style Expression Language with let, add and mult Scoping

    A Google coding problem asking you to evaluate a small Lisp-like expression language with integer literals, variables, and add, mult and let forms. It tests tokenizing and parsing nested expressions, lexical scoping in which inner bindings shadow outer ones, and sequential rebinding inside a let.

    Coding & AlgorithmsOther
  • GoogleMediumSoftware Engineer
    Simulate an In-Memory Directory Tree with mkdir, ls, Append and Read

    A Google coding problem that simulates an in-memory file system through a sequence of mkdir, ls, add and read operations, with missing directories created on demand and existing files appended to. It tests tree modeling, path parsing, sorted directory listings and precise operation semantics.

    Coding & AlgorithmsOther
  • LinkedInMediumSoftware Engineer
    Count Subsequences Whose Minimum Plus Maximum Stays Within a Target

    Count the non-empty subsequences of an integer array whose minimum plus maximum is at most a target, returning the count modulo 10^9 + 7. Tests combinatorial counting, careful handling of duplicate values chosen by index, and modular arithmetic for very large totals.

    Coding & AlgorithmsOther
  • LinkedInMediumSoftware Engineer
    Find a Target's Index in a Rotated Sorted Array of Distinct Integers

    Find the index of a target value in an array of distinct integers that was sorted ascending and then rotated at an unknown pivot, returning -1 when it is absent. Tests adapting search to a partially ordered array in logarithmic time and handling unrotated and single-element inputs.

    Coding & AlgorithmsOther
  • 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
  • MetaMediumSoftware Engineer
    Add Two Arbitrarily Long Non-Negative Integers Given as Decimal Strings

    Add two non-negative integers that are given as decimal digit strings, possibly thousands of digits long, and return the sum as a string without converting to built-in numbers. Tests digit-by-digit addition with carries, inputs of unequal length and canonical output without leading zeros.

    Coding & AlgorithmsOther
  • MicrosoftMediumSoftware Engineer
    Minimum total cost to convert one string into another using weighted character rules

    A string transformation problem: convert a source string into a target string using directed, weighted character replacement rules that may be chained at a position. It tests reasoning about multi-step conversions, choosing the cheapest of duplicate rules, detecting impossible positions, and totals beyond the 32-bit range.

    Coding & AlgorithmsOther
  • MicrosoftMediumSoftware Engineer
    Return the k values in a sorted array closest to a target, with smaller-value ties

    Given a sorted integer list, a count k and a target value, return the k elements closest to the target in ascending order. The problem tests a precise tie rule that favors smaller values, duplicate values, targets outside the array's range, and working efficiently on already sorted input.

    Coding & AlgorithmsOther
  • MongoDBMediumSoftware Engineer
    Suppress repeat log messages printed within 10 seconds of their last printed occurrence

    Coding practice question: process a time-ordered stream of log messages and decide which ones are printed when the same text may print at most once every 10 seconds. It tests tracking state across a stream, exact boundary handling at the 10-second mark, and correctly ignoring suppressed events.

    Coding & AlgorithmsOther
  • NVIDIAMediumSoftware Engineer
    Count Server Pairs Relayed Through Each Node of a Weighted Tree

    Given a weighted tree of servers and a signal speed, count for every server how many pairs of other servers it can relay: both path lengths must be multiples of the speed and the two paths must share no cable. Tests tree traversal, path-length reasoning and careful combinatorial counting.

    Coding & AlgorithmsOther
  • NVIDIAMediumSoftware Engineer
    Normalize an Absolute Unix-Style File Path to Canonical Form

    Convert an absolute Unix-style file path into canonical form by collapsing repeated slashes, dropping current-directory markers, applying parent-directory moves that stop at the root, and treating other dot-only names as ordinary directories. Tests careful string parsing and edge-case handling of path components.

    Coding & AlgorithmsOther
  • NielsenMediumSoftware Engineer
    Prefix Tree Supporting Insert, Exact Search and Prefix Queries

    A coding problem that processes a sequence of insert, exact-match search and prefix-check operations on lowercase words and returns the boolean answers to the queries in order. It tests building a character-level word index and correctly separating whole-word matches from words that are only prefixes of others.

    Coding & AlgorithmsOther
  • OracleMediumSoftware Engineer
    Maximum stock trading profit with at most k buy-and-sell transactions

    Given daily stock prices and a transaction limit k, compute the maximum profit achievable with at most k buy-then-sell trades while holding at most one share at a time. It tests generalizing a fixed-count trading problem, handling a k larger than the available profitable trades, and tracking state efficiently.

    Coding & AlgorithmsOther
  • OracleMediumSoftware Engineer
    Maximum stock trading profit with at most two buy-and-sell transactions

    A stock trading optimization problem: given daily prices, find the maximum profit using at most two buy-then-sell transactions while holding at most one share at a time. It tests reasoning about splitting the price history into non-overlapping trades and handling falling, flat or steadily rising prices.

    Coding & AlgorithmsOther
  • OracleMediumSoftware Engineer
    Simulate an LFU cache that evicts the least-used key, breaking ties by recency

    Implement and simulate a least-frequently-used cache with fixed capacity that evicts the key with the lowest use count, breaking ties by least recent use. It tests exact eviction semantics, treating updates and reads as uses, and supporting every get and put in constant average time.

    Coding & AlgorithmsOther
  • OtherMediumSoftware Engineer
    Spreadsheet Formulas, Dependencies, and Circular References

    Implement spreadsheet formulas with dependency updates, repeated references, unset cells, and cycle detection that recovers after formulas change.

    Coding & AlgorithmsOther
  • SalesforceMediumSoftware Engineer
    Count the Steps at Which Set Bits Form an Exact Prefix of Ones

    Array problem: the bits of an all-zero binary string are set one at a time in the order given by a permutation; count the steps after which exactly the first i bits are set. It tests careful reasoning about prefix conditions and handling large inputs efficiently.

    Coding & AlgorithmsOther
  • SalesforceMediumSoftware Engineer
    Delete Every Value That Repeats in an Unsorted Singly Linked List

    Linked list problem: delete every node whose value occurs more than once in an unsorted singly linked list, removing all copies and keeping the remaining nodes in their original order. It tests frequency counting, list traversal and careful handling of removals, including at the head of the list.

    Coding & AlgorithmsOther