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

Compute dasher pay with peak-hour query

This question evaluates a candidate's ability to perform time-interval arithmetic, prorated pay aggregation, robust handling of missing or inconsisten...

Coding & Algorithms
11
0
107 people solved
Jan 2, 2026
Snapchat logo
Snapchat
Hard
Software Engineer Locked

Check whether an integer is a power of two

This question evaluates proficiency in bit-level reasoning and integer arithmetic, specifically understanding binary representations and the propertie...

Coding & Algorithms
6
0
68 people solved
Jan 2, 2026
Uber logo
Uber
Medium
Machine Learning Engineer

Compute currency conversion via graph search

Given a list of currency pairs, e.g., [('USD','CAD'), ('CAD','EUR'), ...], and a parallel list of conversion ratios [1.1, 1.2, ...] where ratio r mean...

Coding & Algorithms
8
0
124 people solved
Aug 13, 2025
Meta logo
Meta
Medium
Software Engineer

Implement tree column grouping and minimal parentheses fixes

Part A — Binary tree column grouping: Given the root of a binary tree, group node values by their vertical columns from leftmost to rightmost using x-...

Coding & Algorithms
3
0
32 people solved
Aug 13, 2025
Motive logo
Motive
Medium
Software Engineer

Implement Union-Find for connectivity

Implement a Disjoint Set Union (Union-Find) data structure with path compression and union by rank. Support operations: make_set, find(x), union(x, y)...

Coding & Algorithms
2
0
38 people solved
Aug 13, 2025
Google logo
Google
Medium
Software EngineerSenior+

Design set with O(1) random access

Design a data structure ("FancySet") that stores unique integers and supports the following operations, each in average O(1) time: - add(x): Insert va...

Coding & Algorithms
12
0
144 people solved
Jan 1, 2026
Amazon logo
Amazon
Medium
Software Engineer Locked

Validate a training courses catalog

This question evaluates understanding of directed graphs, cycle detection, dependency validation, and data consistency in the context of a training co...

Coding & Algorithms
4
0
47 people solved
Jan 1, 2026
Citadel logo
Citadel
Easy
Software Engineer Locked

Implement an in-memory order book API

This question evaluates understanding of in-memory data structures and API design for maintaining ordered collections with FIFO semantics, correctness...

Coding & Algorithms
5
0
106 people solved
Jan 1, 2026
Robinhood logo
Robinhood
Medium
Software Engineer

Design a referral leaderboard with chain-based counts

Design and implement a function that generates a referral leaderboard for a platform, given two equal-length arrays rh_users and new_users representin...

Coding & Algorithms
20
0
229 people solved
Aug 12, 2025
Akuna Capital logo
Akuna Capital
Medium
Data Scientist

Solve sliding window, graph top-k, and greedy tasks

You have three coding tasks. Task 1 — Sliding window on strings: Given a string s and an integer k, find one longest substring of s that contains at m...

Coding & Algorithms
3
0
44 people solved
Aug 12, 2025
Visa logo
Visa
Medium
Software Engineer

Compute distinct sums from limited coins

You are given two integer arrays, denom[0..n-1] and count[0..n-1], where denom[i] > 0 is a coin denomination and count[i] >= 0 is the number of availa...

Coding & Algorithms
5
0
79 people solved
Aug 11, 2025
TikTok logo
TikTok
Medium
Software Engineer

Solve Topological Sort and Anagram Indices

1) Given a directed graph (n vertices, m edges), return a topological ordering if one exists. If the graph contains a cycle, detect it and explain how...

Coding & Algorithms
3
0
51 people solved
Aug 11, 2025
Bloomberg logo
Bloomberg
Hard
Software Engineer

Solve Stack Decoding and Fuel-Constrained Paths

You are given two independent coding tasks. Task 1: Decode a Repeated-Pattern String Given a valid encoded string, return its fully decoded form. The ...

Coding & Algorithms
3
1
27 people solved
Dec 31, 2025
MathWorks logo
MathWorks
Medium
Software Engineer

Maximize disjoint k-sum pairs

You are given an integer array nums and an integer k. In one operation you may remove two indices i < j if nums[i] + nums[j] == k; each index can be u...

Coding & Algorithms
3
0
35 people solved
Aug 10, 2025
Amazon logo
Amazon
Medium
Software Engineer

Implement a formatted shell script output

Implement a formatted shell script output Write a shell script named script.sh that is invoked as: ./script.sh <username> <path_of_file>. It must prin...

Coding & Algorithms
4
0
40 people solved
Aug 10, 2025
Apple logo
Apple
Medium
Software Engineer

Compute island size in grid

Compute island size in grid Given an m x n binary matrix grid of 0s (water) and 1s (land), where an island is a group of 1s connected 4-directionally,...

Coding & Algorithms
8
0
61 people solved
Aug 9, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Maximize profit with transaction fee

Maximize profit with transaction fee Given an array of daily stock prices and a fixed transaction fee charged on each sell, compute the maximum profit...

Coding & Algorithms
4
0
74 people solved
Aug 8, 2025
OpenAI logo
OpenAI
Medium
Software Engineer

Implement in-memory KV store with serialization

Implement an in-memory key-value store in Python that supports setting and retrieving values and can serialize and deserialize the entire store. Defin...

Coding & Algorithms
40
0
361 people solved
Aug 8, 2025
OpenAI logo
OpenAI
Medium
Software Engineer

Implement a GPU credit manager

Implement a GPU credit manager for a compute cluster. Each user has a nonnegative credit balance that can be increased (grantCredits(user, amount)), c...

Coding & Algorithms
23
0
280 people solved
Aug 8, 2025
Google logo
Google
Medium
Software Engineer

Maintain streaming median and loosemedian

Maintain streaming median and loosemedian Design a data structure for an online stream of positive integers supporting insert (x). After each insertio...

Coding & Algorithms
9
0
64 people solved
Aug 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