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
Google logo
Google
Hard
Software Engineer

Shuffle array using random integer API

You are given an array nums of length n representing a deck of distinct cards. You do not have access to a built-in shuffle function, but you are give...

Coding & Algorithms
6
0
80 people solved
Dec 8, 2025
Netflix logo
Netflix
Medium
Software Engineer

Find user pairs with overlapping last K movies

You are given the same user movie-watching histories as in the previous problem. Each user’s history is an ordered list of movie IDs from earliest to ...

Coding & Algorithms
21
0
146 people solved
Dec 8, 2025
Uber logo
Uber
Medium
Software Engineer

Detect cycle in directed dependency graph

You are given a directed dependency graph representing services in a system. - There are n services, labeled from 0 to n - 1. - You are given a list o...

Coding & Algorithms
6
0
90 people solved
Dec 8, 2025
Verkada logo
Verkada
Medium
Software Engineer

Find common active intervals across cameras

You are now processing data from multiple security cameras. You are given: - An integer N, the number of cameras. - A threshold value T (a real number...

Coding & Algorithms
7
1
79 people solved
Dec 8, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Find shortest path in a grid with obstacles

You are given a 2D grid of size m x n representing a maze. Each cell in the grid is either empty (0) or blocked (1). You are also given two coordinate...

Coding & Algorithms
5
0
66 people solved
Dec 8, 2025
Coinbase logo
Coinbase
Medium
Software Engineer

Paginate forward and backward through results

You are asked to extend a basic pagination system to support forward and backward navigation, similar to a cursor-based API. You are given: - A zero-i...

Coding & Algorithms
20
0
174 people solved
Dec 8, 2025
Airwallex logo
Airwallex
Medium
Data ScientistSenior+ Locked

Implement bootstrap mean and variance

This question evaluates a candidate's ability to implement bootstrap resampling and compute statistical estimates for the sampling distribution of the...

Coding & Algorithms
4
0
65 people solved
Dec 8, 2025
Meta logo
Meta
Medium
Software Engineer

Implement string and basic ML algorithms

You are given three implementation tasks that mix algorithms and basic machine learning models. --- Task 1: Longest substring with all distinct charac...

Coding & Algorithms
5
0
65 people solved
Dec 8, 2025
Walmart Labs logo
Walmart Labs
Easy
Machine Learning Engineer Locked

Find first non-repeating character

This question evaluates string manipulation, frequency-counting concepts, algorithmic complexity reasoning, and attention to edge-case handling in seq...

Coding & Algorithms
3
0
38 people solved
Dec 7, 2025
Two Sigma logo
Two Sigma
Hard
Data Scientist

Expected Number of Good Pairs in a Randomly Weighted Complete Graph

Expected Number of Good Pairs in a Randomly Weighted Complete Graph You are given a complete graph on n vertices — every pair of distinct vertices is ...

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

Rank songs by pairwise user preferences

You are given preference rankings for n users over m songs. Each song is labeled from 0 to m - 1. For each user i (0-indexed), you are given an array ...

Coding & Algorithms
26
0
182 people solved
Nov 30, 2025
Two Sigma logo
Two Sigma
Hard
Data Scientist

Smallest Palindrome Strictly Greater Than K

A palindrome is a positive integer whose decimal representation reads the same forwards and backwards, with no leading zeros. For example, 7, 44, 121,...

Coding & Algorithms
0
0
7 people solved
Nov 28, 2025
Hudson logo
Hudson
Medium
Data Scientist

Count inversions in a permutation

Problem Given an array a of length n that is a permutation of distinct integers (e.g., 1..n), define an inversion as a pair of indices (i, j) such tha...

Coding & Algorithms
9
0
69 people solved
Nov 28, 2025
NVIDIA logo
NVIDIA
Medium
Software Engineer

Implement simple VM manager with CRUD operations

You are asked to implement a simple in-memory virtual machine (VM) manager that can: - List all VMs - Add (create) a new VM - Modify (update) an exist...

Coding & Algorithms
7
0
70 people solved
Nov 28, 2025
Uber logo
Uber
Medium
Software Engineer

Compute exclusive execution time from logs

Problem You are given execution logs from a single-threaded CPU that runs n functions labeled 0..n-1. The CPU can run only one function at a time. A f...

Coding & Algorithms
9
0
92 people solved
Nov 27, 2025
Google logo
Google
Easy
Software Engineer

Solve three coding problems

The interview note described the following coding questions: 1. Find the N-th license plate in lexicographic order - A license plate has exactly 6 ...

Coding & Algorithms
8
0
72 people solved
Jun 15, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Implement a calendar with non-overlapping bookings

Problem Design a calendar booking system that stores half-open time intervals [start, end) (inclusive of start, exclusive of end). Implement a class w...

Coding & Algorithms
12
1
89 people solved
Nov 25, 2025
Google logo
Google
Medium
Software Engineer

Add two big integers from digit lists

You are given two non-empty singly linked lists (or arrays) representing two non-negative integers. The digits are stored in reverse order, and each n...

Coding & Algorithms
11
0
102 people solved
Nov 24, 2025
xAI logo
xAI
Easy
Software Engineer

Phone Keypad Predictive Text Suggestions

Phone Keypad Predictive Text Suggestions You are building the predictive-text feature for a classic 9-key phone keypad. Each digit from 2 to 9 maps to...

Coding & Algorithms
1
0
13 people solved
Jun 7, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Find two numbers that sum to target

Given an integer array nums of length n and an integer target, return the indices (i, j) (0-based) of two distinct elements such that nums[i] + nums[j...

Coding & Algorithms
2
0
28 people solved
Nov 20, 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