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
Affirm logo
Affirm
Medium
Software Engineer

Detect Fraud by Propagating Suspicious PII

Detect Fraud by Propagating Suspicious PII Process a stream of underwriting and fraud_flag events in order. Maintain a set of suspicious PII values dr...

Coding & Algorithms
2
2
17 people solved
Apr 19, 2026
Affirm logo
Affirm
Medium
Software Engineer

Count Distinct PII in Underwriting Events

Count Distinct PII in Underwriting Events An event stream contains underwriting and fraud_flag events. Count the distinct nonempty personally identifi...

Coding & Algorithms
2
0
16 people solved
Apr 19, 2026
Apple logo
Apple
Medium
Software EngineerNew Grad

Solve interval, grid-fill, and heap tasks

You are asked to solve the following algorithmic problems. Problem 1: Concurrent users from online intervals You are given n inclusive time intervals ...

Coding & Algorithms
15
0
192 people solved
Nov 27, 2025
Google logo
Google
Medium
Software EngineerNew Grad

Return Unique Three-Sum Value Triples

Return Unique Three-Sum Value Triples Problem Implement threeSumTarget(nums, target) -> triples. Return every distinct value triple [a, b, c] for whic...

Coding & Algorithms
1
0
14 people solved
Dec 8, 2025
Pinduoduo logo
Pinduoduo
Medium
Software Engineer Locked

Generate a Matrix in Spiral Order

This question evaluates a candidate's ability to simulate array traversal and manage boundary conditions when filling a matrix in a specific geometric...

Coding & Algorithms
1
0
8 people solved
Jun 17, 2026
Microsoft logo
Microsoft
Easy
Data ScientistNew Grad

Compute and plot a precision–recall curve

You are given model outputs for a binary classifier: - y_true: an array of 0/1 ground-truth labels of length n. - y_score: an array of predicted score...

Coding & Algorithms
6
0
66 people solved
Nov 24, 2025
Oracle logo
Oracle
Hard
Software Engineer Locked

Implement in-memory data structures and booking API

This question evaluates proficiency in data structures and algorithms, systems-level data modeling, and practical API design by testing in-memory key-...

Coding & Algorithms
8
0
119 people solved
Feb 12, 2026
Qualcomm logo
Qualcomm
Medium
Software Engineer

Compute the Diameter of an Undirected Tree

Compute the Diameter of an Undirected Tree You are given an undirected tree with nodes numbered from 0 through n - 1. The diameter is the number of ed...

Coding & Algorithms
2
0
18 people solved
Apr 16, 2026
Coinbase logo
Coinbase
Medium
Machine Learning Engineer

Write SQL to rank top products per category

You are given two tables: products - product_id (int, primary key) - category (string) order_items - order_id (int) - product_id (int) - quantity (int...

Coding & Algorithms
10
1
116 people solved
Dec 4, 2025
Bloomberg logo
Bloomberg
Medium
Software Engineer

Generate all strings by expanding wildcards

Problem Given a string s consisting only of characters '0', '1', and '', replace every '' with either '0' or '1' and return all possible resulting bin...

Coding & Algorithms
17
1
144 people solved
Dec 15, 2025
Capital One logo
Capital One
Medium
Machine Learning Engineer

Return all root-to-leaf tree paths

Given the root of a binary tree, return all root-to-leaf paths. - A leaf is a node with no children. - A path should be represented as a string with n...

Coding & Algorithms
11
0
82 people solved
Dec 15, 2025
NVIDIA logo
NVIDIA
Hard
Data Scientist

Reverse linked lists, including k-group

Singly Linked List Reversal — Variants and Edge Cases You are given a standard singly linked list with nodes of the form: - Node fields: value, next -...

Coding & Algorithms
6
0
90 people solved
Oct 13, 2025
XPeng logo
XPeng
Medium
Software Engineer Locked

Implement Stable Softmax

This question evaluates understanding of numerical stability, floating-point arithmetic, normalization, and probability distributions when computing s...

Coding & Algorithms
1
0
12 people solved
May 3, 2026
Anthropic logo
Anthropic
Hard
Software Engineer Locked

Implement Persistent Memoization LRU Cache

This question evaluates knowledge of memoization, LRU cache semantics, deterministic cache-key construction from positional and keyword arguments, JSO...

Coding & Algorithms
9
0
69 people solved
May 23, 2026
Zoox logo
Zoox
Medium
Machine Learning Engineer Locked

Compute Roller Coaster Scores

This question evaluates proficiency in string parsing, floating-point arithmetic, conditional logic, and designing extensible rule-based scoring syste...

Coding & Algorithms
7
0
99 people solved
May 2, 2026
Microsoft logo
Microsoft
Medium
Machine Learning Engineer Locked

Implement SFT Sample Packing

This question evaluates proficiency in preprocessing for autoregressive language models, including deterministic sequence packing, construction of los...

Coding & Algorithms
4
0
49 people solved
Apr 13, 2026
OpenAI logo
OpenAI
Medium
Machine Learning Engineer Locked

Find Minimum Compatible Version

This question evaluates binary search, monotonic predicates, careful version ordering, and cost-aware optimization of expensive compatibility checks. ...

Coding & Algorithms
11
0
153 people solved
Mar 9, 2026
Squarepoint logo
Squarepoint
Medium
Software Engineer

Return Elements Greater Than the Overall Average

Return Elements Greater Than the Overall Average Implement above_average(values). Compute the arithmetic mean of the entire non-empty integer list, th...

Coding & Algorithms
2
0
16 people solved
Jul 12, 2026
Affirm logo
Affirm
Medium
Software Engineer Locked

Determine Redeemable Promotion Offers

This question evaluates proficiency in event-stream processing, stateful counting, timestamp filtering, and enforcing business constraints for limited...

Coding & Algorithms
2
2
23 people solved
May 1, 2026
Walmart Labs logo
Walmart Labs
Medium
Software Engineer Locked

Find shared courses between student pairs

This problem set evaluates data structures and algorithms competencies, covering mapping and set intersection for pairwise course overlap, permutation...

Coding & Algorithms
11
0
102 people solved
Jan 6, 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