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
Shopify logo
Shopify
Medium
Data Scientist

Implement an LRU Cache

Problem: LRU Cache (LeetCode 146) Design and implement a Least Recently Used (LRU) Cache that supports the following operations in average O(1) time. ...

Coding & Algorithms
18
0
133 people solved
Aug 10, 2025
Sybill logo
Sybill
Medium
Software Engineer

Implement an unbiased array shuffle

Implement an unbiased array shuffle Implement an in-place function shuffle(arr) in JavaScript that returns a uniformly random permutation of the input...

Coding & Algorithms
2
0
46 people solved
Aug 10, 2025
Rippling logo
Rippling
Medium
Software Engineer

Compute peak busy dashers with overlaps

You are given delivery logs as (dasherId, startTime, endTime) with integer times, where endTime is exclusive. A single dasher may accept multiple orde...

Coding & Algorithms
15
0
198 people solved
Aug 10, 2025
Amazon logo
Amazon
Medium
Software Engineer

Place items into earliest fitting bins

Place items into earliest fitting bins You are given k items with sizes items[0..k-1] and n bins with initial capacities caps[0..n-1]. Process items i...

Coding & Algorithms
2
1
30 people solved
Aug 10, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find LCA in a BST

Find LCA in a BST Given the root of a binary search tree and two keys p and q, return the value of their lowest common ancestor (the deepest node whos...

Coding & Algorithms
2
0
36 people solved
Aug 10, 2025
LinkedIn logo
LinkedIn
Medium
Software Engineer

Minimize adjacent-color assignment cost

Minimize adjacent-color assignment cost You are given H linear items (e.g., houses) and an H×C cost matrix where cost[i][c] is the cost of assigning c...

Coding & Algorithms
4
0
82 people solved
Aug 10, 2025
Akuna Capital logo
Akuna Capital
Medium
Software Engineer

Solve three C++ algorithmic tasks

Solve three C++ algorithmic tasks Solve the following three C++ algorithmic tasks. For each, implement an efficient function and state time and space ...

Coding & Algorithms
4
0
56 people solved
Aug 10, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find odd-frequency element with O(1) space

You're given an integer array where exactly one value appears an odd number of times and all other values appear an even number of times. Implement a ...

Coding & Algorithms
4
0
35 people solved
Aug 9, 2025
DRW logo
DRW
Medium
Data Scientist

Compute rolling standard deviation in O(n)

Compute rolling standard deviation in O(n) Given an array of numbers and a window size k, compute the rolling standard deviation for every contiguous ...

Coding & Algorithms
6
0
74 people solved
Aug 9, 2025
Meta logo
Meta
Medium
Software Engineer

Solve array merge and tree flattening problems

Solve array merge and tree flattening problems 1) Given two sorted arrays, merge them into a single sorted array. Provide both an in-place approach (w...

Coding & Algorithms
1
0
33 people solved
Aug 9, 2025
Meta logo
Meta
Medium
Software Engineer

Maintain top N payers

Maintain top N payers Implement topNPayers(n) that returns the n accounts with the highest cumulative outgoing payment amounts as strings formatted "{...

Coding & Algorithms
1
0
25 people solved
Aug 9, 2025
SIG (Susquehanna) logo
SIG (Susquehanna)
Medium
Software Engineer

Count subarrays with odd zero count

Count subarrays with odd zero count Given an integer array nums, return how many contiguous subarrays contain an odd number of zeros. Provide an O(n) ...

Coding & Algorithms
4
0
84 people solved
Aug 8, 2025
Apple logo
Apple
Medium
Software Engineer

Design a snapshotable key-value store

Design a snapshotable key-value store Design and implement a snapshotable key–value map supporting the following APIs: - S(key, value): set the curren...

Coding & Algorithms
11
0
131 people solved
Aug 8, 2025
Amazon logo
Amazon
Medium
Software Engineer

Count expressions reaching a target sum

Count expressions reaching a target sum Given an array of non-negative integers nums and an integer target T, assign either a + or − sign to each numb...

Coding & Algorithms
1
0
37 people solved
Aug 8, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Fix a BST with two misplaced keys

Fix a BST with two misplaced keys You are given the root of a binary search tree in which exactly two nodes’ keys were accidentally swapped. Restore t...

Coding & Algorithms
3
0
26 people solved
Aug 8, 2025
Verkada logo
Verkada
Medium
Software Engineer

Find users with access to all cameras

Given entities and relationships (user, owns, camera), (user, belongs_to, group), (group, owns, camera), and (group, belongs_to, group) where groups c...

Coding & Algorithms
7
0
66 people solved
Aug 8, 2025
xAI logo
xAI
Medium
Software Engineer

Weighted LRU Cache: Capacity Counted by Item Quantity

Design a variant of the classic least-recently-used (LRU) cache. In the classic version, the capacity limits the number of items stored. In this varia...

Coding & Algorithms
1
0
9 people solved
Aug 7, 2025
dYdX logo
dYdX
Medium
Software Engineer

Solve shortest and label-similar paths

Solve shortest and label-similar paths Part A — Unweighted shortest path: You are given an undirected, unweighted graph with vertices labeled 0..n-1 a...

Coding & Algorithms
3
0
24 people solved
Aug 7, 2025
Amazon logo
Amazon
Medium
Software Engineer

Compute optimal locker placement with obstacles

Compute optimal locker placement with obstacles Given house coordinates H = {(xi, yi)} and tree coordinates T = {(xj, yj)} on a 2D integer grid, choos...

Coding & Algorithms
4
0
31 people solved
Aug 7, 2025
Amazon logo
Amazon
Medium
Software Engineer

Design a streaming median structure

Design a streaming median structure Design a data structure for a number stream that supports: add(num: int) in O(log n) time and median() -> float in...

Coding & Algorithms
2
0
33 people solved
Aug 7, 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