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
Pinduoduo logo
Pinduoduo
Hard
Software Engineer Locked

Find Shortest Square-Sum Path

This question evaluates algorithmic problem-solving skills with number-theoretic reasoning about perfect squares and the ability to reconstruct a mini...

Coding & Algorithms
0
0
6 people solved
May 16, 2026
Anthropic logo
Anthropic
Hard
Machine Learning EngineerSenior+ Locked

Implement a Simplified DNS Resolver

This question evaluates understanding of DNS semantics (name normalization, A and CNAME records, alias chains and cycle detection), robust error handl...

Coding & Algorithms
23
0
203 people solved
May 16, 2026
Google logo
Google
Medium
Software EngineerNew Grad

Track Island Counts as Land Is Added

Track Island Counts as Land Is Added Problem Implement trackIslandCounts(grid, additions) -> counts. grid is a rectangular array containing 0 for wate...

Coding & Algorithms
0
0
8 people solved
Dec 8, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Compute top-K branches by openings

Compute top-K branches by openings Given a stream of account-opening events (branch_id, user_id, timestamp), design algorithms and data structures to ...

Coding & Algorithms
10
0
104 people solved
Aug 8, 2025
Google logo
Google
Medium
Data Scientist Locked

Implement sampling and subarray algorithms

Solve uniform 2D square sampling and longest increasing contiguous subarray. The solution maps Uniform(0,1) to Uniform(-1,1), proves uniformity by ind...

Coding & Algorithms
8
0
82 people solved
Mar 9, 2025
Tesla logo
Tesla
Easy
Software Engineer Locked

Generate Per-Position Guess Feedback

This question evaluates string-processing skills, array manipulation, and handling of duplicate character counts to produce per-position feedback. It ...

Coding & Algorithms
1
0
10 people solved
May 15, 2026
Bloomberg logo
Bloomberg
Medium
Software Engineer Locked

Implement a Composable Event Recommendation Engine

This question evaluates a candidate's skills in software design and implementation for recommendation systems, focusing on modular object-oriented arc...

Coding & Algorithms
5
0
74 people solved
Jan 21, 2026
Capital One logo
Capital One
Easy
Machine Learning Engineer Locked

Solve OA tasks on string, grid path, subarrays

This multi-part question evaluates string manipulation, constrained grid-path optimization with sequential expression evaluation, and counting of pari...

Coding & Algorithms
14
0
179 people solved
Jan 21, 2026
Anthropic logo
Anthropic
Medium
Software Engineer AI Locked

Maximum-Length Unique-Character Subset

This question evaluates a candidate's ability to combine bitmasking with backtracking or subset enumeration to maximize a constraint over combinations...

Coding & Algorithms
0
0
7 people solved
Jun 23, 2026
Anthropic logo
Anthropic
Medium
Software Engineer Locked

Word Search in a Letter Grid

This question evaluates a candidate's ability to search for multiple target words within a grid of letters using depth-first traversal and backtrackin...

Coding & Algorithms
0
0
13 people solved
Jun 23, 2026
Anthropic logo
Anthropic
Medium
Software Engineer Locked

Path Resolution with Symbolic Links

This question evaluates a candidate's ability to implement filesystem-style path resolution, including handling relative and absolute paths, dot compo...

Coding & Algorithms
0
0
8 people solved
Jun 23, 2026
Anthropic logo
Anthropic
Medium
Software Engineer Locked

In-Memory Key-Value Database with Nested Transactions

This question evaluates a candidate's ability to design a data structure that layers transactional state over a committed base, testing skills in nest...

Coding & Algorithms
5
0
22 people solved
Jun 23, 2026
Google logo
Google
Medium
Software Engineer Locked

Solve Shortest Paths and Rental Allocation

This question evaluates understanding of shortest-path algorithms and reachability in weighted graphs (including directed vs. undirected handling and ...

Coding & Algorithms
6
0
45 people solved
Apr 12, 2026
Meta logo
Meta
Medium
Machine Learning Engineer

Solve Two String Problems

The interview included two coding questions: 1. Exactly one edit apart Given two strings s and t, determine whether they are exactly one edit apart...

Coding & Algorithms
4
0
48 people solved
Apr 12, 2026
Karat logo
Karat
Medium
Software Engineer

Implement obstacle-course run statistics

You are given a TypeScript codebase for tracking race results on an obstacle course. - A Course has a fixed number of obstacles. - A Run stores the ti...

Coding & Algorithms
4
0
42 people solved
Apr 12, 2026
Molocoads logo
Molocoads
Hard
Software Engineer

Support Dynamic Range Sums

Implement a data structure over an integer array nums. Part 1: If the array never changes, support sumRange(left, right) that returns the sum of eleme...

Coding & Algorithms
2
0
39 people solved
Apr 12, 2026
TikTok logo
TikTok
Medium
Software Engineer Locked

Find a valid course order from prerequisites

This question evaluates understanding of graph algorithms, topological ordering, dependency resolution, and cycle detection within the Coding & Algori...

Coding & Algorithms
5
0
53 people solved
Jan 20, 2026
Cursor logo
Cursor
Hard
Software Engineer

Implement a Merkle-tree repo diff

You are given two snapshots of a source-code repository on disk, each represented by a root directory path. Implement a Merkle tree over the directory...

Coding & Algorithms
16
0
158 people solved
Feb 14, 2026
Google logo
Google
Medium
Software EngineerNew Grad

Solve Two Array Optimization Problems

You are given two coding problems from the same interview round. Problem 1: Split a gold chain fairly An array weights represents the weights of conse...

Coding & Algorithms
22
1
126 people solved
Apr 11, 2026
TikTok logo
TikTok
Medium
Software Engineer Locked

Count distinct island shapes in a grid

This question evaluates understanding of grid-based connectivity and shape equivalence, exercising skills in graph traversal, spatial normalization, a...

Coding & Algorithms
6
0
62 people solved
Jan 18, 2026

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