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

Implement Trie search with wildcard matching

Design a text dictionary using a Trie. Support the following operations: - addWord(word): Insert a lowercase English word. - search(pattern): Return t...

Coding & Algorithms
5
0
71 people solved
Sep 1, 2025
HubSpot logo
HubSpot
Medium
Software Engineer

Find spammer with minimal hasMessaged calls

Question You have n accounts labeled 0..n-1 and an oracle API: ` boolean hasMessaged(a, b) // true iff account a has sent at least one message to ac...

Coding & Algorithms
16
0
148 people solved
Aug 14, 2025
Anthropic logo
Anthropic
Medium
Machine Learning Engineer

Implement an extensible prefix tree

Implement a prefix tree (trie) supporting insert(word), search(word), startsWith(prefix), countPrefix(prefix), and erase(word). Optimize for time and ...

Coding & Algorithms
44
0
317 people solved
Aug 14, 2025
Meta logo
Meta
Medium
Software Engineer

Implement sparse vector dot product

Question Design a SparseVector class for vectors of integers in which most entries are zero, and support an efficient dot product between two such vec...

Coding & Algorithms
2
0
39 people solved
Aug 14, 2025
Meta logo
Meta
Medium
Software Engineer

Compute BST range sum

Given the root of a binary search tree and two integers low and high (inclusive), compute the sum of values of all nodes with low <= val <= high. Prov...

Coding & Algorithms
3
0
29 people solved
Aug 14, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Evaluate arithmetic expression with variables

Implement an expression evaluator for a string expr containing non-negative integers, variables (alphabetic names), operators +, -, , /, parentheses '...

Coding & Algorithms
4
0
79 people solved
Aug 14, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Compute task order with prerequisites

Given an integer n representing tasks labeled 0..n-1 and a list of prerequisite pairs (a, b) meaning b must be completed before a, return any valid or...

Coding & Algorithms
9
0
80 people solved
Aug 14, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Maximize profit with bounded sell window

Given an array prices[0..n-1] of daily stock prices and an integer D ≥ 1, you may perform at most one transaction (buy then sell). The sell day j must...

Coding & Algorithms
9
0
64 people solved
Aug 14, 2025
Optiver logo
Optiver
Medium
Software Engineer

Decide and implement DP/heap and approximation

You have 90 minutes to complete three related coding tasks: a) Dynamic programming: Given an integer array nums (n ≤ 2e 5) and a threshold T, design a...

Coding & Algorithms
22
0
167 people solved
Aug 13, 2025
Snapchat logo
Snapchat
Medium
Machine Learning Engineer

Find nearest room; extend to two users

You are given an m×n grid where 1 is a wall (impassable), 0 is an empty cell, and 2 is a meeting room. From a starting coordinate [r, c], you may move...

Coding & Algorithms
2
0
44 people solved
Aug 13, 2025
Amazon logo
Amazon
Medium
Software Engineer

Compute product excluding index without division

Given an integer array nums, return an array ans where ans[i] equals the product of all elements of nums except nums[i], without using division. Achie...

Coding & Algorithms
4
0
37 people solved
Aug 13, 2025
Amazon logo
Amazon
Medium
Software Engineer

Implement tree left/right views via BFS and DFS

Given a binary tree, output the left view and right view: for each depth, the first node visible from the left and the first node visible from the rig...

Coding & Algorithms
1
0
32 people solved
Aug 13, 2025
TikTok logo
TikTok
Medium
Software Engineer

Solve array and tree algorithm challenges

Solve the following three algorithmic tasks: 1) Unique triplet sum: Given an integer array nums and an integer target (default 0), return all unique t...

Coding & Algorithms
4
0
38 people solved
Aug 13, 2025
Meta logo
Meta
Medium
Software Engineer

Solve windowed duplicates and target expression

1) Windowed duplicate check: Given an integer array nums and an integer k, determine whether there exist indices i and j such that nums[i] == nums[j] ...

Coding & Algorithms
2
0
31 people solved
Aug 13, 2025
Snapchat logo
Snapchat
Medium
Software Engineer

Count islands with eight-direction adjacency

You are given an m×n grid of characters '1' (land) and '0' (water). Count the number of islands, where cells are connected if they touch in any of the...

Coding & Algorithms
2
0
39 people solved
Aug 13, 2025
Amazon logo
Amazon
Medium
Software Engineer

Maximize equal values via one subarray shift

Given an integer array A of length n, you may perform at most one operation: choose any contiguous subarray A[l..r] and add an integer Δ (which may be...

Coding & Algorithms
3
0
32 people solved
Aug 13, 2025
Amazon logo
Amazon
Medium
Software Engineer

Maximize points with limited coworker skips

You and a coworker must unload a sequence of warehouses. For warehouse i there are c[i] items (non‑negative integers). Turns alternate starting with y...

Coding & Algorithms
3
0
44 people solved
Aug 13, 2025
Flexport logo
Flexport
Medium
Software Engineer

Validate and restore IPv4 addresses

Design and implement the following IPv4 tasks. a) Validate dotted IPv4: Write a function isValidIPv4 (s) that returns true if s is a valid dotted-deci...

Coding & Algorithms
5
0
49 people solved
Aug 13, 2025
TikTok logo
TikTok
Medium
Software Engineer

Solve four algorithm design tasks

Solve the following four algorithmic tasks: 1) Implement wildcard pattern matcher: Given a text s and a pattern p where '?' matches any single charact...

Coding & Algorithms
5
0
62 people solved
Aug 13, 2025
IXL Learning logo
IXL Learning
Medium
Software Engineer

Find value on most distinct levels

Given a binary tree whose nodes store values (e.g., characters), find the value that appears on the greatest number of distinct depth levels. For exam...

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