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

Solve parsing, counting, ranges, and window problems

Solve the following four algorithm problems: 1) Expression evaluator with + and : Given a string s containing non-negative integers, '+' and '' operat...

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

Compute shortest path between tree nodes

Question You are given the root of a binary tree (not necessarily a BST) whose nodes have integer values, and two target values u and v. Implement a f...

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

Reverse sublist between equal-value nodes

Given the head of a singly linked list and a target value v that appears at least twice, reverse the sublist starting at the first node with value v a...

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

Count subarrays summing to target

Given an integer array nums and an integer target T, return the number of contiguous subarrays whose sum equals T. Provide an algorithm that runs in l...

Coding & Algorithms
3
0
33 people solved
Sep 6, 2025
OpenAI logo
OpenAI
Medium
Software Engineer

Implement compile-time function type verification

Implement a C++20 compile-time utility to verify whether a callable matches a target function type. Requirements: create a primary template is_callabl...

Coding & Algorithms
11
0
212 people solved
Sep 6, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Maximize reward by scheduling jobs

Given n jobs, each with a start time, end time, and reward, choose a subset of non-overlapping jobs to maximize total reward. Return the maximum rewar...

Coding & Algorithms
24
1
163 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Return k smallest elements using heap

Given an unsorted array nums of up to 1,000,000 integers and an integer k (1 <= k <= nums.length), return the k smallest elements in ascending order. ...

Coding & Algorithms
5
0
46 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Maximize one stock trade profit

You're given an array prices of length n where prices[i] is the stock price on day i. You may complete at most one transaction (buy once, then sell la...

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

Compute reachability and minimal-time same-type scheduling

1) Given four integers a, b, c, d (1 <= a, b, c, d <= 1000), you may perform the following operations any number of times and in any order: (a, b) -> ...

Coding & Algorithms
4
0
28 people solved
Sep 6, 2025
Bloomberg logo
Bloomberg
Medium
Software Engineer

Find root from child adjacency lists

You're given an unordered list describing a rooted n-ary tree. Each item is a record of the form {id: int, children: set<int>} listing a node's direct...

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

Implement a nested key-value store

Design and implement a nested key–value store that supports set(path, value), get(path), and delete(path), where path is dot-delimited (e.g., "a.b.c")...

Coding & Algorithms
10
0
154 people solved
Sep 6, 2025
MathWorks logo
MathWorks
Medium
Software Engineer

Compute intersections for each segment

You are given $n$ segments on a number line. Segment $i$ is the closed interval $[\text{startsAt}[i], \text{endsAt}[i]]$ (inclusive endpoints), with $...

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

Solve sliding window and tree BFS problems

1) Sliding window: Given an array of positive integers nums and an integer target, return the minimal length of a contiguous subarray whose sum is at ...

Coding & Algorithms
2
0
30 people solved
Sep 6, 2025
Uber logo
Uber
Medium
Software Engineer

Count subarrays with at least k fruit pairs

Given an integer array nums where each value denotes a fruit type, and an integer k: For any subarray, define a 'pair' for fruit value v if its freque...

Coding & Algorithms
9
0
77 people solved
Sep 6, 2025
Qube Research & Technologies logo
Qube Research & Technologies
Medium
Software Engineer

Implement flat_map and design wealth redistribution

Part 1 — Implement a flat_map: Design and implement an associative container flat_map backed by a sorted dynamic array of (Key, Value) pairs. Support ...

Coding & Algorithms
7
0
59 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Solve grid path and robot navigation

Part A — Shortest path in a grid with obstacles: Given an m×n grid of 0/1 cells (0 = open, 1 = obstacle), start at (0, 0) and end at (m−1,n− 1). You m...

Coding & Algorithms
4
0
34 people solved
Sep 6, 2025
WeRide logo
WeRide
Medium
Software Engineer

Implement expression expansion to plus-only form

Given a string expression consisting only of lowercase letters (variables), '+', '*', '(', and ')', return an equivalent expression that uses only '+'...

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

Implement Luhn-based card validation and inference

Question Implement a set of utilities for credit-card validation and inference using the Luhn checksum algorithm and standard brand patterns. Brand pa...

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

Calculate trapped water between elevation bars

Given an array of non-negative integers representing the heights of unit-width vertical bars, compute the total water retained after rainfall. Start b...

Coding & Algorithms
13
0
119 people solved
Sep 6, 2025
Stripe logo
Stripe
Medium
Software Engineer

Implement multi-network card validator with Luhn

Design and implement a payment card validation module that supports multiple networks and error scenarios. Requirements: 1) Luhn checksum - Implement ...

Coding & Algorithms
1
0
14 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