Coding & Algorithms Interview Questions

Practice 3,469 real Coding & Algorithms interview questions for 2026. Covers companies like Meta, Amazon, Google, Uber, and Microsoft. Real questions from actual interviews with detailed solutions — ideal for focused interview preparation. Coding & Algorithms interview questions are the single most common technical gate for software engineering roles and are used to evaluate problem framing, algorithm selection, complexity trade-offs, correctness, edge-case reasoning, and clear communication under time pressure. Expect this category to appear in early technical screens and repeatedly across onsite loops at companies that weight it heavily (notably Meta, Google, and Amazon). Interviews will test arrays and strings, trees and graphs, dynamic programming, hashing and two‑pointer techniques, and the candidate’s ability to test and optimize code in a shared editor. Prepare with timed mock interviews, practice in the same editor you’ll use live, and build a progressive schedule that moves from fundamentals to medium/hard problems; typical candidates invest several weeks to a few months of focused practice depending on seniority and target company.

3.5k Questions 368 Companies08.11.2026
Showing 20 results
Role
Pinterest logo
Pinterest
Medium
Software Engineer

Design adjustable ID allocator

Question You manage a fixed global integer ID space [0, 999] (1000 IDs total) and a set of named buckets. Each bucket has a unique name and occupies a...

Coding & Algorithms
14
0
141 people solved
Sep 6, 2025
Applied Intuition logo
Applied Intuition
Medium
Software Engineer

Implement transactional key–value store

Design and implement an in-memory key–value store that supports transactions and nested transactional blocks. Your system must process a stream of com...

Coding & Algorithms
5
0
88 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Find kth smallest pair sum with heaps

You are given two nondecreasing arrays A (length n) and B (length m) of non-negative integers and an integer k (1 <= k <= n*m). Return the k-th smalle...

Coding & Algorithms
3
0
48 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Find connected region sizes in matrix

Given an m x n grid of characters grid and a target character ch, implement: ( 1) sizeOfRegion(grid, r0, c0, ch) -> int that returns the size of the 4...

Coding & Algorithms
5
0
57 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Optimize ribbon piece length by binary search

Given an array lengths of positive integers and an integer k, you may cut each element into pieces of integer length L > 0. Find the maximum L such th...

Coding & Algorithms
3
0
48 people solved
Sep 6, 2025
Optiver logo
Optiver
Medium
Software Engineer

Design a satellite propagation simulator

Question Implement a SatelliteNetwork class that simulates message propagation over an undirected satellite graph. The class consumes a stream of inst...

Coding & Algorithms
77
0
586 people solved
Sep 6, 2025
Uber logo
Uber
Medium
Software Engineer

Solve minimum rate and subset sum

1) Minimum rate to finish vaults within a deadline: You are given an array vaults of positive integers representing the amount in each vault along a r...

Coding & Algorithms
12
0
93 people solved
Sep 6, 2025
Uber logo
Uber
Medium
Software Engineer

Simulate one-round color elimination on a grid

Given an m x n integer matrix board where board[r][c] > 0 represents a color and 0 represents empty: ( 1) A nonzero cell at (r,c) explodes in this rou...

Coding & Algorithms
11
0
77 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find longest segment with endpoints > interior

Given an integer array nums, find the length of the longest contiguous segment [i..j] (j−i+1 ≥ 2) such that both endpoints are strictly greater than e...

Coding & Algorithms
2
0
23 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find minimum days to deliver all orders

You manage N delivery centers labeled 1..N and an array orderCityList where each element is the destination city of one order (city IDs are in 1..N). ...

Coding & Algorithms
8
0
60 people solved
Sep 6, 2025
Pinterest logo
Pinterest
Medium
Software Engineer

Decide target via subsequence plus/multiply expression

Question Given a sequence of positive 32-bit integers A and an integer target, determine whether there exists a subsequence of A (preserving order, us...

Coding & Algorithms
12
0
183 people solved
Sep 6, 2025
Capital One logo
Capital One
Medium
Machine Learning Engineer

Rotate matrix and find max lamp coverage

1) Square-matrix rotation with extra space: Given an n x n integer matrix, return a new matrix that is the 90-degree clockwise rotation of the input. ...

Coding & Algorithms
12
0
79 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Compute rightmost-smaller delay times

Given an integer array priorities, define delay[i] as the distance to the rightmost index j > i such that priorities[j] < priorities[i]; if no such in...

Coding & Algorithms
3
0
36 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Solve grid path and robot navigation

Part A — Shortest path in a grid with obstacles: Given an m×n grid of 0/1 cells (0 = open, 1 = obstacle), start at (0, 0) and end at (m−1,n− 1). You m...

Coding & Algorithms
4
0
33 people solved
Sep 6, 2025
OpenAI logo
OpenAI
Medium
Software Engineer

Implement expiring credit ledger

