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

Guide a mouse to find cheese with APIs

This question evaluates the ability to reason about graph exploration and stateful API interaction in an unknown 2D grid, assessing competencies in se...

Coding & Algorithms
3
0
45 people solved
Nov 12, 2025
Apple logo
Apple
Medium
Machine Learning Engineer

Rotate a Matrix In Place

Given an n x n matrix of integers, rotate the matrix 90 degrees clockwise. Implement the function in Python. You may use a straightforward approach wi...

Coding & Algorithms
0
0
8 people solved
Nov 11, 2025
Uber logo
Uber
Hard
Software Engineer

Implement three interview-style coding tasks

You are given three separate coding tasks, all focused on algorithm and data-structure design. --- Task 1: Longest Bounded-Difference Subarray You are...

Coding & Algorithms
15
0
132 people solved
Nov 11, 2025
Meta logo
Meta
Medium
Software Engineer

Determine if subarray sums to target

You are given an array of non-negative integers and a non-negative integer target. Determine whether there exists a contiguous subarray (continuous se...

Coding & Algorithms
7
0
59 people solved
Nov 11, 2025
Ripple logo
Ripple
Hard
Software Engineer

Find path between two nodes in a binary tree

Problem Given a binary tree and two target nodes a and b, return the simple path from a to b (inclusive) as an ordered list of node values. - The path...

Coding & Algorithms
5
0
45 people solved
Nov 10, 2025
Molocoads logo
Molocoads
Hard
Software Engineer

Find single element when others repeat k times

You are given a sorted array of integers nums in non-decreasing order, and an integer k ≥ 2. Every value in nums appears exactly k times in a row, exc...

Coding & Algorithms
6
0
49 people solved
Nov 9, 2025
Molocoads logo
Molocoads
Hard
Software Engineer

Compute subarray span for each element

You are given an integer array nums of length n. For each index i (0 <= i < n), define ans[i] as the maximum possible length of a contiguous subarray ...

Coding & Algorithms
6
0
57 people solved
Nov 9, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Design an in-memory database with TTL and backups

You are asked to implement a small in-memory “database” that evolves across 4 parts. In each part you may reuse your previous code and only add/extend...

Coding & Algorithms
32
0
288 people solved
Nov 8, 2025
DoorDash logo
DoorDash
Hard
Software Engineer

Find longest common ordered restaurant list

You have two delivery drivers who each have a pickup plan represented as a list of restaurant IDs (strings). Because there is only one car, the combin...

Coding & Algorithms
26
0
197 people solved
Nov 7, 2025
Squarepoint logo
Squarepoint
Hard
Data Scientist

Maximize profit from one or many stock trades

You are given an integer array prices where prices[i] is the price of a stock on day i (0-indexed). Answer the following two subproblems: 1. Single tr...

Coding & Algorithms
2
0
37 people solved
Nov 7, 2025
Hopper logo
Hopper
Medium
Software Engineer

How would you sort filenames with numeric segments?

You are given a list of filename strings (e.g., "file10.txt", "file2.txt", "10file.txt"). Implement a custom sort for these strings using a comparator...

Coding & Algorithms
5
0
40 people solved
Nov 6, 2025
Oracle logo
Oracle
Medium
Software Engineer

Implement an LRU cache

Design and implement an in-memory cache that evicts entries using the Least Recently Used (LRU) policy. The cache should store key–value pairs and sup...

Coding & Algorithms
3
0
41 people solved
Nov 6, 2025
Purestorage logo
Purestorage
Medium
Software Engineer

Determine whether points form squares

Problem: Square detection and counting from point coordinates You are given points on a 2D plane with integer coordinates. Part A — Validate a single ...

Coding & Algorithms
7
0
90 people solved
Nov 5, 2025
Google logo
Google
Medium
Software Engineer

Compute servers needed for daily recurring jobs

You operate a cluster of identical servers that run recurring daily jobs. For a single day, you are given a list of job execution intervals. Each inte...

Coding & Algorithms
15
0
144 people solved
Nov 5, 2025
Google logo
Google
Medium
Software Engineer

Minimize calls to find all bad test pairs

You have \(n\) atomic tests \(t_1, t_2, \dots, t_n\). You are given access to a black-box function: `python bool runTest(set<Test> S) ` which behaves ...

Coding & Algorithms
13
0
140 people solved
Nov 5, 2025
Google logo
Google
Medium
Software Engineer

Find shared objects across two log files

You are given two large log files representing activity on two different days. Each line of each log has three fields: - timestamp: a time value (you ...

Coding & Algorithms
6
0
79 people solved
Nov 5, 2025
Read.Ai logo
Read.Ai
Medium
Software Engineer

Implement a per-user API rate limiter

You are building an API gateway that must enforce per-user rate limits. Task Implement a rate limiter with the following API: - RateLimiter(int maxReq...

Coding & Algorithms
7
0
61 people solved
Nov 3, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Find shortest substring with n unique letters

Problem You are given a string s consisting of lowercase English letters and an integer n (1 ≤ n ≤ 26). Find the length of the shortest contiguous sub...

Coding & Algorithms
5
0
46 people solved
Nov 3, 2025
Stripe logo
Stripe
Medium
Software Engineer Locked

Process multi-currency payments with fees

This question evaluates a software engineer's competency in precise integer arithmetic and rounding semantics, multi-currency FX conversion with basis...

Coding & Algorithms
3
0
35 people solved
Nov 2, 2025
Meta logo
Meta
Medium
Software Engineer

Find K-th Largest and Longest Vacation

Solve the following two coding problems. 1. Find the k-th largest element Given an integer array nums and an integer k, return the element that wou...

Coding & Algorithms
3
0
29 people solved
Nov 1, 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