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 2851–2880 of 3276 results

  • TikTokMediumMachine Learning Engineer
    Find length of longest common subsequence

    This problem tests your ability to identify overlapping subproblems and optimal substructure by implementing a dynamic programming solution to find the length of the Longest Common Subsequence (LCS) between two strings.

    Coding & AlgorithmsTechnical ScreenDynamic ProgrammingStringsOptimization
  • TikTokMediumSoftware Engineer
    Find longest common subsequence length

    This question tests the ability to solve the Longest Common Subsequence (LCS) problem using dynamic programming, specifically focusing on building a 2D state table.

    Coding & AlgorithmsOnsiteDynamic ProgrammingStringsAlgorithms
  • TikTokHardSoftware Engineer
    Find longest substring with ≥k repeats

    This problem tests your ability to use the sliding window technique combined with frequency maps to find the longest substring containing characters that each appear at least k times.

    Coding & AlgorithmsTechnical ScreenStringsSliding WindowTwo Pointers
  • TikTokMediumMachine Learning Engineer
    Find longest substring without repeating characters

    This question evaluates proficiency in string processing, duplicate-detection using appropriate data structures, and algorithmic complexity analysis within the Coding & Algorithms domain.

    Coding & AlgorithmsOnsite
  • TikTokEasySoftware Engineer
    Find start indices of anagram substrings

    This question evaluates proficiency in string processing, frequency-based pattern matching, and algorithmic efficiency under length constraints, testing the ability to reason about time and space trade-offs for substring searches.

    Coding & AlgorithmsTechnical Screen
  • TikTokMediumSoftware Engineer
    Find the Longest Substring with at Most Two Distinct Characters

    Tests the ability to use the sliding window technique combined with a hash map to maintain a dynamic character set and determine the maximum length of a valid substring in linear time.

    Coding & AlgorithmsTechnical Screensliding-windowhash-tabletwo-pointers
  • TikTokMediumMachine Learning Engineer
    Fix a BST with two misplaced keys

    This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Fix a BST with two misplaced keys states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

    Coding & AlgorithmsTechnical Screen
  • TikTokMediumSoftware Engineer
    Flatten object & Promise.all

    This question evaluates proficiency in JavaScript data manipulation and asynchronous programming, testing competencies in transforming nested objects into single-level key paths and reproducing Promise.all semantics.

    Coding & AlgorithmsTechnical Screen
  • TikTokHardMachine Learning Engineer
    Generate all safe queen placements on board

    This question evaluates algorithm design for constraint-satisfaction problems, testing skills in search, recursion, backtracking, combinatorics, and state-space pruning.

    Coding & AlgorithmsTechnical Screen
  • TikTokMediumBackend Software Engineer
    Implement Hash Map Operations

    Build a hash map behind a deterministic operation stream with insertion, replacement, lookup, removal, and missing-key behavior. The specification avoids built-in map storage and fixes return ordering and value bounds for a future portable console implementation.

    Coding & AlgorithmsOnsite
  • TikTokMediumData Scientist
    Implement K-means and run two iterations

    This question evaluates understanding of k-means clustering concepts (k-means++ initialization, Lloyd iterations, and SSE) and proficiency in numerical implementation and vectorized array operations.

    Coding & AlgorithmsTechnical Screen
  • TikTokMediumSoftware Engineer
    Implement O(1) randomized multiset

    Implement O(1) randomized multiset evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

    Coding & AlgorithmsTechnical Screen
  • TikTokMediumSoftware Engineer
    Implement a match-3 board resolver

    TikTok software-engineer technical-screen coding question: implement a match-3 board resolver over an m×n grid. Repeatedly remove connected horizontal/vertical runs of three or more equal cells, apply gravity so survivors fall and blanks rise to the top, cascade until the board is stable, and return the final board plus the total cells removed. It tests grid simulation, run detection via linear scans, per-column gravity, termination reasoning, and time/space complexity analysis.

    Coding & AlgorithmsTechnical Screen
  • TikTokEasySoftware Engineer
    Implement an LRU cache

    This question tests the ability to implement a Least Recently Used (LRU) cache using a combination of a hash map and a doubly linked list to achieve constant time complexity for core operations.

    Coding & AlgorithmsTechnical ScreenHash MapLinked ListDesign
  • TikTokMediumSoftware Engineer
    Implement binary tree in-order traversal

    This question evaluates understanding of binary tree traversal, comparing recursive and iterative (explicit stack) implementations and their time and space complexity. Commonly asked in Coding & Algorithms interviews to assess both practical implementation and conceptual understanding of tree data structures, algorithmic trade-offs, and complexity analysis.

    Coding & AlgorithmsTechnical Screen
  • TikTokHardMachine Learning Engineer
    Implement local maxima, bagging, and k-means

    This problem tests your ability to implement a sliding window peak detector, a bootstrapping ensemble sampler, and a centroid-based clustering algorithm from scratch.

    Coding & AlgorithmsOnline AssessmentAlgorithmsClusteringEnsemble Learning
  • TikTokMediumData Scientist
    Implement streaming SRM detector with late events

    This question evaluates proficiency in stateful stream processing, statistical anomaly detection for sample ratio mismatch, and scalable system design concerns such as deduplication, late/out-of-order event handling, real-time aggregation, chi-square testing with Yates correction, bot-rate mitigation, sharding, and replay validation.

    Coding & AlgorithmsHR Screen
  • TikTokMediumData Scientist
    Maximize Distinct Purchases Within Budget Constraints

    This question evaluates understanding of selection and optimization under budget constraints, algorithmic efficiency, and the ability to implement correct logic for maximizing the number of distinct items purchased.

    Coding & AlgorithmsOnline Assessment
  • TikTokMediumSoftware Engineer
    Maximize min+max of contiguous subarray

    This question evaluates understanding of array algorithms and competency in identifying and reasoning about minimum and maximum values within contiguous subarrays, emphasizing extremal value handling.

    Coding & AlgorithmsTechnical Screen
  • TikTokMediumData Scientist
    Maximize products bought under budget

    This question evaluates algorithmic problem-solving skills including sorting, prefix-sum accumulation, binary search, greedy selection, careful tie-breaking for lexicographic order, and complexity analysis.

    Coding & AlgorithmsOnline Assessment
  • TikTokMediumData Scientist
    Optimize Station Sequence for Maximum Car Output in Simulation

    This question evaluates a candidate's skills in scheduling and throughput optimization, including queue management and simulation-based performance analysis within constrained buffering and station sequencing.

    Coding & AlgorithmsOnsite
  • TikTokMediumSoftware Engineer
    Parse a nested list from a string

    This problem tests your ability to parse recursive nested structures using stack-based iteration or recursion and string manipulation.

    Coding & AlgorithmsTechnical ScreenRecursionStackParsing
  • TikTokMediumSoftware Engineer
    Parse chemical formula with multipliers

    Parse chemical formula with multipliers evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

    Coding & AlgorithmsTechnical Screen
  • TikTokMediumBackend Software Engineer
    Process LRU Cache Operations

    Implement an LRU cache through a deterministic stream of put and get operations, including updates, misses, and eviction order. The prompt defines an exact portable function contract and examples suitable for a later four-language console handoff.

    Coding & AlgorithmsOnsite
  • TikTokMediumSoftware Engineer
    Reconstruct a tree from two traversals

    Reconstruct a tree from two traversals evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

    Coding & AlgorithmsTechnical Screen
  • TikTokHardSoftware Engineer
    Remove the Fewest Overlapping Intervals

    Tests greedy interval scheduling and sorting techniques to find the minimum number of intervals to remove so that no remaining intervals overlap.

    Coding & AlgorithmsOnsiteGreedySortingIntervals
  • TikTokMediumSoftware Engineer
    Restore Every Valid IP Address

    Implement a backtracking algorithm to partition a digit string into four valid IPv4 octets, adhering to numerical range and leading-zero constraints.

    Coding & AlgorithmsTechnical ScreenBacktrackingStringRecursion
  • TikTokHardSoftware Engineer
    Schedule Seller Tasks with Tier-Weighted Round Robin

    Design a task scheduler that dispenses seller tasks using tier-weighted round-robin across sellers while strictly preserving per-seller priority and FIFO order.

    Coding & AlgorithmsOnsiteQueueHeapDesign
  • TikTokMediumSoftware Engineer
    Solve array and tree algorithm challenges

    This question evaluates algorithmic problem-solving skills across array, heap, and tree data structures, testing competencies in duplicate handling, frequency aggregation, and balancing root-to-leaf path sums within the Coding & Algorithms domain.

    Coding & AlgorithmsTechnical Screen
  • TikTokMediumSoftware Engineer
    Solve common string/DP/stack problems

    This problem tests your ability to identify and implement an efficient solution for finding the longest substring that satisfies specific constraints, requiring a sliding window approach.

    Coding & AlgorithmsTechnical ScreenSliding WindowHash MapStrings