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
Medium
Machine Learning EngineerSenior+ Locked

Implement Linear Regression Training

This question evaluates understanding of linear regression, mean squared error loss, gradient computation, parameter updates, and proficiency with vec...

Coding & Algorithms
1
0
26 people solved
Mar 31, 2026
Salesforce logo
Salesforce
Medium
Software Engineer

Flatten nested JSON into a string map

Problem You are given an input JSON object that may contain nested objects and arrays. Your task is to flatten it into a single-level key/value mappin...

Coding & Algorithms
37
0
264 people solved
Oct 18, 2025
Uber logo
Uber
Medium
Software Engineer

Produce a valid deployment order

You are given N services and a list of dependency pairs (A, B) meaning service B must be deployed before service A. Compute any valid deployment order...

Coding & Algorithms
15
0
105 people solved
Aug 12, 2025
DoorDash logo
DoorDash
Medium
Machine Learning Engineer

Find closest value to a target in a BST

Problem Given the root of a binary search tree (BST) and a floating-point number target, return the value in the BST that is closest to target. If the...

Coding & Algorithms
8
0
87 people solved
Oct 17, 2025
Akuna Capital logo
Akuna Capital
Medium
Data Scientist

Compute delivery order via BFS

Compute delivery order via BFS A city road network is an unweighted, undirected graph G(V, E) with a depot node s and D delivery requests located at n...

Coding & Algorithms
5
0
62 people solved
Aug 10, 2025
Anthropic logo
Anthropic
Hard
Software Engineer

Find duplicate files and apply image operations

Part A — Find duplicate files by content You are given a list of directory records. Each record is a string describing a directory path followed by on...

Coding & Algorithms
115
0
772 people solved
Oct 15, 2025
Medium
Data Scientist

Write mini-batch gradient descent

Implement a generic mini-batch gradient descent routine: inputs are differentiable loss L(θ; x), initial θ0, batch size b, steps T, and learning-rate ...

Coding & Algorithms
4
0
42 people solved
Oct 13, 2025
Medium
Data Scientist

Implement KNN from scratch

Without using ML libraries, implement k-Nearest Neighbors for classification. Requirements: (a) Support Euclidean and cosine distances; (b) Allow tie-...

Coding & Algorithms
5
0
42 people solved
Oct 13, 2025
Dropbox logo
Dropbox
Medium
Data Scientist

Review checkout code for defects and privacy

You are reviewing a supermarket checkout implementation. Identify and prioritize issues and fixes across: (a) monetary correctness (avoid floating poi...

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

Design airport dispatch with ETA uncertainty

You control airport pickups with streaming ETAs for arriving flights and live driver locations/queues. Design an online dispatch algorithm that minimi...

Coding & Algorithms
15
0
103 people solved
Oct 13, 2025
Point72 logo
Point72
Hard
Data Scientist

Solve date, shopping, and circle problems

Take‑Home: Three Independent Tasks (Data/Algorithms) Implement three independent functions that will be unit‑tested separately. Provide clear error ha...

Coding & Algorithms
4
0
73 people solved
Oct 13, 2025
Yahoo logo
Yahoo
Medium
Data Scientist

Merge words by head-tail chaining

Given a list of lowercase words, merge them into a single string by repeatedly chaining words where the last character of the current string equals th...

Coding & Algorithms
5
0
44 people solved
Oct 13, 2025
PayPal logo
PayPal
Medium
Software Engineer

Compare final, finally, finalize

Compare final, finally, finalize Compare Java's final keyword, the finally block, and the finalize() method. For each, explain purpose, typical use ca...

Coding & Algorithms
5
0
63 people solved
Aug 7, 2025
PayPal logo
PayPal
Medium
Software Engineer

Assess HashMap vs ConcurrentHashMap

Assess HashMap vs ConcurrentHashMap Is Java's HashMap thread-safe? Explain why or why not. How does ConcurrentHashMap achieve thread safety and perfor...

Coding & Algorithms
5
0
56 people solved
Aug 7, 2025
Akuna Capital logo
Akuna Capital
Hard
Data Scientist

Find minimum swaps to sort array with duplicates

Problem Given an integer array nums of length n that may contain duplicate values, you may perform swaps where you choose any two indices i and j and ...

Coding & Algorithms
7
0
143 people solved
Dec 27, 2025
Box logo
Box
Medium
Software Engineer

Solve classic troubleshooting & algorithm tasks

Solve classic troubleshooting & algorithm tasks System failure troubleshooting: You can only SSH into the machine and the log file is huge. How would ...

Coding & Algorithms
24
0
181 people solved
Aug 4, 2025
Akuna Capital logo
Akuna Capital
Medium
Data Scientist

Design streaming stats with sliding window

Design streaming stats with sliding window Design a data structure that ingests an integer stream and supports online queries for maximum, mean, and m...

Coding & Algorithms
5
0
47 people solved
Aug 1, 2025
Amazon logo
Amazon
Medium
Software Engineer

Solve string partition and equal-sum package problems

Solve string partition and equal-sum package problems 1) Given a string itemCategories (lowercase English letters) and an integer k (0 ≤ k ≤ 26), coun...

Coding & Algorithms
2
0
44 people solved
Aug 1, 2025
Google logo
Google
Medium
Machine Learning Engineer

Implement a Transformer Block with SwiGLU

Implement a Transformer-style neural network block in Python using either NumPy or PyTorch. Your implementation should include: 1. Multi-head self-att...

Coding & Algorithms
0
0
8 people solved
Dec 24, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find the K-th Smallest Value in Two Sorted Arrays

Find the K-th Smallest Value in Two Sorted Arrays Given two nondecreasing integer arrays and a one-based integer k, return the k-th smallest value in ...

Coding & Algorithms
0
0
1 people solved
Mar 26, 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