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
Software Engineer

Compute longest rising path in a grid

Given an m×n grid of integers, find the length of the longest path where each step moves up, down, left, or right to a strictly larger value. Return t...

Coding & Algorithms
3
0
42 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find all pairs summing to target in sorted array

Given a non-decreasing array of integers nums and an integer target, return all unique pairs of indices (i, j) with i < j such that nums[i] + nums[j] ...

Coding & Algorithms
6
0
45 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Sort characters by frequency

Given an ASCII string s, reorder its characters in decreasing order of frequency. If multiple characters share the same frequency, break ties by ascen...

Coding & Algorithms
2
1
27 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Software Engineer

Segment a message with width-constrained suffixes

Given a message string s and an integer width W, split s into consecutive segments and append a suffix "i/n" to each segment indicating its 1-indexed ...

Coding & Algorithms
5
0
42 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Design LCA and find K closest points

Part A — LCA with parent pointers: You are given two nodes a and b in a rooted tree where each node has a parent pointer (you may or may not have dire...

Coding & Algorithms
2
0
24 people solved
Sep 6, 2025
DoorDash logo
DoorDash
Medium
Software Engineer

Compute delivery times on a grid

You are given a 2D grid with cells marked as 'M' (warehouses), 'C' (customers), 'X' (obstacles), and '.' (roads). You can move up, down, left, or righ...

Coding & Algorithms
12
0
84 people solved
Sep 6, 2025
Salesforce logo
Salesforce
Medium
Software Engineer

Minimize steps to reduce integer

Given a positive integer n (1 <= n <= 2^61 - 1), in one step you may replace n with n/2 if n is even, or with n+1 or n-1 if n is odd. Return the minim...

Coding & Algorithms
10
0
69 people solved
Sep 6, 2025
Citadel logo
Citadel
Medium
Software Engineer

Solve four algorithmic problems

Answer the following independent algorithmic questions: 1) Count extendable prefixes for '10' subsequences: Given a binary string s and an integer k, ...

Coding & Algorithms
21
0
204 people solved
Sep 6, 2025
HubSpot logo
HubSpot
Medium
Software Engineer

Implement Python LRU cache with varargs

Implement an LRU cache in Python as a decorator cache(maxsize) that memoizes a target function's results. Must support positional args, args, and *kwa...

Coding & Algorithms
14
0
122 people solved
Sep 6, 2025
Roblox logo
Roblox
Medium
Software Engineer

Simulate robot path and detect boundedness

A robot starts at (0, 0) facing north on an infinite 2D plane. It executes a command string s consisting of 'G' (move forward one unit), 'L' (turn lef...

Coding & Algorithms
22
0
164 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Count regions with DFS

Given an m x n grid of 0s and 1s, count the number of connected regions consisting of 1s using depth-first search (4-directional adjacency). Return th...

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

Serialize and deserialize a dictionary trie

Question Design and implement serialization and deserialization for a trie (prefix tree) that stores a large dictionary of lowercase English words. Th...

Coding & Algorithms
7
0
101 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Implement binary search lower/upper bounds

Question Given a non-decreasing sorted integer array nums of length n and a target value, implement two functions using binary search: 1. lower_bound(...

Coding & Algorithms
5
0
45 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Compute left and right views once

Given the root of a binary search tree, output two lists: the nodes visible from the left side and the nodes visible from the right side, from top to ...

Coding & Algorithms
4
0
32 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Reverse between equal-value nodes in list

Given the head of a singly linked list and a target value v, locate the first two nodes whose values equal v (call them A and B, with A before B) and ...

Coding & Algorithms
3
0
36 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Count subarrays equal to target

Given an integer array nums and an integer k, return the number of contiguous subarrays whose sum equals k. Provide an algorithm better than O(n^ 2), ...

Coding & Algorithms
2
0
23 people solved
Sep 6, 2025
Applied Intuition logo
Applied Intuition
Medium
Software Engineer

Design a transactional in-memory key–value store

Implement an in-memory key–value store that supports transactions. The system must process these commands: ( 1) SET key value — assign or overwrite a ...

Coding & Algorithms
7
0
118 people solved
Sep 6, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Maximize profit with transaction fees

You are given an array prices where prices[i] is the price of a stock on day i and an integer fee representing the commission charged when you sell. Y...

Coding & Algorithms
14
0
97 people solved
Sep 6, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Implement top-K over a stream

Given a high-volume stream of events (e.g., account IDs from new account openings), design and implement a data structure that supports: ( 1) insertin...

Coding & Algorithms
16
0
116 people solved
Sep 6, 2025
Capital One logo
Capital One
Medium
Software Engineer

Implement 2D transforms and find max-lit point

Part A — 2D array transforms: Given an m×n integer matrix, implement the following in-place operations with clear function boundaries and complexity: ...

Coding & Algorithms
5
0
85 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