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 1831–1860 of 3276 results
- MicrosoftMediumSoftware EngineerCount Occurrences of Each Suffix Maximum
This problem tests your ability to use a monotonic stack and a hash map (or frequency array) to efficiently answer suffix queries about the occurrences of the maximum value.
Coding & AlgorithmsTechnical ScreenArrayGreedyOptimization - MicrosoftMediumSoftware EngineerCount integer pairs satisfying 1/x + 1/y = 1/N
This question evaluates understanding of number theory and algorithmic problem-solving, focusing on Diophantine equation manipulation, divisor counting, and translating algebraic constraints into combinatorial counts.
Coding & AlgorithmsOnline Assessment - MicrosoftMediumSoftware EngineerCount k for consecutive-sum generator
This question evaluates number-theoretic reasoning and understanding of arithmetic progressions, focusing on how sums of consecutive positive integers can be characterized and counted.
Coding & AlgorithmsTechnical Screen - MicrosoftMediumSoftware EngineerCount non-decreasing arrays by digit sums
This question evaluates combinatorics and constrained counting skills, including reasoning about digit-sum properties, monotonic sequences, modular arithmetic, and efficient algorithm design within the Coding & Algorithms domain.
Coding & AlgorithmsTechnical Screen - MicrosoftMediumSoftware EngineerCount the Separate Land Regions in a Binary Grid Map
A coding exercise that counts the separate land regions in a grid map of land and water cells, where land cells connect only through shared edges. It tests systematic exploration of a two-dimensional grid, correct neighbor handling at borders and corners, and scaling to large grids where one region may cover everything.
Coding & AlgorithmsOnsite - MicrosoftHardSoftware EngineerDecode a JWT string without libraries
This problem tests your understanding of the JSON Web Token (JWT) structure and your ability to manually implement Base64URL decoding and JSON deserialization in a constrained environment.
Coding & AlgorithmsOnsiteString ManipulationEncodingSecurity - MicrosoftMediumSoftware EngineerDesign a Versioned Key-Value Store
This problem tests your ability to design a data structure that supports storing multiple values for the same key indexed by timestamps, requiring efficient retrieval of the latest value at or before a specific point in time.
Coding & AlgorithmsTechnical ScreenHash MapBinary SearchData Structures - MicrosoftMediumSoftware EngineerDesign cache with least-recently-used eviction
This question evaluates understanding of in-memory key–value cache design, eviction policies, and appropriate data-structure choices to achieve amortized O(1) get and put operations.
Coding & AlgorithmsTechnical Screen - MicrosoftHardSoftware EngineerDetect Repeated Patterns in a String Sequence
This problem tests string manipulation, hashing, and the ability to detect repeating sub-sequences of a fixed length k across a stream.
Coding & AlgorithmsTechnical ScreenStringsHashingSliding Window - MicrosoftMediumSoftware EngineerDetermine most popular concert city
This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Determine most popular concert city states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Coding & AlgorithmsTechnical Screen - MicrosoftMediumApplied ScientistFewest Distinct Values to Delete So at Least Half the Array Is Removed
A coding question that asks for the fewest distinct values whose complete deletion removes at least half of an integer array. It tests reasoning about how often each value occurs, proving that a choice is minimal, and the exact meaning of half when the array length is odd.
Coding & AlgorithmsOnsite - MicrosoftMediumMachine Learning EngineerFind Top K Largest Elements
This question tests the ability to efficiently find the K largest elements in an unsorted array while managing time complexity constraints through heap-based or selection-based algorithms.
Coding & AlgorithmsTechnical ScreenArraysHeapSorting - MicrosoftMediumSoftware EngineerFind Unique Zero-Sum Triplets
Find unique zero-sum triplets with distinct indices, deterministic ordering, careful duplicate suppression, and explicit time and space analysis.
Coding & AlgorithmsTechnical Screen - MicrosoftHardSoftware EngineerFind all balanced k in a permutation
This question evaluates understanding of permutations, array range reasoning, index mapping, and efficient algorithm design for detecting contiguous subarrays that exactly contain the prefix set {1..k}.
Coding & AlgorithmsTechnical Screen - MicrosoftMediumSoftware EngineerFind longest substring without repeating characters
This problem tests your ability to use the sliding window technique combined with a hash map to efficiently find a maximal subarray meeting a specific constraint.
Coding & AlgorithmsTechnical ScreenSliding WindowHash MapString - MicrosoftMediumSoftware EngineerFind lowest common ancestor in tree
This question evaluates understanding of tree data structures and the lowest common ancestor concept, contrasting use of binary search tree ordering with the general binary tree case while requiring algorithmic time and space complexity reasoning in the Coding & Algorithms domain.
Coding & AlgorithmsTechnical Screen - MicrosoftMediumSoftware EngineerFind max consecutive elements with sum below target
This question evaluates algorithmic problem-solving with arrays, including reasoning about contiguous subsequences, handling sorted inputs and edge cases, and analyzing time and space complexity.
Coding & AlgorithmsOnline Assessment - MicrosoftHardSoftware EngineerFind minimum cycle cost per node
This problem tests your ability to identify cycles within a weighted directed graph and compute the ratio of cycle cost to node count efficiently.
Coding & AlgorithmsOnline AssessmentGraphBinary SearchShortest Path - MicrosoftMediumMachine Learning EngineerFind pairs with the minimum absolute difference
This question evaluates array manipulation, sorting-based reasoning, and the ability to generate ordered value pairs that reflect minimum absolute differences while handling ordering and duplicates.
Coding & AlgorithmsTechnical Screen - MicrosoftMediumSoftware EngineerFind shortest substring with n unique letters
This question evaluates proficiency in string processing, frequency management, and algorithmic optimization for locating constrained contiguous substrings. Commonly asked in the coding & algorithms domain because it reveals how candidates reason about character distinctness and efficiency trade-offs, it targets practical application of algorithmic techniques rather than purely conceptual theory.
Coding & AlgorithmsOnsite - MicrosoftMediumSoftware EngineerFind the Best Connected Strength for Every Tree Node
Compute the maximum weight connected subgraph containing each node in a tree with +1 and -1 neuron weights using rerooting dynamic programming.
Coding & AlgorithmsOnline AssessmentTree DPRerooting DPGraphs - MicrosoftMediumMachine Learning EngineerFind the Lowest Common Ancestor in a Binary Search Tree
This problem tests the ability to leverage the Binary Search Tree (BST) property to efficiently locate the Lowest Common Ancestor (LCA) of two nodes.
Coding & AlgorithmsHR ScreenBSTTreesRecursion - MicrosoftMediumMachine Learning EngineerFind the Lowest Common Ancestor in a Binary Tree
This problem tests tree traversal techniques and recursion logic to identify the deepest node that is an ancestor to two specified nodes in an arbitrary binary tree.
Coding & AlgorithmsHR ScreenTreesRecursionDFS - MicrosoftMediumSoftware EngineerFind the Most Visited Track Position
Determine the most frequently visited track position given a series of sprint endpoints by efficiently tallying overlapping intervals.
Coding & AlgorithmsOnsitearraysprefix-sumdifference-array - MicrosoftMediumSite Reliability EngineerFind where two singly linked lists merge, given each as a sequence of node ids
Coding practice question: two singly linked lists that may merge into a shared tail are given as sequences of node ids, and you must return the id of the node where they first meet, or -1. It tests reasoning about linked list structure, linear-time traversal, and edge cases such as no shared node or one list being the other's tail.
Coding & AlgorithmsOnsite - MicrosoftHardSoftware EngineerGroup GPUs by node and partition by links
This problem tests your ability to model a network as a graph and perform partitioning to optimize internal connectivity constraints.
Coding & AlgorithmsTechnical ScreenGraph TheoryBipartite MatchingCombinatorial Optimization - MicrosoftMediumSoftware EngineerIdentify the Extra Directed Edge
This question evaluates understanding of graph theory concepts—directed trees, parent-child constraints, and cycle detection—and measures competency in reasoning about how a single extra directed edge can violate rooted-tree properties.
Coding & AlgorithmsOnsite - MicrosoftMediumSoftware EngineerImplement Calendar, Tokenizer, and Meeting Optimizer
This problem tests your ability to parse structured meeting request strings into interval objects and then identify the largest subset of non-overlapping meetings that can be scheduled within a fixed workday.
Coding & AlgorithmsOnsiteIntervalsParsingGreedy - MicrosoftMediumMachine Learning EngineerImplement K-Means and Detect Divisible Subarrays
This question evaluates a candidate's ability to implement an iterative clustering algorithm (K-means) and to reason about subarray sums modulo k, testing competencies in numerical computation, centroid management, edge-case handling, and efficient algorithm design.
Coding & AlgorithmsOnsite - MicrosoftMediumSoftware EngineerImplement Matrix Move and Logger
This problem tests in-place array manipulation for submatrix coordinate transformations and the implementation of a thread-safe, time-windowed rate limiter using a sliding window approach.
Coding & AlgorithmsOnsiteArraysHash TableSliding Window