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

Find top-k rated nodes via traversal

You are given a finite graph (directed or undirected) with n nodes and m edges. Each node u has an integer rating r[u]. Given a starting node s and an...

Coding & Algorithms
7
0
56 people solved
Sep 6, 2025
MathWorks logo
MathWorks
Medium
Software Engineer

Maximize operations by removing target-sum pairs

Given an integer array nums and an integer T, in one operation you may remove two elements whose sum equals T. Return the maximum number of operations...

Coding & Algorithms
3
0
26 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Implement a robust shell CLI

Implement a POSIX-compliant shell script invoked as ./script.sh <username> <path_of_file> that outputs a single line formatted as "<timestamp> <licens...

Coding & Algorithms
4
0
44 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Check path in N-ary tree

Given the root of an N-ary tree and a sequence of integers path[0..k-1], determine whether there exists a path starting at the root whose node values ...

Coding & Algorithms
2
0
50 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Machine Learning Engineer

Compute longest increasing subsequence

Longest Increasing Subsequence: length, reconstruction, and counting Given an integer array nums, do all of the following: 1. Length. Compute the leng...

Coding & Algorithms
3
0
41 people solved
Sep 6, 2025
Pinterest logo
Pinterest
Medium
Software Engineer

Determine equality of arbitrarily nested sets

Implement a function that determines whether two arbitrarily nested sets are equal. Sets are unordered and contain no duplicates; elements can be inte...

Coding & Algorithms
15
0
139 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Determine max remainders and anagram after deletions

Part 1 (Array Remainders): Given an integer array A of length n with A[i] > 0. You may choose any integer array B of length n. Define C[i] = B[i] mod ...

Coding & Algorithms
5
0
37 people solved
Sep 6, 2025
Apple logo
Apple
Medium
Software Engineer

Implement rotation, LRU cache, streaming median, cycle detection

Complete the following coding tasks. For each, provide code, justify time/space complexity, and describe edge cases: 1) Image rotation: Given an n×n i...

Coding & Algorithms
11
0
121 people solved
Sep 6, 2025
Bloomberg logo
Bloomberg
Medium
Software Engineer

Solve string dictionary and tree ordering

Part A — One-edit dictionary: Build a data structure supporting build(words: List[str]) and search(query: str) -> bool that returns true if and only i...

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

Implement encoding validation and grid shortest path

Part A — Byte-encoding validation: You are given an array of integers in [0, 255] representing bytes. Determine whether the sequence encodes valid cha...

Coding & Algorithms
3
0
36 people solved
Sep 6, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Generate split-stay pairs efficiently

Given N Airbnb listings, each with available days as integers, and an inclusive requested date range [L, R], return all ordered pairs (X, Y) of distin...

Coding & Algorithms
22
0
222 people solved
Sep 6, 2025
Google logo
Google
Medium
Software Engineer

Find largest subset sharing a common digit

You are given a list of two-digit integers (each from 10 to 99, inclusive). You want to select as many numbers as possible in one selection such that:...

Coding & Algorithms
6
0
71 people solved
Sep 5, 2025
Uber logo
Uber
Hard
Software Engineer Locked

Maximize Minimum Scaled Value

This question evaluates algorithmic optimization and resource-allocation skills, focusing on integer scaling under a global budget to maximize the min...

Coding & Algorithms
2
0
41 people solved
Jan 16, 2026
Snowflake logo
Snowflake
Hard
Software Engineer

Compute height of tree with deleted nodes; minimize deletions

You are given a rooted tree (not necessarily binary). Each node has a list of children. Some nodes are marked as deleted = true. Define the effective ...

Coding & Algorithms
7
0
128 people solved
Jan 16, 2026
Snowflake logo
Snowflake
Hard
Software Engineer

Compute nearest bathroom distance for each desk

You are given an m x n grid of characters containing only: - 'B' = bathroom - 'D' = desk - '_' = empty cell From any cell you may move one step up/dow...

Coding & Algorithms
13
0
163 people solved
Jan 16, 2026
Stripe logo
Stripe
Hard
Software Engineer Locked

Generate Available 30-Minute Time Slots

This question evaluates date/time arithmetic, interval and recurrence handling, edge-case reasoning, and test-case design within scheduling logic for ...

Coding & Algorithms
4
0
65 people solved
Jan 14, 2026
Robinhood logo
Robinhood
Medium
Software EngineerSenior+ Locked

Parse Requests and Compute Balances

This question evaluates input parsing, state management, data validation, and use of basic data structures to track user accounts, friend relationship...

Coding & Algorithms
4
0
47 people solved
Jan 14, 2026
Stripe logo
Stripe
Medium
Software Engineer

Implement a CSV dataset join

Implement joinDataSet(fieldName, customerFile, processorFile, skipUnmatched). You are given two datasets represented as List<String>, where: - custome...

Coding & Algorithms
9
0
94 people solved
Jan 14, 2026
NVIDIA logo
NVIDIA
Medium
Software Engineer Locked

Find minimum time to cross bridge with flashlight

This question evaluates algorithmic problem-solving and optimization skills, including modeling constrained state transitions, reasoning about trade-o...

Coding & Algorithms
3
0
49 people solved
Jan 14, 2026
Atlassian logo
Atlassian
Medium
Software Engineer Locked

Find smallest common organization for employees

The question evaluates competency in hierarchical and graph data structures, including tree lowest-common-ancestor reasoning, DAG ancestor minimality,...

Coding & Algorithms
10
0
79 people solved
Jan 14, 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