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

Minimum Character Changes to Make Every k-Length Block a Palindrome

Minimum Character Changes to Make Every k-Length Block a Palindrome You are given a password string and an integer k. The length of password is guaran...

Coding & Algorithms
0
0
13 people solved
Mar 11, 2026
xAI logo
xAI
Medium
Software Engineer

Explain arrays and memory layout

What is an array? How is an array represented in memory (contiguous layout, element size and alignment, indexing arithmetic). Analyze time complexitie...

Coding & Algorithms
10
0
90 people solved
Aug 12, 2025
Remitly logo
Remitly
Easy
Software Engineer

Compute transfers to balance account debts

Problem: Balance accounts by generating transfers You are given a dictionary/map balances from accountId -> netBalance. - A positive balance means the...

Coding & Algorithms
6
0
82 people solved
Nov 30, 2025
Adobe logo
Adobe
Medium
Software Engineer

Maximize pay by flipping k rest days

Given integers BasePay and Bonus, a binary string schedule of length n where '1' means work and '0' means rest, and an integer k, you may change up to...

Coding & Algorithms
13
1
97 people solved
Sep 6, 2025
Anthropic logo
Anthropic
Medium
Machine Learning Engineer

Convert stack samples to execution trace

You are given sampling-profiler output: a list of Sample objects ordered by timestamp ascending. Each Sample has (t: float, stack: list[str]) where st...

Coding & Algorithms
53
0
856 people solved
Sep 6, 2025
OpenAI logo
OpenAI
Medium
Software Engineer

Simulate turn-based monster team battle

Design an object-oriented model and implement the core battle logic for a turn-based fight between two teams of monsters. The system should simulate t...

Coding & Algorithms
135
1
1099 people solved
Oct 30, 2025
ZipHQ logo
ZipHQ
Medium
Software Engineer

Find flush and straight groups in cards

You are given an array of strings cards, where each string represents a distinct playing card. Each card string has the format <rank><suit>: - rank is...

Coding & Algorithms
43
0
303 people solved
Nov 28, 2025
Bytedance logo
Bytedance
Hard
Site Reliability Engineer

Place Non-Attacking Queens

Given an integer n, return all valid configurations for placing n queens on an n x n chessboard so that no two queens attack each other. A queen attac...

Coding & Algorithms
0
0
9 people solved
Apr 19, 2026
Uber logo
Uber
Medium
Software Engineer Locked

Solve BST and Grid Query Problems

This question evaluates understanding of binary search tree order-statistics and grid reachability under threshold constraints, testing competencies i...

Coding & Algorithms
5
0
42 people solved
Apr 19, 2026
OpenAI logo
OpenAI
Medium
Machine Learning Engineer Locked

Track Expiring GPU Credits

This question evaluates event-replay and time-window accounting skills, including temporal data structures, priority-based consumption, out-of-order e...

Coding & Algorithms
16
0
142 people solved
Mar 9, 2026
OpenAI logo
OpenAI
Medium
Machine Learning Engineer Locked

Simulate Turn-Based Monster Battles

This question evaluates the ability to implement a turn-based battle simulation with correct state management, turn semantics, knockout handling, dama...

Coding & Algorithms
14
0
116 people solved
Mar 9, 2026
LinkedIn logo
LinkedIn
Medium
Software Engineer

Design a max-stack with efficient operations

Design a max-stack with efficient operations Design a stack that supports push (x), pop(), top(), peekMax(), and popMax(). The popMax operation must r...

Coding & Algorithms
8
0
71 people solved
Aug 8, 2025
Pinterest logo
Pinterest
Medium
Machine Learning Engineer Locked

Solve five hard algorithm problems

This set of problems evaluates algorithm design and problem-solving skills across array manipulation, range-update techniques, load-balancing and part...

Coding & Algorithms
6
0
87 people solved
Mar 8, 2026
OpenAI logo
OpenAI
Hard
Software Engineer

Implement a persistent sharded key-value store

Problem Implement a simple key–value store that persists data on disk. You must store the data in fixed-size shards, where each shard is saved in one ...

Coding & Algorithms
79
1
1003 people solved
Nov 24, 2025
Citadel logo
Citadel
Medium
Software Engineer

Compute max team size with a core interval

You are given n employees’ working-time intervals, where employee i works during the inclusive interval [startTime[i], endTime[i]]. You want to form a...

Coding & Algorithms
14
0
186 people solved
Dec 25, 2025
xAI logo
xAI
Hard
Machine Learning Engineer Locked

Implement Distributed Matrix Multiplication

This question evaluates distributed systems and parallel algorithm skills, specifically distributed matrix multiplication, data partitioning (row- and...

Coding & Algorithms
5
0
51 people solved
Jan 28, 2026
Intuit logo
Intuit
Easy
Software Engineer Locked

Add One to Digit Array

This question evaluates proficiency in array manipulation and elementary arithmetic on digit sequences, specifically carrying operations and edge-case...

Coding & Algorithms
1
2
21 people solved
Jun 5, 2026
Amazon logo
Amazon
Hard
Software Engineer Locked

Implement Datacenter Router Commands

This question evaluates proficiency in stateful command processing, input validation, geospatial computation (Haversine distance), deterministic sorti...

Coding & Algorithms
2
0
16 people solved
Jun 5, 2026
LinkedIn logo
LinkedIn
Medium
Software Engineer

Merge two N-ary trees by key rules

You are given two N-ary trees A and B. Each node has: - key (string): unique among siblings (i.e., within a node’s children list, no two children shar...

Coding & Algorithms
40
0
279 people solved
Nov 21, 2025
Oracle logo
Oracle
Medium
Software Engineer

Return a valid course completion order

You are given an integer n representing n courses labeled 0..n-1 and a list of prerequisite pairs prerequisites, where each pair [a, b] means you must...

Coding & Algorithms
11
0
98 people solved
Jan 26, 2026

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