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

Generate Tower of Hanoi moves

You are given n disks of different sizes stacked on peg A (largest at bottom). You have two other pegs, B and C. You may move one disk at a time, and ...

Coding & Algorithms
9
0
88 people solved
Mar 6, 2026
Amazon logo
Amazon
Medium
Software EngineerIntern

Compute Latencies and Search Grid Path

You are given two coding tasks from an internship interview. Task 1: Compute Message Latency from CSV Logs Two systems, ComputeA and ComputeB, exchang...

Coding & Algorithms
0
0
15 people solved
Mar 4, 2026
Meta logo
Meta
Medium
Software Engineer

Construct a BST and read spiral order

The coding round reportedly included two algorithmic tasks: 1. Rebuild a binary search tree from a preorder sequence - You are given an array of di...

Coding & Algorithms
17
0
115 people solved
Mar 4, 2026
Instacart logo
Instacart
Medium
Software Engineer

Evaluate an arithmetic expression

Write a function that evaluates a mathematical expression given as a string. Requirements: - Supports non-negative integers and whitespace. - Supports...

Coding & Algorithms
13
0
109 people solved
Mar 4, 2026
Amplitude logo
Amplitude
Medium
Software Engineer

Implement Employee Validation and Snake

This interview covered two coding tasks: 1. Employee validation - Implement a function that validates a collection of employees against a set of bu...

Coding & Algorithms
4
0
50 people solved
Mar 3, 2026
Two Sigma logo
Two Sigma
Medium
Data Scientist Locked

Evaluate a Piecewise Linear Function

This question evaluates understanding of linear interpolation, numerical reasoning with ordered 2D points, and input validation when computing values ...

Coding & Algorithms
4
0
38 people solved
Mar 3, 2026
Airbnb logo
Airbnb
Medium
Software EngineerSenior+

Parse Query Parameters Into a Map

Implement a function that parses the query portion of a GET URL and returns a map from query keys to parsed values. Input is a string that may start w...

Coding & Algorithms
2
0
17 people solved
Mar 2, 2026
Anthropic logo
Anthropic
Medium
Software Engineer

Implement Parallel Image Processing

Build an image-processing utility in Python using the Pillow library. You are given a collection of image file paths and an output directory. For each...

Coding & Algorithms
2
0
13 people solved
Mar 2, 2026
Glean logo
Glean
Medium
Software Engineer

Implement 2048 Game Logic

Implement the core movement logic for the 2048 game. You are given an n x n integer board where 0 represents an empty cell and every nonzero value rep...

Coding & Algorithms
27
0
191 people solved
Mar 1, 2026
Snapchat logo
Snapchat
Medium
Software Engineer Locked

Implement a Timestamped Counter

This question evaluates the ability to design and implement time-indexed counting data structures, reason about strictly increasing timestamps and que...

Coding & Algorithms
2
0
47 people solved
Mar 1, 2026
Shopify logo
Shopify
Medium
Machine Learning Engineer AI Locked

Simulate a rover fleet

This question evaluates skills in simulation design, state management, grid-based movement logic, and handling constraints such as obstacles, boundari...

Coding & Algorithms
2
0
31 people solved
Mar 1, 2026
Meta logo
Meta
Hard
Machine Learning EngineerSenior+ AI Locked

Optimize a Fifteen-Sum Card Strategy

This question evaluates algorithmic problem-solving, debugging, simulation-based testing, and strategy optimization using techniques such as search, m...

Coding & Algorithms
6
0
58 people solved
Mar 1, 2026
Morgan Stanley logo
Morgan Stanley
Medium
Data Scientist

Implement Factorial and Squares

Question In a live coding interview, write two Python functions and be ready to discuss their behavior. 1. factorial(n): Given a non-negative integer ...

Coding & Algorithms
6
0
47 people solved
Mar 1, 2026
Uber logo
Uber
Medium
Machine Learning Engineer

Solve DFS grid and keypad problems

You may be asked to solve one or more DFS/backtracking problems: 1. Grid connectivity problem: Given an m x n grid where 1 represents land and 0 repre...

Coding & Algorithms
17
1
138 people solved
Mar 1, 2026
NVIDIA logo
NVIDIA
Medium
Software Engineer

Implement a disk space manager with eviction

Design and implement an in-memory disk space manager that stores datasets by datasetId with a given size (e.g., in MB). The manager has a fixed total ...

Coding & Algorithms
6
0
79 people solved
Mar 1, 2026
Affirm logo
Affirm
Medium
Software Engineer Locked

Detect fraud events and extract PII

This question evaluates skills in parsing nested event data, extracting and deduplicating PII fields, and performing key-based correlation to detect r...

Coding & Algorithms
12
2
129 people solved
Mar 1, 2026
Nextdoor logo
Nextdoor
Medium
Machine Learning Engineer

Merge overlapping weekly time intervals

You are given a list of time intervals representing meetings. Each interval is a pair of strings in the format: - "<Day> <H>:<MM>" (24-hour time) - <D...

Coding & Algorithms
12
0
96 people solved
Mar 1, 2026
Oracle logo
Oracle
Medium
Software Engineer

Compute letter frequencies from encoded string

Problem You are given an encoded string s representing a string of lowercase English letters (a–z). The encoding follows these rules: 1. Letters a to ...

Coding & Algorithms
5
1
92 people solved
Mar 1, 2026
Walmart Labs logo
Walmart Labs
Medium
Software Engineer Locked

Check whether brackets are balanced

This question evaluates a candidate's competency in string processing and bracket-matching concepts, testing familiarity with linear-time algorithms a...

Coding & Algorithms
5
0
41 people solved
Mar 1, 2026
Netflix logo
Netflix
Medium
Software Engineer Locked

Solve sliding-window and disjoint-string-pairs tasks

This question evaluates proficiency in string-processing algorithms, sliding-window techniques, efficient set or bitmask representations, and combinat...

Coding & Algorithms
28
0
270 people solved
Mar 1, 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