Coding & Algorithms Interview Questions

Practice 3,469 real coding and algorithms interview questions reported from interviews at Meta, Amazon, Google, Uber and Microsoft. The mix follows what these loops actually ask: arrays and strings, hash maps, two pointers and sliding windows, binary search, linked lists, trees and graphs, BFS and DFS, recursion and backtracking, dynamic programming, heaps and priority queues, and the occasional design-a-data-structure round. Roughly four in five are rated medium, which is where most technical screens sit; 477 are hard and cluster in onsite loops. 3,033 of them open in a console where you can run your solution against the test cases in Python, Java, C++ or JavaScript. 2,712 come from Software Engineer interviews, with the rest from Machine Learning Engineer, Data Scientist and Data Engineer loops, and 404 were set as take-home projects rather than live sessions.

3.5k Questions 368 Companies08.11.2026
Showing 20 results
Role
Amazon logo
Amazon
Medium
Software Engineer

Solve interval deletion and GCD subarray problems

This Amazon online assessment contains two independent algorithm problems. For each, return the requested value, describe an efficient algorithm, and ...

Coding & Algorithms
6
1
48 people solved
Jul 16, 2025
Abnormal Security logo
Abnormal Security
Medium
Software Engineer

Design a duplicate-file removal algorithm

Design a duplicate-file removal algorithm Your filesystem contains millions of photos. Duplicates are strictly byte-identical files (no ML/CV similari...

Coding & Algorithms
10
0
120 people solved
Jul 16, 2025
OpenAI logo
OpenAI
Medium
Software Engineer

Implement a serializable key-value store

Implement in C++ an in-memory key-value store with: - put(key: string, value: string), get(key) -> optional<string>, erase(key). - serialize() -> vect...

Coding & Algorithms
58
0
473 people solved
Jul 15, 2025
Meta logo
Meta
Easy
Machine Learning Engineer Locked

Solve two linked list/array tasks

This two-part question evaluates proficiency with fundamental data structures and algorithmic problem-solving—specifically linked list manipulation an...

Coding & Algorithms
3
0
63 people solved
Dec 14, 2025
Zoox logo
Zoox
Hard
Software Engineer Locked

Can a Car Meet a Truck?

This question evaluates a candidate's ability to reason about grid-based movement and time-indexed reachability, testing competencies in algorithmic a...

Coding & Algorithms
5
0
94 people solved
Dec 13, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Design Data Structure for Sparse Matrices Operations

Scenario Analytics engine stores extremely sparse numeric matrices. Question Design a data structure to store two sparse matrices and implement print(...

Coding & Algorithms
8
0
12 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Determine Pin Connections Through Common Boards

Scenario Pinterest boards contain many pins; need to infer relationships between pins. Question Given the membership lists of all boards, write a func...

Coding & Algorithms
19
0
58 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Design Algorithm to Minimize Payments in Expense-Sharing App

Scenario Expense-sharing app needs to settle debts among friends after a trip. Question Given a list of transactions (payer, payee, amount), design an...

Coding & Algorithms
28
0
96 people solved
Jul 12, 2025
Google logo
Google
Medium
Data Scientist

Implement Sampling and Minimize Loss in Numerical Coding

Scenario Numerical coding challenges on sampling and loss minimization. Question a) Implement functions to sample from truncated normal distributions ...

Coding & Algorithms
24
0
93 people solved
Jul 12, 2025
Citadel logo
Citadel
Medium
Data Scientist

Implement Infinite Fibonacci Generator Using Lazy Evaluation

Scenario Testing understanding of Python lazy evaluation and generators. Question Explain what lazy evaluation means in Python and implement a generat...

Coding & Algorithms
20
0
43 people solved
Jul 12, 2025
TikTok logo
TikTok
Medium
Data Scientist

Optimize Station Sequence for Maximum Car Output in Simulation

Scenario The Car-Building mini-game lets you sequence chassis, engine, and paint stations with limited buffers. Question Describe a strategy to maximi...

Coding & Algorithms
10
0
34 people solved
Jul 12, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Solve restaurant path and order event tasks

You are given two independent coding tasks. Task 1: Shortest paths in a restaurant grid Context: A restaurant is represented as a 2D grid. The waiter ...

Coding & Algorithms
25
0
196 people solved
Dec 8, 2025
Roblox logo
Roblox
Easy
Machine Learning Engineer

Implement recent-requests counter

You are designing an in-memory component for a web service that needs to track how many requests ("hits") it has received in the last 5 minutes. Imple...

Coding & Algorithms
11
0
109 people solved
Dec 8, 2025
Morgan Stanley logo
Morgan Stanley
Medium
Data Scientist

Compute maximum non-overlapping meetings

Assume you are given a list of meeting time intervals for a single person. Each meeting i is represented by a pair of integers [start_i, end_i], where...

Coding & Algorithms
2
0
49 people solved
Dec 8, 2025
Meta logo
Meta
Medium
Software Engineer

Sum numbers formed by root-to-leaf paths

You are given the root of a binary tree where each node contains a single digit from 0 to 9. Each root-to-leaf path represents a number obtained by co...

Coding & Algorithms
4
0
39 people solved
Dec 8, 2025
Squarepoint logo
Squarepoint
Medium
Software Engineer

Parse payroll file and answer queries

You are given a payroll "file" as a StringIO (file-like) object in Python. The underlying text represents manually-entered payroll data. Assume the fo...

Coding & Algorithms
4
0
80 people solved
Dec 8, 2025
Robinhood logo
Robinhood
Easy
Software Engineer

Compute trigger counts in a DAG

You are given a directed acyclic graph (DAG) that represents trigger dependencies between tasks. - Each node represents a task. - There is exactly one...

Coding & Algorithms
8
0
107 people solved
Dec 8, 2025
Stripe logo
Stripe
Medium
Software Engineer

Implement account scheduler with locking and LRU

Design a class AccountScheduler that manages the time-based availability of a fixed set of account IDs. Initialization You are given: - accounts: a li...

Coding & Algorithms
5
1
42 people solved
Dec 8, 2025
Stripe logo
Stripe
Medium
Software Engineer

Find linked user records by similarity

You are given a list of user records. Each record has the following fields: - id (integer, unique) - name (string) - email (string) - company (string)...

Coding & Algorithms
8
0
78 people solved
Dec 8, 2025
Google logo
Google
Hard
Software Engineer

Compute city skyline outline

You are given a list of rectangular buildings in a 2D city skyline. Each building is represented by three integers [L, R, H]: - L: the x-coordinate of...

Coding & Algorithms
14
0
132 people solved
Dec 8, 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