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
Hard
Software EngineerIntern Locked

Merge two sorted arrays in-place

This question evaluates array-manipulation and in-place algorithm skills, including understanding of sorted-data merging, index/pointer management, an...

Coding & Algorithms
8
0
107 people solved
Feb 8, 2026
Databricks logo
Databricks
Medium
Machine Learning EngineerSenior+ Locked

Delete a Character From Cover

This question evaluates proficiency in string manipulation, interval arithmetic, and data-structure updates with attention to index mapping and edge-c...

Coding & Algorithms
11
0
82 people solved
Feb 7, 2026
Microsoft logo
Microsoft
Medium
Software Engineer

Populate next pointers in a perfect binary tree

You are given a perfect binary tree (all leaves at the same level; every internal node has two children). Each node has fields left, right, and next. ...

Coding & Algorithms
7
0
78 people solved
Feb 7, 2026
Databricks logo
Databricks
Medium
Software EngineerSenior+

Implement RLE and bit-packing compression

You are asked to implement two related compression/decompression schemes: Run-Length Encoding (RLE) and bit-packing. --- Part 1 — Run-Length Encoding ...

Coding & Algorithms
34
1
238 people solved
Oct 10, 2025
Bloomberg logo
Bloomberg
Hard
Software EngineerNew Grad

Compute the Nth Recency Value

Given an integer n >= 1, define a sequence a as follows: - a[0] = 0 - For each i >= 1: - If a[i - 1] has appeared earlier in the sequence, meaning t...

Coding & Algorithms
1
1
15 people solved
Oct 9, 2025
Waymo logo
Waymo
Medium
Software EngineerSenior+ Locked

Can You Reach the Last Index?

This question evaluates a candidate's understanding of array traversal and reachability in sequences of jumps, along with the ability to reason about ...

Coding & Algorithms
14
0
109 people solved
Feb 6, 2026
Perplexity logo
Perplexity
Medium
Software Engineer

Implement time-versioned KV store with restore

Design and implement an in-memory key–value store where every operation is associated with a timestamp (monotonically increasing integer). The store m...

Coding & Algorithms
6
0
58 people solved
Feb 6, 2026
Bloomberg logo
Bloomberg
Medium
Software Engineer

Implement anagram check and odd-even linked list

You are given two independent coding tasks. Task 1: Check if two strings are anagrams Implement a function that determines whether two given strings a...

Coding & Algorithms
9
0
77 people solved
Oct 6, 2025
Ramp logo
Ramp
Hard
Software Engineer

Find final URL by crawling until “congrats”

You are given a starting HTTP URL. Implement a function that repeatedly calls URLs returned by previous responses until you reach a response that indi...

Coding & Algorithms
52
0
379 people solved
Feb 4, 2026
Netflix logo
Netflix
Medium
Software Engineer Locked

Compute minimum semesters to finish courses

This question evaluates graph theory and scheduling competencies, including dependency resolution, cycle detection in directed graphs, and capacity-co...

Coding & Algorithms
15
0
225 people solved
Feb 4, 2026
Bloomberg logo
Bloomberg
Medium
Software Engineer Locked

Solve sliding-window, flattening, decode, and O(1) random set

This multi-part question evaluates competence in string processing and nested parsing, linked-list flattening and recursion depth management, dynamic ...

Coding & Algorithms
10
0
119 people solved
Feb 4, 2026
DoorDash logo
DoorDash
Medium
Software EngineerSenior+

Find Each Cell's Nearest Source

Given an m x n grid containing 1 for source cells and 0 for regular cells, compute for every cell the shortest 4-directional distance to any source ce...

Coding & Algorithms
11
0
81 people solved
Feb 3, 2026
Shopify logo
Shopify
Medium
Machine Learning Engineer AI Locked

Implement a Capacity-Bounded Cache

This question evaluates a candidate's ability to design and implement an efficient capacity-bounded in-memory key-value cache, assessing understanding...

Coding & Algorithms
6
0
71 people solved
Feb 3, 2026
Arista logo
Arista
Easy
Software Engineer

Solve palindrome and missing-number variants

You are asked to solve two coding problems and analyze the time and space complexity of each. 1. Palindrome check Given a string s, determine whe...

Coding & Algorithms
5
0
51 people solved
Feb 3, 2026
Hard
Software Engineer

Implement a multi-button click detector

Implement a click detector for multiple physical buttons. You receive button state updates as a stream. Each update provides: - button_id (integer) - ...

Coding & Algorithms
7
0
55 people solved
Feb 3, 2026
DoorDash logo
DoorDash
Medium
Machine Learning Engineer Locked

Minimize batches and allocate riders by time

This question set evaluates algorithmic problem-solving in scheduling and resource allocation, assessing understanding of batching under capacity and ...

Coding & Algorithms
17
0
248 people solved
Feb 3, 2026
Bitkernel logo
Bitkernel
Hard
Software Engineer

Implement popup and redirect in JavaScript

You are working in a browser environment and must use vanilla JavaScript only (no external libraries). Task Implement a function showPopupAndRedirect(...

Coding & Algorithms
2
0
42 people solved
Oct 3, 2025
Chicago logo
Chicago
Easy
Software Engineer

Merge Nested Dictionaries Iteratively

Given a list of Python dictionaries, merge them into a single dictionary without using recursion. Rules: - Process the dictionaries from left to right...

Coding & Algorithms
3
0
49 people solved
Feb 2, 2026
Ziprecruiter logo
Ziprecruiter
Medium
Software Engineer Locked

Design a voting counter for restaurants

This question evaluates familiarity with hash-table–based counting, efficient update and lookup operations, handling of ties with a deterministic tie-...

Coding & Algorithms
4
0
33 people solved
Feb 2, 2026
Pinterest logo
Pinterest
Easy
Data Scientist Locked

Implement np.random.choice

This question evaluates understanding of random sampling algorithms, probability distributions (uniform and weighted), handling of weights and edge-ca...

Coding & Algorithms
5
0
47 people solved
Feb 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