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

Solve a Skyscraper puzzle efficiently

Design and implement a solver for the Skyscraper logic puzzle on an $N \times N$ grid, where $3 \le N \le 7$. The board is a grid of building heights....

Coding & Algorithms
47
0
329 people solved
Sep 6, 2025
Pinterest logo
Pinterest
Medium
Software Engineer

Cross-reference logs to flag spam numbers

You are given two data sets: ( 1) a call log containing phone numbers observed in calls and ( 2) a list of user reports where each entry is a phone nu...

Coding & Algorithms
7
0
130 people solved
Sep 6, 2025
Reddit logo
Reddit
Medium
Software Engineer

Find word sequence with 1–2 char changes

Given a beginWord, an endWord, and a dictionary (wordList) of unique same-length lowercase words, determine whether there exists a transformation sequ...

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

Convert BST to sorted doubly list

Convert a binary search tree into a sorted doubly linked list in-place. Reuse the existing tree nodes: the left pointer becomes prev and the right poi...

Coding & Algorithms
3
0
32 people solved
Sep 6, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Compute height after deletions; enumerate valid delete sets

Warm-up: You are given a rooted binary tree with unique node ids and a list of ids to delete. When a node is deleted, promote all of its children to b...

Coding & Algorithms
16
0
116 people solved
Sep 6, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Filter hierarchical paths after deletions

Given two arrays: ( 1) paths — slash-delimited hierarchical strings such as "California", "California/San Francisco", "California/San Francisco/7th St...

Coding & Algorithms
13
0
91 people solved
Sep 6, 2025
xAI logo
xAI
Medium
Machine Learning Engineer

Design O(1) random-sampling set

Design a data structure that supports insert(x), remove(x), and get_random() that returns a uniformly random element among the present items, all in e...

Coding & Algorithms
18
0
143 people solved
Sep 6, 2025
Bloomberg logo
Bloomberg
Medium
Software Engineer

Check near-palindrome with one deletion

Given a string s, determine if it can become a palindrome after deleting at most one character. Return true or false and provide time and space comple...

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

Design Manhattan-distance meeting point finder

Given an m×n grid with cells marked 1 for homes and 0 otherwise, choose a single meeting cell that minimizes the sum of Manhattan distances from all h...

Coding & Algorithms
5
0
49 people solved
Sep 6, 2025
Uber logo
Uber
Medium
Software Engineer

Sort by squares and find k-th smallest

Given a nondecreasing sorted array of integers nums, do the following: 1) Reorder the original elements by increasing square value (equivalently, by a...

Coding & Algorithms
9
0
73 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Solve BST range average and merge intervals

1) Given a binary search tree and an inclusive range [L, R], compute both the sum and the average of all node values where L <= val <= R. Use the BST ...

Coding & Algorithms
5
0
52 people solved
Sep 6, 2025
UiPath logo
UiPath
Medium
Software Engineer

Compute longest distinct substring, case-insensitive

Given a string s, return the length of the longest contiguous substring that contains no repeated characters, treating letters case-insensitively (e.g...

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

Simulate stack traces from logs

Given a list of log entries describing function calls, each formatted as "<id> <event> <timestamp>" where event ∈ {START, END} and timestamps are inte...

Coding & Algorithms
51
0
471 people solved
Sep 6, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Implement a recency-eviction bounded cache

Implement an in-memory key–value store with a fixed capacity N that uses recency-based eviction. Support: get(key) -> value or -1 if missing, and put(...

Coding & Algorithms
16
1
211 people solved
Sep 6, 2025
Apple logo
Apple
Medium
Software Engineer

Sort and merge string lists by length

Given two unsorted lists of strings, return a single list sorted by ascending string length. Specify your tie-breaking rule for equal-length strings (...

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

Design a parser for a hypothetical language

You are given a set of syntax rules for a hypothetical programming language written in BNF/EBNF. Design data structures and algorithms that: ( 1) pars...

Coding & Algorithms
50
0
424 people solved
Sep 6, 2025
Samsung logo
Samsung
Medium
Machine Learning Engineer

Validate palindrome with constraints

Given a string s, return true if s reads the same forward and backward after removing all non-alphanumeric characters and ignoring letter case. Implem...

Coding & Algorithms
4
0
33 people solved
Sep 6, 2025
Google logo
Google
Medium
Software Engineer

Optimize 0/1 to bounded knapsack DP

Solve the 0/1 knapsack problem: given arrays weight[i], value[i] for i=0..n-1 and capacity W, return the maximum value and reconstruct one optimal set...

Coding & Algorithms
5
0
89 people solved
Sep 6, 2025
Two Sigma logo
Two Sigma
Medium
Machine Learning Engineer

Solve tree partition and IPO allocation

1) Tree partitioning for minimum difference: Given a rooted tree as an array parent of length n (parent[i] gives the parent of node i, and parent[root...

Coding & Algorithms
5
0
72 people solved
Sep 6, 2025
Rippling logo
Rippling
Medium
Software Engineer

Compute maximum simultaneous drivers

Given N driver online intervals [start_time, end_time) during a day, compute the maximum number of drivers simultaneously online at any moment. Handle...

Coding & Algorithms
11
0
140 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