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

Implement a Database Connection Pool

This question evaluates skills in concurrent resource management, synchronization primitives, and robust connection lifecycle handling within database...

Coding & Algorithms
20
0
180 people solved
Feb 25, 2026
Uber logo
Uber
Medium
Software Engineer

Find Kth Smallest in BST

You are given the root of a binary search tree and an integer k. Return the value of the node that would appear in the kth position if all node values...

Coding & Algorithms
3
0
49 people solved
Feb 25, 2026
Microsoft logo
Microsoft
Medium
Data Scientist

Traverse an Org Chart by Level

You are given an organization's reporting structure as a flat list of employee-manager relationships. Exactly one employee is the root (the CEO) and h...

Coding & Algorithms
15
1
138 people solved
Feb 25, 2026
Amplitude logo
Amplitude
Medium
Software Engineer

Swap kth-from-end node with head

Given the head of a singly linked list and an integer k, swap the k-th node from the end with the head node, using O(1) extra memory. Requirements: - ...

Coding & Algorithms
2
0
32 people solved
Feb 25, 2026
Amplitude logo
Amplitude
Medium
Software Engineer

Implement lossless dictionary encoding and decoding

Dictionary encoding is a lossless compression technique for a list of tokens. You are given an input string consisting of words separated by commas, e...

Coding & Algorithms
3
0
60 people solved
Feb 25, 2026
Pinterest logo
Pinterest
Medium
Software Engineer Locked

Find First Prefix-Matching Word

This question evaluates proficiency in string processing and prefix-matching within arrays, testing the ability to identify the first occurrence and h...

Coding & Algorithms
9
0
74 people solved
Feb 24, 2026
Google logo
Google
Medium
Software EngineerNew Grad

Implement an LRU cache

Design a key-value cache with a fixed capacity. It must support: - get(key): return the value for the key if it exists, otherwise return -1. - put(key...

Coding & Algorithms
3
0
40 people solved
Feb 24, 2026
Dark Alpha Capital logo
Dark Alpha Capital
Medium
Software Engineer

Minimize Total Assignment Distance

You are given the coordinates of n analysts and m field devices on a 2D grid, where 1 <= n <= 10 and n <= m <= 15. Each analyst must be assigned exact...

Coding & Algorithms
1
0
25 people solved
Feb 24, 2026
Microsoft logo
Microsoft
Medium
Machine Learning Engineer Locked

Implement cache and merge intervals

This question evaluates proficiency in designing and implementing efficient data structures (a fixed-capacity LRU key-value cache) and interval-proces...

Coding & Algorithms
3
0
33 people solved
Feb 23, 2026
Microsoft logo
Microsoft
Medium
Software Engineer Locked

Implement Matrix Move and Logger

This question evaluates array manipulation and in-place algorithm design for handling overlapping submatrix moves, along with data-structure and time-...

Coding & Algorithms
4
0
41 people solved
Feb 22, 2026
Ixl logo
Ixl
Hard
Software EngineerNew Grad Locked

Maintain a Stream Median

This question evaluates the ability to design and implement efficient online data structures and algorithms for maintaining dynamic order statistics a...

Coding & Algorithms
2
0
23 people solved
Feb 22, 2026
Confluent logo
Confluent
Medium
Software EngineerSenior+

Solve Signature, File, and Queue Problems

Solve the following interview-style problems: 1. Function signature matching You are given a registry of function definitions. Each function has an...

Coding & Algorithms
5
0
48 people solved
Feb 22, 2026
Google logo
Google
Medium
Software Engineer

Determine Reporting Relationships

Build an in-memory organization model that supports three operations on employee IDs: 1. add_manager(a, b): employee a is the direct manager of employ...

Coding & Algorithms
3
0
39 people solved
Feb 22, 2026
Microsoft logo
Microsoft
Medium
Software Engineer Locked

Implement Calendar, Tokenizer, and Meeting Optimizer

This question evaluates competencies in interval scheduling and overlap detection, custom string tokenization and parsing rules, and combinatorial opt...

Coding & Algorithms
4
0
76 people solved
Feb 22, 2026
Mavenclinic logo
Mavenclinic
Medium
Software Engineer Locked

Solve two interview coding problems

This question evaluates graph traversal and pathfinding with weighted edge composition for currency conversion reachability, and sequence partitioning...

Coding & Algorithms
2
0
34 people solved
Feb 22, 2026
Meta logo
Meta
Medium
Software Engineer

Find Kth Largest and Tree Ancestors

In a technical phone interview, the candidate was asked two coding problems in the same round: 1. K-th largest element in an array Given an unsor...

Coding & Algorithms
3
0
56 people solved
Feb 22, 2026
Anthropic logo
Anthropic
Hard
Software Engineer

Find Duplicate Files by Content

You are given a list of directory descriptions. Each description has the following format: root_directory file_name_1(content_1) file_name_2(content_2...

Coding & Algorithms
0
0
3 people solved
Feb 21, 2026
Pinterest logo
Pinterest
Medium
Machine Learning EngineerSenior+ Locked

Solve Expression and Tree-List Problems

This question evaluates competency in string expression generation under a custom left-to-right evaluation rule and in-place binary search tree manipu...

Coding & Algorithms
15
0
108 people solved
Feb 21, 2026
Disney logo
Disney
Medium
Data Engineer

Generate All Well-Formed Parenthesis Strings

A string of parentheses is called well-formed if every opening bracket ( has a matching closing bracket ) and the brackets are correctly nested. For e...

Coding & Algorithms
0
0
5 people solved
Feb 20, 2026
Palo logo
Palo
Medium
Software Engineer

Find Maximum Rectangle in Bar Chart

Given an array heights of n non-negative integers, where each value represents the height of a vertical bar in a bar chart and every bar has width 1, ...

Coding & Algorithms
1
0
15 people solved
Feb 20, 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