Coding & Algorithms Interview Questions

Practice 3,429 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.4k Questions 368 Companies08.11.2026
Showing 20 results
Role
Snapchat logo
Snapchat
Medium
Software Engineer

Handle cards, islands, Trie, median

Question LeetCode 914. X of a Kind in a Deck of Cards LeetCode 694. Number of Distinct Islands LeetCode 208. Implement Trie (Prefix Tree) LeetCode 295...

Coding & Algorithms
11
0
32 people solved
Jul 29, 2025
LinkedIn logo
LinkedIn
Medium
Software Engineer

Solve min window & animal conflicts

Question LeetCode 76. Minimum Window Substring: Given strings s and t, return the smallest substring of s that contains every character of t (includin...

Coding & Algorithms
21
0
54 people solved
Jul 29, 2025
TikTok logo
TikTok
Medium
Software Engineer

Implement a match-3 board resolver

Question Implement a match-3 board resolver (the core loop of a "candy crush"-style game). You are given an m×n grid of cells. Each cell holds a value...

Coding & Algorithms
3
0
41 people solved
Jul 29, 2025
TikTok logo
TikTok
Medium
Software Engineer

Format messages with paginated suffixes

You are given a message string s and an integer width w. Split s into multiple chunks, preserving character order, and append a suffix "i/n" to each c...

Coding & Algorithms
5
0
39 people solved
Jul 29, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Implement bank account with cashback

Implement a bank account processor. Given an initial non-negative integer balance B and a list of operations (n up to 1e 5), apply each operation in o...

Coding & Algorithms
3
0
56 people solved
Jul 29, 2025
Meta logo
Meta
Medium
Software Engineer

Design weighted random index picker

Design and implement a data structure that, given an array of positive integer weights w[0..n−1], supports pick() that returns index i with probabilit...

Coding & Algorithms
5
0
46 people solved
Jul 29, 2025
TikTok logo
TikTok
Medium
Software Engineer

Compute widest level span in a binary tree

Given a binary tree, define the width of a level as the number of positions between the leftmost and rightmost non-empty nodes at that depth when node...

Coding & Algorithms
2
0
38 people solved
Jul 29, 2025
DoorDash logo
DoorDash
Medium
Software Engineer

Design a hierarchical path registry

Design a hierarchical path registry Implement an in-memory hierarchical path registry. Support: create(path, value) to create a new path with an integ...

Coding & Algorithms
4
0
52 people solved
Jul 28, 2025
DoorDash logo
DoorDash
Medium
Software Engineer

Find max distance between alive tree nodes

Find max distance between alive tree nodes Given a binary tree, define alive nodes. Base case: alive nodes are the leaves. Find the maximum distance (...

Coding & Algorithms
7
0
57 people solved
Jul 28, 2025
Salesforce logo
Salesforce
Medium
Software Engineer

Convert Integer to Non-Adjacent Form

Convert Integer to Non-Adjacent Form Implement toNAF(n) that converts an integer n (allow negative n) to its Non-Adjacent Form using digits from {-1, ...

Coding & Algorithms
10
0
81 people solved
Jul 28, 2025
Salesforce logo
Salesforce
Medium
Software Engineer

Deduplicate a Linked List

Given a singly linked list, remove duplicate values in-place. Variant A (sorted list): delete repeated nodes so each value appears once using O( 1) ex...

Coding & Algorithms
3
0
40 people solved
Jul 28, 2025
Pinterest logo
Pinterest
Medium
Software Engineer

Find minimal time to serve customers

Find minimal time to serve customers You manage a bank with k tellers; teller i takes serviceTimes[i] minutes to serve one customer and works continuo...

Coding & Algorithms
5
0
89 people solved
Jul 28, 2025
Faire logo
Faire
Medium
Software Engineer

Find first 5-7-5 haiku in sentence

Find first 5-7-5 haiku in sentence Given a sentence containing mixed case and punctuation, and a syllable dictionary mapping lowercase words to their ...

Coding & Algorithms
12
0
93 people solved
Jul 28, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Detect runs and answer suffix queries

Given an array of comparable elements a[0..m-1] and an integer N: 1) Write a function that returns the maximum length of any run of consecutive equal ...

Coding & Algorithms
18
0
250 people solved
Jul 28, 2025
Harvey logo
Harvey
Medium
Software Engineer

Design a constrained in-memory file system

Design an in-memory hierarchical file system. Implement: 1) addFile(String path): Given a UNIX-style absolute path like "/path/to/somewhere/file.txt",...

Coding & Algorithms
22
0
325 people solved
Jul 27, 2025
Confluent logo
Confluent
Medium
Software Engineer

Solve constrained monster traversal

Solve constrained monster traversal You are given a directed graph with n rooms labeled 0..n-1; each room i contains a monster with health hp[i] ≥ 0. ...

Coding & Algorithms
7
0
116 people solved
Jul 27, 2025
Nextdoor logo
Nextdoor
Medium
Machine Learning Engineer

Implement and use a version comparator

Implement and use a version comparator You are given up to 100,000 version-like identifiers (e.g., "1.0", "01.2.0", "2.0.0-alpha", "1.10.3"). Implemen...

Coding & Algorithms
7
0
77 people solved
Jul 27, 2025
Meta logo
Meta
Medium
Software Engineer

Compute longest increasing path in a matrix

Compute longest increasing path in a matrix Given an m × n integer matrix, return the length of the longest path of strictly increasing values, where ...

Coding & Algorithms
1
0
26 people solved
Jul 27, 2025
Meta logo
Meta
Medium
Software Engineer

Traverse levels selecting nodes meeting a predicate

Traverse levels selecting nodes meeting a predicate Given the root of a binary tree and a predicate P(value) that returns true for certain node values...

Coding & Algorithms
2
0
17 people solved
Jul 27, 2025
Meta logo
Meta
Medium
Software Engineer

Find minimum and most frequent number efficiently

Find minimum and most frequent number efficiently Given an unsorted integer array, write functions to: (a) find the minimum value; and (b) find any va...

Coding & Algorithms
2
0
22 people solved
Jul 27, 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