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

Generate Weighted Random NFTs with Updates

You manage k NFT types, each with a positive integer rarity weight w[i]. Implement a minter: constructor(w) builds any needed structures in O(k); mint...

Coding & Algorithms
21
0
199 people solved
Sep 6, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Implement a Simple Banking Ledger

Design and implement a banking ledger for n accounts labeled 1..n with initial balances. Provide an API: deposit(id, amount) -> bool, withdraw(id, amo...

Coding & Algorithms
10
0
85 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Merge two interval lists into a union

You are given two lists of closed intervals [start, end]. Each list is individually sorted by start and contains non-overlapping intervals. Merge the ...

Coding & Algorithms
1
0
23 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Compute nested depth-weighted sum

You are given a nested structure containing integers and lists (e.g., [1, [4, [6]]]). Define depth of the top-level as 1. Compute the total sum of all...

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

Maximize optional tasks under daily limit

You are given an integer limit and two integer arrays required and optional of length n. For each day i, you must schedule required[i]. If time remain...

Coding & Algorithms
1
0
25 people solved
Sep 6, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Count k for consecutive-sum generator

An array generator service produces a consecutive-integers array starting at a positive integer k: [k, k+1, ..., k+m−1] for some m ≥ 1. The service re...

Coding & Algorithms
13
0
93 people solved
Sep 6, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Count non-decreasing arrays by digit sums

You are given an array required_sums of length n. Count how many non-decreasing arrays result[1..n] of integers satisfy all of the following: ( 1) for...

Coding & Algorithms
5
0
60 people solved
Sep 6, 2025
Google logo
Google
Medium
Software Engineer

Find minimum covering substring

Given two strings s and t, return the shortest contiguous substring of s that contains every character of t with at least the same multiplicities. If ...

Coding & Algorithms
6
0
81 people solved
Sep 6, 2025
Akuna Capital logo
Akuna Capital
Medium
Software Engineer

Count inversions in an array efficiently

Given the array [5, 7, 9, 2, 3, 12, 8, 4], compute the number of inversion pairs (i, j) where i < j and arr[i] > arr[j]. Describe both a naive O(n^ 2)...

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

Design a rolling five-minute hit counter

Design an in-memory hit counter that supports: ( 1) recordHit(timestamp) to log an event, and ( 2) getCountLast5Minutes(now) to return the number of e...

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

Implement hostname-restricted web crawler

Implement a single-threaded web crawler that, given a starting URL startUrl and an interface getUrls(url) that returns all hyperlinks on the page at u...

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

Solve grid min path and sqrt by binary search

1) Given an m x n matrix of non-negative integers, find a path from the top-left to the bottom-right that minimizes the sum of cell values. You may on...

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

Verify permutation in-place and implement fast power

1) Given an integer list A of length n, determine whether A is a permutation of [0, 1, ..., n-1]. Do it in-place with O( 1) extra space (no auxiliary ...

Coding & Algorithms
5
0
63 people solved
Sep 6, 2025
Chime logo
Chime
Medium
Software Engineer

Implement single-tab browser history navigation

Implement a BrowserSession for a single-tab browser. APIs: - BrowserSession(string homepage): Initialize with homepage; current page starts at homepag...

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

Insert and merge an interval

You are given a list of pairwise non-overlapping closed intervals [si, ei] sorted by start time, and a new interval [s, e]. Insert [s, e] into the lis...

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

Detect cycle in a directed graph

Given a directed graph represented by an adjacency list with n vertices and m edges, determine whether the graph contains a cycle. Describe and implem...

Coding & Algorithms
6
0
65 people solved
Sep 6, 2025
Lyft logo
Lyft
Medium
Software Engineer

Implement command-driven in-memory key-value database

Implement a command-driven in-memory key–value database. Supported commands (one per line): 1) SET key value 2) GET key → print value or NULL 3) DELET...

Coding & Algorithms
27
0
248 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Implement string dedup and mirror tree traversal

- String cleanup with group deletions (LeetCode-inspired): Given a string s consisting of lowercase letters, repeatedly delete any maximal contiguous ...

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

Set second tree values by subtree sums

Given the roots of two complete binary trees T1 and T2 that have identical structure and the same number of nodes, replace each value in T2 with the s...

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

Search target in unknown-length sorted array

You have read-only access to a sorted, increasing array-like interface of unknown length that supports get(i), which returns a valid integer for in-bo...

Coding & Algorithms
4
0
51 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