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
Meta logo
Meta
Medium
Machine Learning Engineer

Detect cycles and order with DFS

You are given a directed graph of package dependencies represented as an adjacency list: Map<String, List<String>> deps where deps[p] lists packages t...

Coding & Algorithms
5
0
61 people solved
Sep 6, 2025
Microsoft logo
Microsoft
Medium
Data Scientist Locked

Print Org Chart by Level

This question evaluates the ability to model hierarchical data, work with tree/graph data structures, select traversal strategies, and analyze time an...

Coding & Algorithms
3
0
37 people solved
Jan 16, 2026
Snowflake logo
Snowflake
Hard
Software Engineer

Compute nearest bathroom distance for each desk

You are given an m x n grid of characters containing only: - 'B' = bathroom - 'D' = desk - '_' = empty cell From any cell you may move one step up/dow...

Coding & Algorithms
13
0
163 people solved
Jan 16, 2026
Wayve logo
Wayve
Easy
Software Engineer

Compute an Exact Factorial

Compute an Exact Factorial Implement factorial(n) and return the exact integer value of n!. 0! is defined as 1. The input is always a valid nonnegativ...

Coding & Algorithms
1
0
21 people solved
Apr 9, 2026
Perplexity logo
Perplexity
Medium
Data Scientist Locked

Implement Stratified Sampling by Country

This question evaluates understanding of stratified sampling, proportional allocation across groups, reproducible random sampling, data grouping and e...

Coding & Algorithms
3
0
49 people solved
Apr 9, 2026
Jane Street logo
Jane Street
Medium
Software EngineerIntern

Bottom-Insertion Connect Game: Detect the First k-in-a-Row Winner

Two players, B and R, take turns dropping pieces onto a board that covers the upper half-plane of an integer grid. Columns are indexed by arbitrary in...

Coding & Algorithms
1
0
21 people solved
Nov 6, 2025
Google logo
Google
Hard
Software Engineer Locked

Find conflicting pair using black-box run()

This question evaluates algorithm design and query-complexity reasoning, focusing on efficient search strategies for identifying an interacting pair v...

Coding & Algorithms
10
0
92 people solved
Jan 15, 2026
Qube logo
Qube
Hard
Software Engineer Locked

Compute expected days until no whole pills

This question evaluates understanding of probability and expected value, modeling of state-based stochastic processes (Markov chains), and the ability...

Coding & Algorithms
4
0
43 people solved
Jan 15, 2026
Robinhood logo
Robinhood
Medium
Software EngineerSenior+ Locked

Parse Requests and Compute Balances

This question evaluates input parsing, state management, data validation, and use of basic data structures to track user accounts, friend relationship...

Coding & Algorithms
4
0
47 people solved
Jan 14, 2026
Google logo
Google
Medium
Software EngineerNew Grad

Solve Two Coding Interview Problems

You are asked to solve two independent coding problems. Problem 1: Evaluate Nested Math Expressions Implement a function that evaluates a string expre...

Coding & Algorithms
0
0
10 people solved
Apr 8, 2026
eBay logo
eBay
Medium
Software EngineerSenior+

Solve Dependency, Prefix, and Cache Problems

Solve the following three coding problems. Problem 1: Determine Whether All Tasks Can Be Completed You are given numTasks, the number of tasks labeled...

Coding & Algorithms
3
0
27 people solved
Apr 8, 2026
Meta logo
Meta
Medium
Backend Engineer AI Locked

Solve coding and AI-assisted tasks

This set evaluates algorithmic problem-solving across arrays, immutable linked-list interfaces, parent-pointer tree traversal, string validity via min...

Coding & Algorithms
8
0
66 people solved
Apr 8, 2026
Hudson logo
Hudson
Easy
Software Engineer Locked

Count players reaching end with moving watchers

This question evaluates skills in discrete-event simulation, stateful time-step modeling, and range coverage by moving agents, as well as algorithmic ...

Coding & Algorithms
9
0
71 people solved
Nov 2, 2025
Amperity logo
Amperity
Medium
Software Engineer

Render Overlapping Rectangles on an ASCII Canvas

Render Overlapping Rectangles on an ASCII Canvas Implement render_canvas(width, height, rectangles). The canvas initially contains spaces and is retur...

Coding & Algorithms
0
0
5 people solved
Apr 7, 2026
OpenAI logo
OpenAI
Hard
Software Engineer

Implement Disease and Friend Snapshot Models

You are asked to solve two independent coding problems. Problem 1: Simulate disease spread on a contact graph There are n people labeled 0 through n -...

Coding & Algorithms
2
0
22 people solved
Apr 7, 2026
Oracle logo
Oracle
Medium
Software Engineer Locked

Solve Five Coding Problems

This problem set evaluates proficiency in core algorithms and data structures, including graph traversal and connected-component identification, array...

Coding & Algorithms
5
0
40 people solved
Apr 7, 2026
OpenAI logo
OpenAI
Hard
Software Engineer Locked

Compute Infection Time in a Grid

This question evaluates competence in grid-based graph traversal and simulation of propagation dynamics, focusing on state management, time-step model...

Coding & Algorithms
19
1
183 people solved
Apr 7, 2026
Snowflake logo
Snowflake
Medium
Software Engineer

Find Shortest Wiki Click Path

Implement a function that computes the minimum number of clicks needed to navigate from one wiki page to another. You are given two page URIs, start_u...

Coding & Algorithms
6
0
60 people solved
Apr 7, 2026
J.P. Morgan logo
J.P. Morgan
Medium
Data ScientistNew Grad Locked

Implement KNN from Scratch

This question evaluates a candidate's understanding and practical implementation skills for instance-based supervised learning, specifically the k-nea...

Coding & Algorithms
2
0
24 people solved
Apr 7, 2026
Google logo
Google
Easy
Software Engineer Locked

Implement Memory-Efficient Document Undo/Redo

This question evaluates data structure design and algorithmic reasoning for implementing memory-efficient undo/redo semantics on a key-value document,...

Coding & Algorithms
7
0
60 people solved
Jan 12, 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