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

Design a no-repeat top-frequency music player

Design and implement a music player that receives song lists from new users and returns songs to play in frequency order without repeating a song in t...

Coding & Algorithms
4
0
51 people solved
Mar 22, 2025
WeRide logo
WeRide
Medium
Software Engineer

Implement matrix multiplication and fast exponentiation

1) - A n × m - B m × p C = A × Bn × p - - - MOD MOD 2) Exponentiation by Squaring x k MOD - x^k - x^k mod MOD - O(log k) - k = 0x = 0 3) ...

Coding & Algorithms
9
0
68 people solved
Oct 2, 2025
Amazon logo
Amazon
Hard
Software Engineer

Maximize total bandwidth of data channel pairs

You are optimizing how information flows through a network of processing nodes. There are n processing nodes. The bandwidth capability of the i-th nod...

Coding & Algorithms
3
0
37 people solved
Oct 1, 2025
Jane Street logo
Jane Street
Medium
Frontend Engineer

Field Layout: getOffset and insert

An object's binary layout is defined by an ordered list of fields. Each field has a unique name and a size in bytes. Fields are packed contiguously st...

Coding & Algorithms
0
0
10 people solved
Sep 29, 2025
Easy
Data Scientist

Check if a numeric string is divisible by 8

Question You are given a very large non-negative integer represented as a decimal string s (it may be too large to fit in standard 64-bit integer type...

Coding & Algorithms
5
0
38 people solved
Sep 28, 2025
xAI logo
xAI
Medium
Machine Learning Engineer

Implement dynamic batching for token decoding

You are given a black-box “simulated language model” interface that can advance many sequences in a batch. Model interface - Tokens are integers. - mo...

Coding & Algorithms
44
0
324 people solved
Sep 22, 2025
Uber logo
Uber
Medium
Data Scientist

Compute square root to 1 decimal

Problem Given a non-negative real number x, implement a function sqrt1dp(x) that returns \(\sqrt{x}\) rounded (or truncated—clarify with interviewer) ...

Coding & Algorithms
15
0
109 people solved
Sep 16, 2025
Pinterest logo
Pinterest
Medium
Software Engineer

Implement stream line reader and settle balances

Part 1: Streaming line reader from chunked source You are given an existing class ChunkSource with a method nextChunk() that returns the next piece of...

Coding & Algorithms
24
0
203 people solved
Sep 10, 2025
XPeng logo
XPeng
Medium
Machine Learning Engineer

Compute optimal matrix multiplication order

Given an array dims[0..n] where matrix i has dimensions dims[i-1] × dims[i] (for i = 1..n), compute the minimum number of scalar multiplications neede...

Coding & Algorithms
1
0
13 people solved
Sep 6, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Design menu DP and optimize for three items

You are given a restaurant menu with n single items and m combo offers. Each single item i has a price p[i] (in cents). Each combo j specifies nonnega...

Coding & Algorithms
5
2
39 people solved
Sep 6, 2025
TripStack logo
TripStack
Medium
Software Engineer

Compute minimum resources for overlapping intervals

You are given n tasks as half-open time intervals [start, end) on a single day. Determine the minimum number of identical servers needed so that no tw...

Coding & Algorithms
1
0
7 people solved
Sep 6, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Find first error and propagate failures

You are given a chronological log history where each entry is a string prefixed with one of [Info], [Warn], or [Error]. Two invariants hold: ( 1) once...

Coding & Algorithms
1
0
14 people solved
Sep 6, 2025
eBay logo
eBay
Medium
Software Engineer

Pass functions and analyze basic data structures

Implement a function applyTwice(f, x) that accepts a function f and a value x and returns f(f(x)) in your preferred language. Demonstrate how to pass ...

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

Find substring where all chars appear at least k

You are given a string s and an integer k (1 ≤ k ≤ |s|). Return the length of the longest substring in which every distinct character occurs at least ...

Coding & Algorithms
3
0
44 people solved
Sep 6, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Solve build ordering and expression evaluation

Part A — Dependency ordering: You are given an integer n (0 ≤ n ≤ 200000) representing tasks labeled 0..n-1 and a list of prerequisite pairs [a, b] me...

Coding & Algorithms
6
0
71 people solved
Sep 6, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Design file deduplication algorithm

Design an algorithm to deduplicate files in a storage system. Compare fixed-size versus content-defined chunking and explain how you would choose hash...

Coding & Algorithms
12
0
201 people solved
Sep 6, 2025
Databricks logo
Databricks
Medium
Software Engineer

Implement a sliding-window hit counter

Implement a hit counter that supports recordHit(timestamp) and getHits(pastSeconds). Use a fixed-size array to maintain a sliding time window (e.g., l...

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

Implement bounds, minimum, pathfinding, and moving average

Solve the following data-structures problems: ( 1) Given two sorted integer lists A and B, merge them into a single non-decreasing array. Then, for a ...

Coding & Algorithms
6
0
49 people solved
Sep 6, 2025
Apple logo
Apple
Medium
Software Engineer

Implement DFS for connected components

Given an undirected graph with n nodes (1 ≤ n ≤ 200, 000) and an edge list, implement depth-first search to compute (a) the number of connected compon...

Coding & Algorithms
9
0
60 people solved
Sep 6, 2025
Mixpanel logo
Mixpanel
Medium
Software Engineer

Implement precise string-based decimal addition

Given two non-empty strings representing decimal numbers (e.g., "123.456" and "6234.42432"), implement a function that returns their exact sum as a st...

Coding & Algorithms
6
0
45 people solved
Sep 6, 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