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
Shopify logo
Shopify
Easy
Data Engineer Locked

Write SQL for session analytics

This question evaluates SQL proficiency and data engineering competencies, including deduplication, joins, time-series aggregation, rolling-window cal...

Coding & Algorithms
20
0
180 people solved
Jan 17, 2026
Waymo logo
Waymo
Easy
Data Scientist

Determine earliest collision among moving cars

You are given n cars moving over time. Each car has known initial state at time \(t=0\): - 1D case (straight road): - initial position \(x_i\) (mete...

Coding & Algorithms
32
0
244 people solved
Jan 17, 2026
Waymo logo
Waymo
Easy
Data Scientist Locked

Implement nested template string substitution

This question evaluates understanding of string processing, dependency resolution, recursive expansion, cycle detection, and efficiency techniques suc...

Coding & Algorithms
17
1
129 people solved
Jan 17, 2026
TikTok logo
TikTok
Easy
Data Scientist

Maximize watched duration under consecutive-sum limit

You have a list of videos in a feed. Video i has duration d[i] (positive integer). A user has an “attention span” limit A. You want to select a subset...

Coding & Algorithms
7
0
64 people solved
Jan 17, 2026
Boston logo
Boston
Easy
Data Scientist

Implement palindrome check and valid parentheses

You have 20–25 minutes per problem. Implement the following two functions and be prepared to explain your approach and time/space complexity. Problem ...

Coding & Algorithms
6
0
47 people solved
Jan 17, 2026
Bilt Rewards logo
Bilt Rewards
Medium
Software Engineer

Debug and Fix Failing Unit Tests in Java

You receive a small Java project for a credit-card rewards service with three failing unit tests: calculatesTriplePointsForRestaurants, returnsUnknown...

Coding & Algorithms
2
0
29 people solved
Sep 6, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Solve and optimize menu combo DP

Given up to N different menu items, each with a unit price, and a list of combo offers where each offer specifies quantities for some items and a tota...

Coding & Algorithms
5
0
25 people solved
Sep 6, 2025
Datadog logo
Datadog
Medium
Software Engineer

Design log queries and a buffered writer

Part A — Log store with time-range queries: Implement a data structure that ingests log entries with ISO-8601 timestamps (e.g., YYYY-MM-DD HH:MM:SS) a...

Coding & Algorithms
51
0
344 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Detect words formed by multiple dictionary parts

Given an array words of up to 100,000 non-empty lowercase strings (total characters ≤ 1,000, 000), return all strings that can be formed by concatenat...

Coding & Algorithms
3
0
51 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Data Engineer

Compute capacities after site closures

You are given a nested dictionary redistribution where redistribution[closed_site][dest_site] equals the additional capacity required at dest_site if ...

Coding & Algorithms
6
0
72 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Data Engineer

Compute missing letters to form original string

Implement a function that, given two strings original and typed (typed is a misspelled/partial version of original), returns the number of additional ...

Coding & Algorithms
8
1
64 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
BlackRock logo
BlackRock
Medium
Software Engineer

Solve hierarchy distance and digit-square convergence

You have two independent tasks: A) Organization hierarchy distance Given a list of (employee, manager) pairs that form a complete hierarchy (a single ...

Coding & Algorithms
3
0
66 people solved
Sep 6, 2025
Bloomberg logo
Bloomberg
Medium
Software Engineer

Group words into anagram lists

Given an array of strings, group the words into lists of anagrams and return the collection of groups in any order. For example, ["abc", "cab", "edf"]...

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

Count palindrome substrings in a string

Given a lowercase ASCII string s, count the number of substrings that are palindromes and return the count. Implement an O(n^ 2) solution using expand...

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

Solve grid path and top‑k frequency

Part A — Grid Reachability with Obstacles: Given an m×n matrix of 0s and 1s where 0 indicates a passable cell and 1 indicates a blocked cell, starting...

Coding & Algorithms
4
0
31 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Compute vertical order of a BST

Compute the vertical order traversal of a binary search tree. Define coordinates so the root is at column 0, row 0; the left child is (col−1, row+ 1) ...

Coding & Algorithms
2
0
40 people solved
Sep 6, 2025
Uber logo
Uber
Medium
Software Engineer

Simulate views on an n-ary tree

Given a rooted, ordered n-ary tree (each node has a value and an ordered list of children), simulate an observer who starts at the bottom-left, moves ...

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

Justify choosing JavaScript for interviews

If given a choice of language, why would you choose JavaScript for front-end interview coding? Compare trade-offs versus TypeScript or Python regardin...

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

Detect runs and collapse a numeric grid

You are given an m x n grid of digits (0– 9). Phase 1: Find every horizontal or vertical run of length ≥ 3 consisting of the same digit. For each run,...

Coding & Algorithms
15
0
144 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