Implement an expiring-credit ledger that supports out-of-order events. Expose three functions with the following semantics: - add_credit(id, amount, t...

Coding & Algorithms
25
0
250 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Implement DFS and tree algorithms

Part 1 (DFS on graph): Given an undirected graph with n nodes labeled 0..n-1 and an edge list, implement a function that returns all connected compone...

Coding & Algorithms
5
0
37 people solved
Sep 6, 2025
WeRide logo
WeRide
Medium
Software Engineer

Implement expression expansion to plus-only form

Given a string expression consisting only of lowercase letters (variables), '+', '*', '(', and ')', return an equivalent expression that uses only '+'...

Coding & Algorithms
2
0
44 people solved
Sep 6, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Check inorder subsequence and edit tree minimally

Given a binary tree whose nodes store integers and an array target, determine whether target is a subsequence of the tree's inorder traversal (element...

Coding & Algorithms
22
1
207 people solved
Sep 6, 2025
OpenAI logo
OpenAI
Medium
Machine Learning Engineer

Find earliest supporting version under constraints

You are given version strings formatted as {major}.{minor}.{patch}, e.g., "103.003.03". Each version either supports a feature or not. You may call is...

Coding & Algorithms
29
0
472 people solved
Sep 6, 2025
Google logo
Google
Medium
Software Engineer

Maximize coins collected by 3-step pieces

You are given a 1D board of length N. Each cell is in one of three states: - Empty - Piece (a movable token) - Coin (collectible) In one move, you may...

Coding & Algorithms
4
0
71 people solved
Sep 5, 2025

Frequently Asked Questions

How difficult are Coding & Algorithms interview questions?
Difficulty spans a wide range: from quick easy warm-ups to multi-stage hard problems that require advanced data structures or algorithmic proofs. Most companies place a majority of live coding rounds at the medium level, with occasional hard questions used to distinguish senior candidates. Interviewers evaluate problem framing, algorithm choice, time/space complexity, clean implementation, and thoughtful testing under time pressure. Expect more conceptual depth at Google, more consistent medium-to-hard screens at Meta, and Amazon to mix coding with leadership signals. Leveling depends on role and seniority: entry-level focuses on fundamentals; senior roles emphasize design, optimizations, and tradeoffs.
Where does Coding & Algorithms appear in a typical interview loop, and which companies weight it most heavily?
Coding & Algorithms is usually the first technical hurdle: it appears in phone/online screens, followed by one or more onsite or virtual coding rounds during the loop. Typical sequences are a technical screen, two to three in-loop coding sessions, then system design or behavioral rounds. Companies that weight this category heavily include Google, Meta, and Amazon, where coding performance often determines whether you progress. Candidates commonly concentrate practice for weeks or months beforehand; most targeting large tech firms prepare intensively for 6–12 weeks, while some spend 3–6 months for deeper mastery or level changes.
How long should I prepare and how should I structure that preparation?
Plan focused, progressive practice over a realistic timeline. A practical structure is an 8–12 week block: weeks 1–2 solidify fundamentals and language fluency; weeks 3–6 target core patterns (arrays, trees, graphs, DP) with timed problem sessions and pattern tagging; weeks 7–9 emphasize mock interviews, end-to-end problem solving, and optimization tradeoffs; final weeks simulate real loops with full-length sessions and targeted weak-point drills. Candidates with less experience may extend to 12–16 weeks. Regularly review mistakes, practice communicating solutions aloud, and include at least one weekly mock interview with peer or coach feedback.
What key subtopics and patterns should I master for Coding & Algorithms interviews?
Master a consistent set of patterns and their variations: arrays and strings (two pointers, sliding window), hash maps and frequency counts, sorting and binary search, recursion and backtracking, dynamic programming, trees and traversals, graphs (BFS/DFS, shortest paths, union-find), heaps and priority queues, and greedy algorithms. Also practice complexity analysis, space-time tradeoffs, and writing bug-resistant code with tests. For higher levels, focus on amortized analysis, advanced graph algorithms, segment trees or Fenwick trees, and system-aware optimizations. Interviewers value reusable problem templates and the ability to generalize patterns to new prompts.
What are standout tips and common pitfalls to avoid in Coding & Algorithms interviews?
Start by clarifying requirements and constraints, then outline your approach before coding. Write a correct, readable baseline solution first, then iterate to improve complexity while narrating tradeoffs. Test with simple and edge cases, and handle nulls, off-by-one, and empty inputs explicitly. Communicate continuously; silence looks like confusion. Avoid premature optimization, overcomplicating solutions, or ignoring interviewer hints. Time management matters: if stuck, discuss alternate approaches and code a partial solution. Finally, practice mock interviews to reduce anxiety and build the habit of clear, structured explanations under pressure.

Explore more Coding & Algorithms interview questions

Jump straight to Coding & Algorithms questions at a specific company or for a specific role.

By company
By role