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

Select next Hangman letter

Given the current state of a Hangman game, implement a function that selects the next letter with the highest likelihood of appearing in the secret wo...

Coding & Algorithms
17
0
165 people solved
Sep 6, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Compute exclusive times and call stack from logs

Design an algorithm that, given a single-threaded program's execution log, computes per-function exclusive durations and reconstructs the active call ...

Coding & Algorithms
14
0
174 people solved
Sep 6, 2025
Motive logo
Motive
Medium
Software Engineer

Implement Union-Find and track components

Implement a Disjoint Set Union (Union-Find) data structure with union by rank and path compression. Design the API to support union(a, b), connected(a...

Coding & Algorithms
5
0
41 people solved
Sep 6, 2025
Rippling logo
Rippling
Medium
Software Engineer

Design a music player with favorites cap

Implement an in-memory music player that supports: addSong(id, metadata), removeSong(id), play(id), pause(), next(), prev(), getNowPlaying(), queueSon...

Coding & Algorithms
25
0
198 people solved
Sep 6, 2025
IBM logo
IBM
Medium
Software Engineer

Implement valid 1-D convolution with bias

Question Implement a "valid" 1-D convolution function in the cross-correlation sense. Given an input array of numbers, a kernel (filter) array of numb...

Coding & Algorithms
2
0
39 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Software Engineer

Compute waits and find distance-k node pairs

Part 1 — Array next-higher wait: Given an integer array A where A[i] is the measurement for day i (0-indexed), return an array W of the same length su...

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

Implement a min-heap column allocator

You are given an integer k (number of columns) and an array posts of positive integers where posts[i] is the height of the i-th post. All columns star...

Coding & Algorithms
22
0
187 people solved
Sep 6, 2025
Apple logo
Apple
Medium
Software Engineer

Design card deck with shuffle and order

Design a playing-card deck library with two methods: shuffle() to return a uniformly random permutation of a standard 52-card deck, and order() to ret...

Coding & Algorithms
3
0
68 people solved
Sep 6, 2025
TikTok logo
TikTok
Medium
Software Engineer

Design LRU cache with O(1) operations

Design and implement an in-memory cache that evicts the least recently used entry when capacity is reached. Support get(key) and put(key, value) in O(...

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

Design an O(1) recency-evicting cache

Design and implement a fixed-capacity in-memory cache that supports get(key) and put(key, value) in average O( 1) time. When capacity is exceeded, evi...

Coding & Algorithms
7
0
99 people solved
Sep 6, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Design high-throughput hashing for kernels

Design a high-throughput hash-based lookup to be called inside a tight kernel. Choose between open addressing and chaining, specify the load factor, p...

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

Validate alternating checkout/return logs

Given a chronological list of events logs of the form (timestamp, book_id, is_checkout) where is_checkout is True for a checkout and False for a retur...

Coding & Algorithms
8
0
59 people solved
Sep 6, 2025
Atlassian logo
Atlassian
Medium
Software Engineer

Implement snake game and find org LCA

Part A — Snake Game Engine: Implement a grid-based snake game. The board has height H and width W (0-indexed, row-major). The snake starts at (0, 0) m...

Coding & Algorithms
5
0
67 people solved
Sep 6, 2025
Anthropic logo
Anthropic
Medium
Software Engineer

Implement file deduplication at scale

Implement a command-line tool to find duplicate files in a directory tree. Use OS/pathlib primitives to recursively enumerate files. Apply prefilters ...

Coding & Algorithms
18
0
152 people solved
Sep 6, 2025
Applied Intuition logo
Applied Intuition
Medium
Software Engineer

Design a coupon pricing engine

Design and implement a coupon application engine for a shopping cart. Each Item has id, category, and unitPrice. A Coupon has: applicableCategories (o...

Coding & Algorithms
9
0
131 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Find kth smallest in sorted matrix

Given an n x n matrix where each row and each column is sorted in nondecreasing order, and an integer k (1 ≤ k ≤ n^ 2), return the k-th smallest eleme...

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

Compute binary tree left-side view

Given a binary tree, return the values visible from the left side when looking from top to bottom. If multiple nodes exist at the same depth, the left...

Coding & Algorithms
4
0
50 people solved
Sep 6, 2025
Uber logo
Uber
Medium
Software Engineer

Implement 2D word search variants and analyze complexity

Given an m x n grid of uppercase letters board and a string word, implement two related functions: ( 1) Fixed-direction search: Return true if word ap...

Coding & Algorithms
6
0
58 people solved
Sep 6, 2025
Disney logo
Disney
Medium
Software Engineer

Implement BFS shortest path in grid

Implement a function that returns the length of the shortest path in an unweighted 2D grid from the top-left cell (0, 0) to the bottom-right cell (m-1...

Coding & Algorithms
4
0
54 people solved
Sep 6, 2025
Kickoff logo
Kickoff
Medium
Software Engineer

Generate boolean truth table

Implement a function that, given a string boolean expression, outputs a complete truth table. The expression syntax is: variables are single uppercase...

Coding & Algorithms
3
0
53 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