Coding & Algorithms Interview Questions

Practice 3,469 real Coding & Algorithms interview questions for 2026. Covers companies like Meta, Amazon, Google, Uber, and Microsoft. Real questions from actual interviews with detailed solutions — ideal for focused interview preparation. Coding & Algorithms interview questions are the single most common technical gate for software engineering roles and are used to evaluate problem framing, algorithm selection, complexity trade-offs, correctness, edge-case reasoning, and clear communication under time pressure. Expect this category to appear in early technical screens and repeatedly across onsite loops at companies that weight it heavily (notably Meta, Google, and Amazon). Interviews will test arrays and strings, trees and graphs, dynamic programming, hashing and two‑pointer techniques, and the candidate’s ability to test and optimize code in a shared editor. Prepare with timed mock interviews, practice in the same editor you’ll use live, and build a progressive schedule that moves from fundamentals to medium/hard problems; typical candidates invest several weeks to a few months of focused practice depending on seniority and target company.

3.5k Questions 368 Companies08.11.2026
Showing 20 results
Role
Dropbox logo
Dropbox
Medium
Data Scientist

Compute max island with constrained flips

Given an n×n binary grid G where 1=land and 0=water with 4-directional connectivity, return the size of the largest island achievable by flipping at m...

Coding & Algorithms
5
0
49 people solved
Oct 13, 2025
Capital One logo
Capital One
Medium
Data Scientist

Debug and test a Python function in venv

Consider the Python snippet below. """ import math def accumulate(nums, start=0, cache={}): total = start for n in nums: if n % 2 == 0: nums.appen...

Coding & Algorithms
7
0
100 people solved
Oct 13, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Implement and extend My Calendar III

Design and implement a booking system like LeetCode 732 (My Calendar III). Provide a class with methods: book(start, end) using half-open intervals [s...

Coding & Algorithms
6
0
102 people solved
Oct 13, 2025
Uber logo
Uber
Medium
Data Scientist

Implement weighted sampling without replacement

Implement in Python a function sample_k(items, weights, k) that returns k items without replacement with probability proportional to weight. Requireme...

Coding & Algorithms
8
0
121 people solved
Oct 13, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Find list pair with maximum overlap

You are given N labeled lists of items as a Python dict mapping list_name -> iterable of strings. Example input: {'L1': ['A','B','C'], 'L2': ['A','C',...

Coding & Algorithms
5
0
90 people solved
Oct 13, 2025
Meta logo
Meta
Medium
Data Scientist

Implement randomized Quickselect without k-shift bug

Implement randomized Quickselect to return the k-th largest element (1-based k, 1 ≤ k ≤ n) from an unsorted integer array. Use an in-place partition t...

Coding & Algorithms
4
0
47 people solved
Oct 13, 2025
Meta logo
Meta
Medium
Data Scientist

Compute binary-tree diameter via return-only DFS

Given the root of a binary tree, compute its diameter defined as the number of edges on the longest path between any two nodes. Implement a DFS that r...

Coding & Algorithms
6
0
45 people solved
Oct 13, 2025
Meta logo
Meta
Medium
Data Scientist

Compute 95th-percentile call concurrency

Given N call sessions as half-open intervals [start, end) in UNIX seconds, design an algorithm to compute the 95th percentile of per-minute concurrent...

Coding & Algorithms
3
0
39 people solved
Oct 13, 2025
Amazon logo
Amazon
Hard
Data Scientist

Solve subset-count and kth-factor problems

Two Independent Tasks A) Maximum Count Under Sum Constraint You are given an integer array arr and an integer budget n. Return the maximum number of e...

Coding & Algorithms
4
0
58 people solved
Oct 13, 2025
Snowflake logo
Snowflake
Medium
Data Scientist

Solve and optimize 3Sum and variants at scale

Implement a function that returns all unique triplets (i, j, k) of indices whose values sum to a target T, with strong performance and deduplication g...

Coding & Algorithms
5
0
53 people solved
Oct 13, 2025
Uber logo
Uber
Hard
Data Scientist

Implement sqrt with Newton vs binary search

Implement numerically robust square-root routines and analyze convergence Task 1 — sqrt_newton(x, tol=1e-12) Implement a Python function that returns ...

Coding & Algorithms
7
0
138 people solved
Oct 13, 2025
LinkedIn logo
LinkedIn
Medium
Data Scientist

Implement fast sampling for weighted k-sided die

You must sample from a categorical distribution over k outcomes with probabilities p1..pk (sum to 1) without using built-in categorical samplers. You ...

Coding & Algorithms
4
0
89 people solved
Oct 13, 2025
Yelp logo
Yelp
Medium
Data Scientist

Compute and Rank by Jaccard Similarity

Implement two functions: (1) jaccard_similarity(s1, s2) that tokenizes by splitting on any non-alphanumeric character, lowercases, treats tokens as se...

Coding & Algorithms
3
0
44 people solved
Oct 13, 2025
Freddie Mac logo
Freddie Mac
Medium
Data Scientist

Implement blocked time-series cross-validation

Implement a panel-aware blocked time-series cross-validation splitter with an embargo. Input: DataFrame columns [loan_id, msa, month]. Requirements: (...

Coding & Algorithms
8
0
58 people solved
Oct 13, 2025
Amazon logo
Amazon
Medium
Data ScientistSenior+

Implement list overlap and dense-ranked word frequencies

Part A — Multiset overlap count Implement count_overlap(a: List[int], b: List[int]) -> int that returns the size of the multiset intersection of a and...

Coding & Algorithms
4
0
38 people solved
Oct 13, 2025
Uber logo
Uber
Medium
Data Scientist

Compute maximum concurrent trips from intervals

You’re given n trip intervals [start, end) in seconds, where start < end, representing when a rider’s trip starts and ends in a city on a specific day...

Coding & Algorithms
16
0
164 people solved
Oct 13, 2025
PayPal logo
PayPal
Medium
Data Scientist

Implement sliding-window device anomaly

Streaming detection algorithm: Implement a function process_logins(stream) that consumes a time-ordered stream of login events (user_id, ts, device_id...

Coding & Algorithms
4
0
51 people solved
Oct 13, 2025
Microsoft logo
Microsoft
Hard
Data Scientist

Implement lower_bound on unknown-size sorted array

Lower Bound in Unknown-Length Nondecreasing Array via API Setup You are given a non-decreasing integer array A of unknown length n. You cannot access ...

Coding & Algorithms
3
0
52 people solved
Oct 13, 2025
DoorDash logo
DoorDash
Medium
Data Scientist

Implement minimum window substring with counts

Implement min_window_with_counts(s, t) Task Write a function: - min_window_with_counts(s: str, t: str) -> tuple[int, int] that returns the inclusive (...

Coding & Algorithms
8
0
103 people solved
Oct 13, 2025
Pinterest logo
Pinterest
Easy
Data Scientist

Compute average unique pins per user

Task: Average Unique Pins Per User You are given a mapping from user IDs to their lists of pin IDs. Implement a function that computes the mean number...

Coding & Algorithms
12
0
87 people solved
Oct 13, 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