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
Figma logo
Figma
Medium
Data Engineer

Validate an IPv4 address string

Given a string s, determine whether it is a valid IPv4 address. A valid IPv4 address: - Has exactly 4 parts separated by dots (.): x1.x2.x3.x4 - Each ...

Coding & Algorithms
14
0
170 people solved
Jan 20, 2026
Netflix logo
Netflix
Hard
Software Engineer Locked

Design command executor with undo

This question evaluates understanding of the command pattern, state and history management, failure handling, and appropriate data structure use for i...

Coding & Algorithms
9
0
70 people solved
Jan 20, 2026
XPeng logo
XPeng
Medium
Data Engineer

Build a Least-Recently-Used Store

Implement an in-memory key-value store with least-recently-used eviction. The store is initialized with a positive integer capacity and supports two o...

Coding & Algorithms
3
0
25 people solved
Apr 11, 2026
DoorDash logo
DoorDash
Easy
Software Engineer Locked

Compute Nearest Destination Distances

This question evaluates graph and grid traversal concepts, specifically multi-source shortest-path computation on a grid and handling special-cell con...

Coding & Algorithms
3
0
39 people solved
Apr 11, 2026
LinkedIn logo
LinkedIn
Easy
Software Engineer

Count Trips From Vehicle Logs

You are given a text log of vehicle events on a road system. Each log record contains: - license_plate: a string identifying a vehicle - event_type: o...

Coding & Algorithms
2
0
20 people solved
Apr 11, 2026
Ramp logo
Ramp
Hard
Software Engineer

Track Users From Flight History

You are given an unsorted list of flight records. Each record contains departure_airport, departure_time, arrival_airport, arrival_time, and user_id. ...

Coding & Algorithms
8
0
125 people solved
Jan 17, 2026
PayPal logo
PayPal
Easy
Data Scientist Locked

Explain list vs tuple in Python

This question evaluates understanding of Python sequence types, specifically differences in mutability, hashing ability, memory footprint, and iterati...

Coding & Algorithms
9
0
78 people solved
Jan 17, 2026
Google logo
Google
Medium
Software Engineer Locked

Find Shortest Queue with Few Calls

This question evaluates algorithm design and analysis skills, focusing on working with restricted data structure APIs and minimizing total operations ...

Coding & Algorithms
6
0
67 people solved
Apr 10, 2026
Meta logo
Meta
Medium
Machine Learning Engineer

Generate unique permutations with duplicates

Given an array of integers that may contain duplicates, generate all unique permutations. Ensure no duplicate permutations are returned even if some v...

Coding & Algorithms
7
0
56 people solved
Sep 6, 2025
Roblox logo
Roblox
Medium
Software Engineer

Implement queue-based rate limiter with multi-key limits

Implement a rate limiter with method allow(timestamp) that returns true if a request is allowed under a limit of K requests per rolling window W milli...

Coding & Algorithms
18
0
233 people solved
Sep 6, 2025
Snapchat logo
Snapchat
Medium
Machine Learning Engineer

Count decodings of a numeric string

Given a string s of digits representing an encoded message where '1' maps to 'A', ..., '26' maps to 'Z', and '0' cannot appear alone (it must be part ...

Coding & Algorithms
7
0
50 people solved
Sep 6, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Implement tree traversals, BFS, and subsets generation

1) Define a TreeNode class for a binary tree with an integer value and left/right pointers. Implement preorder, inorder, and postorder traversals: (a)...

Coding & Algorithms
5
0
75 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Maintain real-time top-K products from events

Design a data structure/class that ingests a stream of product events and returns the current top‑K products at any time. Events include {timestamp, p...

Coding & Algorithms
3
1
57 people solved
Sep 6, 2025
Optiver logo
Optiver
Medium
Data Scientist

Devise sequence-rule detection strategy

You are given an integer sequence with 2 ≤ n ≤ 50 terms, possibly following rules such as arithmetic/geometric progressions, alternating patterns, pol...

Coding & Algorithms
8
0
84 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Implement robust debounce and throttle in JavaScript

Implement debounce(fn, wait, options) and throttle(fn, wait, options) in JavaScript. Support leading/trailing invocation toggles, maxWait for throttle...

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

Implement GPU credit ledger

You manage a GPU pool with per-tenant credits. Given a list/stream of events where each event adjusts a tenant’s credit balance by a signed integer (p...

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

Find mode or minimum with time-space tradeoffs

For an unsorted array of integers, implement two functions: ( 1) return the minimum value; ( 2) return the value that appears most frequently (the mod...

Coding & Algorithms
5
0
37 people solved
Sep 6, 2025
Tesla logo
Tesla
Medium
Software Engineer

Design a contiguous segment allocator

Design an in-memory contiguous segment allocator over an array of n cells (indexed 0..n- 1), all initially free. Support two operations: 1) allocate(l...

Coding & Algorithms
12
0
102 people solved
Sep 6, 2025
Optiver logo
Optiver
Medium
Software Engineer

Design a queue and analyze tradeoffs

Design a FIFO queue data structure that supports enqueue, dequeue, peek, and isEmpty. Compare implementations using a singly linked list, a dynamic ar...

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

Clone list with random pointers

Question You are given the head of a singly linked list where each node has two pointers: next and random. The random pointer may be null or point to ...

Coding & Algorithms
3
0
46 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