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 421–450 of 3276 results

  • AppleMediumSoftware Engineer
    Find k Smallest Pair Sums

    This problem tests your ability to efficiently find the k-smallest pair sums from two sorted arrays using a heap-based approach to avoid exhaustive search.

    Coding & AlgorithmsTechnical ScreenHeapSortingTwo Pointers
  • AppleMediumSoftware Engineer
    Find the K Closest Pairs in a Sorted Array

    Implement an algorithm to find the k pairs of elements with the smallest absolute difference in a strictly increasing sorted array.

    Coding & AlgorithmsOnsiteHeapTwo PointersSorted Array
  • AppleMediumSoftware Engineer
    Find top-k frequent elements efficiently

    This question evaluates algorithmic and data-structure skills, focusing on frequency counting, heap-based selection, streaming updates, and time/space complexity analysis within the Coding & Algorithms domain.

    Coding & AlgorithmsTechnical Screen
  • AppleMediumSoftware Engineer
    Generate Tower of Hanoi moves

    This question evaluates understanding of recursion, algorithmic problem decomposition, and analysis of time complexity when generating constrained move sequences.

    Coding & AlgorithmsTechnical Screen
  • AppleMediumMachine Learning Engineer
    Implement Kubernetes Service Dependency Queries

    This question evaluates proficiency with data structures and algorithms for service inventory operations, including deterministic filtering, attribute matching, graph traversal for transitive dependency resolution, and status propagation across service graphs.

    Coding & AlgorithmsOnsite
  • AppleMediumMachine Learning Engineer
    Implement TF-IDF scoring for documents

    This question evaluates understanding of information retrieval and text representation concepts—specifically TF–IDF weighting, tokenization, term frequency and document frequency—and measures competency in implementing an efficient scoring and ranking algorithm.

    Coding & AlgorithmsTechnical Screen
  • AppleMediumSoftware Engineer
    Implement a FIFO Queue Using Two Stacks

    This problem tests the ability to adapt data structure behaviors by implementing a First-In-First-Out (FIFO) queue using only Last-In-First-Out (LIFO) stacks.

    Coding & AlgorithmsOnsiteData StructuresStacksQueues
  • AppleMediumSoftware Engineer
    Implement a debounce function

    This problem tests your understanding of JavaScript closures, asynchronous timers, and the ability to maintain internal state across multiple function invocations.

    Coding & AlgorithmsTechnical ScreenJavaScriptClosuresAsynchronous
  • AppleHardSoftware Engineer
    Implement a lazy inorder traversal iterator

    This problem tests your ability to implement a binary tree iterator that performs inorder traversal using O(h) extra space, where h is the height of the tree, while maintaining an amortized time complexity of O(1) per call.

    Coding & AlgorithmsTechnical ScreenTreesIteratorStack
  • AppleMediumSoftware Engineer
    Implement a robust socket message reader

    This question evaluates understanding of socket programming, stream message framing, internal buffer management, EOF and error handling, input size limits, unit testing, and time/space complexity analysis.

    Coding & AlgorithmsTechnical Screen
  • AppleMediumMachine Learning Engineer
    Implement bag-of-words similarity search from scratch

    This question evaluates knowledge and implementation skills in text processing, vector-space models, and information retrieval, covering tokenization, term-frequency and TF–IDF weighting, cosine similarity, and ranking for similarity search within the Coding & Algorithms domain.

    Coding & AlgorithmsTechnical Screen
  • AppleMediumSoftware Engineer
    Implement deep clone for complex objects

    This question evaluates mastery of deep object cloning, reference and memory management, and knowledge of language runtime details such as prototypes, property descriptors, symbol-keyed and non-enumerable properties, and built-in types like Maps, Sets, Dates, RegExps, and typed arrays.

    Coding & AlgorithmsTechnical Screen
  • AppleEasySoftware Engineer
    Implement flood fill using BFS and DFS

    This question tests the ability to implement graph traversal algorithms (BFS and DFS) on a 2D grid, focusing on boundary conditions and state management.

    Coding & AlgorithmsTechnical ScreenGraphBFSDFS
  • AppleMediumAnalytics Engineer
    Implement most frequent key without using max()

    Category: Coding & Algorithms — this problem evaluates frequency counting, dictionary-based aggregation, string handling, manual maximum-finding without built-in functions, and stable tie-breaking by first appearance in the input.

    Coding & AlgorithmsTechnical Screen
  • AppleEasyData Engineer
    Implement most_frequent_key without using max()

    This question evaluates proficiency in Python fundamentals and object-oriented inheritance, focusing on frequency aggregation using a precomputed dictionary, iteration over mappings, and correct handling of ties and empty inputs.

    Coding & AlgorithmsTechnical Screen
  • AppleMediumMachine Learning Engineer
    Implement permutations and image retrieval

    This question evaluates algorithmic implementation and computational thinking across combinatorics, image processing, and vector similarity—specifically testing permutation generation, 2D convolution with explicit boundary handling, and nearest-neighbor retrieval for image embeddings.

    Coding & AlgorithmsOnsite
  • AppleMediumSoftware Engineer
    Implement rotation, LRU cache, streaming median, cycle detection

    This question evaluates understanding of array/matrix manipulation, cache and data structure design, streaming algorithms for median maintenance, and graph theory for cycle detection, with emphasis on algorithmic complexity analysis and handling of edge cases.

    Coding & AlgorithmsOnsite
  • AppleMediumSoftware Engineer
    Maximize funds with capital-gated projects

    Maximize funds with capital-gated projects 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
  • AppleMediumSoftware Engineer
    Merge Two Strings Using the Longest Edge Overlap

    Compare both suffix-to-prefix concatenation orders, merge the longest edge overlap, and favor the original string order when overlap lengths tie.

    Coding & AlgorithmsOnline Assessment
  • AppleMediumSoftware Engineer
    Merge overlapping time intervals

    This problem tests your ability to manipulate array-based data using sorting and linear scanning to identify and merge overlapping intervals.

    Coding & AlgorithmsTechnical ScreenSortingIntervalsGreedy
  • AppleHardSoftware Engineer
    Minimum Cells to Bridge a Magic Grid

    Tests graph modeling and shortest-path optimization on a 2D grid with zero-weight transitions and unit-weight bridges using 0-1 BFS or Dijkstra's algorithm.

    Coding & AlgorithmsTechnical ScreenGraph0-1 BFSMatrix
  • AppleMediumSoftware Engineer
    Multiply Two Sparse Matrices

    This problem tests your ability to optimize matrix multiplication by leveraging data sparsity to avoid unnecessary computations and handle memory efficiently.

    Coding & AlgorithmsTechnical ScreenArraysMatricesOptimization
  • AppleMediumSoftware Engineer
    Refactor rock–paper–scissors for config and ties

    This question evaluates a candidate's proficiency in object-oriented design, configuration injection, extensibility, state tracking (including ties), and testability when refactoring a Rock–Paper–Scissors tournament to support configurable rounds.

    Coding & AlgorithmsOnsite
  • AppleMediumData Scientist
    Remove shortest subarray to sort array

    This question evaluates proficiency in array algorithms, algorithmic efficiency (linear time and constant-space reasoning), and handling edge cases related to non-decreasing order, within the Coding & Algorithms domain.

    Coding & AlgorithmsOnsite
  • AppleMediumMachine Learning Engineer
    Rotate a Matrix In Place

    This question evaluates proficiency in in-place matrix and array manipulation, spatial data transformation, and reasoning about time and space complexity.

    Coding & AlgorithmsTechnical Screen
  • AppleMediumSoftware Engineer
    Simulate a Fixed-Capacity Least-Recently-Used Cache over a Stream of Operations

    A coding question that asks you to implement a fixed-capacity key-value cache with least-recently-used eviction and run it over a stream of get and put operations. It tests precise recency and eviction rules, updates to keys already in the cache, and the design of a data structure with constant-time operations.

    Coding & AlgorithmsTechnical Screen
  • AppleHardSoftware Engineer
    Smallest Valid Task Order from Dependency Pairs (Topological Sort)

    Given a number of tasks and dependency pairs, return the lexicographically smallest order that completes every task while respecting all dependencies, or an empty list when a cycle makes that impossible. Tests topological sorting, cycle detection and deterministic tie-breaking on large dependency graphs.

    Coding & AlgorithmsOnsite
  • AppleMediumSoftware Engineer
    Solve 15 common Apple coding questions

    This set evaluates algorithmic problem-solving and data-structure competence, including mastery of hash tables, linked lists, stacks, queues, heaps, graphs, sliding-window and two-pointer techniques, complexity analysis, and in-place transformations.

    Coding & AlgorithmsTechnical Screen
  • AppleMediumSoftware Engineer
    Solve 15 common interview problems

    This collection evaluates algorithmic problem-solving skills, mastery of fundamental data structures (arrays, strings, hash maps, stacks, queues, trees, graphs, linked lists) and the ability to reason about time and space complexity.

    Coding & AlgorithmsTechnical Screen
  • AppleMediumSoftware Engineer
    Solve Digit-Square and Grid BFS Problems

    This question evaluates understanding of digit-based state convergence and cycle detection alongside graph traversal and constrained shortest-path search, testing skills in number manipulation, state-space search, and BFS-style exploration.

    Coding & AlgorithmsTechnical Screen