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

Count Clusters of 2D Points Within a Radius

This question tests graph traversal skills, specifically identifying connected components among a set of 2D points using distance-based adjacency. It ...

Coding & Algorithms
3
1
14 people solved
Jun 18, 2026
Amazon logo
Amazon
Medium
Machine Learning Engineer Locked

Implement Multi-Head Attention from Scratch in NumPy

This coding question tests a machine learning engineer's understanding of Transformer internals by requiring a from-scratch NumPy implementation of mu...

Coding & Algorithms
1
0
4 people solved
Jun 18, 2026
Walmart logo
Walmart
Medium
Software Engineer Locked

Minimize Cost for Feature-Capable Models

This question evaluates algorithmic problem-solving and combinatorial optimization skills related to selecting cost-minimal subsets that satisfy dual ...

Coding & Algorithms
0
0
4 people solved
Jun 18, 2026
Salesforce logo
Salesforce
Medium
Software Engineer Locked

Minimum Sum of Weekly Maximum Costs

This question tests dynamic programming skills applied to array partitioning, specifically minimizing an objective function over contiguous subarrays....

Coding & Algorithms
0
0
5 people solved
Jun 17, 2026
Amazon logo
Amazon
Medium
Software EngineerNew Grad Locked

Caesar Cipher with Translation-Table Optimization

This question tests practical string manipulation and modular arithmetic by requiring implementation of a classic Caesar cipher with correct case-pres...

Coding & Algorithms
2
0
11 people solved
Jun 15, 2026
Amazon logo
Amazon
Medium
Machine Learning EngineerSenior+ Locked

Highest Average-Salary Team in an Org Chart

This question evaluates a candidate's ability to traverse tree-structured data and perform subtree aggregation, applying recursive or bottom-up DFS te...

Coding & Algorithms
0
0
4 people solved
Jun 14, 2026
Amazon logo
Amazon
Medium
Machine Learning EngineerSenior+ Locked

Merge Overlapping Time Ranges

This question evaluates a candidate's ability to work with interval merging, a core array and sorting problem in technical interviews. It tests unders...

Coding & Algorithms
0
0
5 people solved
Jun 14, 2026
Amazon logo
Amazon
Medium
Software Engineer Locked

Course Prerequisite Feasibility

This question tests graph theory fundamentals, specifically cycle detection in directed graphs as modeled by dependency constraints. It evaluates prac...

Coding & Algorithms
0
0
4 people solved
Jun 13, 2026
Snowflake logo
Snowflake
Medium
Software Engineer Locked

Determine Whether an Undirected Graph Is 3-Colorable

Determine whether a possibly disconnected undirected graph with up to 20 vertices can be colored using at most three colors so that adjacent vertices ...

Coding & Algorithms
3
0
22 people solved
Jun 12, 2026
Harvey logo
Harvey
Medium
Software Engineer Locked

Spreadsheet Formula Engine with Cycle Detection

This question evaluates a candidate's ability to design a stateful data structure that models dependency relationships and lazily propagates updates, ...

Coding & Algorithms
0
0
6 people solved
Jun 12, 2026
Google logo
Google
Medium
Software Engineer Locked

Find the Longest Path of Equal-Valued Tree Nodes

Find the longest path of equal-valued nodes in a binary tree encoded as a breadth-first list. Clarify the ambiguity with strict BST terminology, then ...

Coding & Algorithms
2
0
3 people solved
Jun 11, 2026
Omnissa logo
Omnissa
Medium
Software Engineer Locked

Repeatedly Remove Adjacent Equal Characters

This question evaluates a candidate's ability to use a stack-based approach to repeatedly cancel out adjacent equal elements in a string. It tests und...

Coding & Algorithms
0
0
4 people solved
Jun 11, 2026
Omnissa logo
Omnissa
Medium
Software Engineer Locked

Alternate Odd and Even Numbers with Two Threads

This question evaluates a candidate's understanding of multithreading and synchronization primitives such as locks and condition variables. It tests t...

Coding & Algorithms
0
0
5 people solved
Jun 11, 2026
Whatnot logo
Whatnot
Medium
Software Engineer Locked

Knight Dialer: Count Dialable Digit Sequences

This question evaluates a candidate's ability to model constrained state transitions with dynamic programming, using a knight's legal moves on a phone...

Coding & Algorithms
0
0
6 people solved
Jun 11, 2026
Whatnot logo
Whatnot
Medium
Software Engineer Locked

Dot Product of Two Vectors (Dense, then Sparse)

This question assesses proficiency in array manipulation and algorithmic efficiency by asking for a vector dot product, first over dense arrays and th...

Coding & Algorithms
1
0
9 people solved
Jun 11, 2026
Amazon logo
Amazon
Medium
Software EngineerNew Grad Locked

Inventory Allocation by Bid Priority

This question assesses simulation and priority-queue design skills, requiring careful implementation of tiered, round-robin resource allocation under ...

Coding & Algorithms
1
0
13 people solved
Jun 9, 2026
Databricks logo
Databricks
Medium
Software EngineerSenior+ Locked

Optimal Commute: Nearest Transit Distance in a City Grid

This question evaluates a candidate's ability to apply multi-source breadth-first search to a grid-based shortest-path problem. It tests graph travers...

Coding & Algorithms
1
0
21 people solved
Jun 9, 2026
Google logo
Google
Medium
Software Engineer Locked

Most Active Users in a Live Communication Stream

This question tests practical application of hash-based data structures and stream processing to track and rank user activity with deduplication logic...

Coding & Algorithms
4
0
9 people solved
Jun 9, 2026
Anchorage logo
Anchorage
Medium
Software Engineer Locked

Print the File System State

This question evaluates a candidate's ability to serialize and format in-memory data structures for deterministic textual output, focusing on represen...

Coding & Algorithms
0
0
6 people solved
Jun 9, 2026
Hive.Ai logo
Hive.Ai
Hard
Software Engineer Locked

Validate Adding an Edge to a Directed Acyclic Graph

Determine whether a proposed directed edge is new and can be added to an existing DAG without creating a cycle. Reject self-loops and duplicates, then...

Coding & Algorithms
0
0
11 people solved
Jun 8, 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