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
LinkedIn logo
LinkedIn
Medium
Machine Learning Engineer

Find shortest word transformation with caching

Find shortest word transformation with caching You are given a start word and an end word of equal length, and a dictionary of valid words. In one mov...

Coding & Algorithms
10
0
95 people solved
Jul 16, 2025
LinkedIn logo
LinkedIn
Medium
Machine Learning Engineer

Compute total covered interval length

Compute total covered interval length Given a list of integer intervals [l, r) (half-open), compute the total length covered by at least one interval....

Coding & Algorithms
13
0
107 people solved
Jul 16, 2025
Apple logo
Apple
Medium
Software Engineer

Maximize funds with capital-gated projects

Maximize funds with capital-gated projects You start with initial funds W and may undertake at most K projects. Each project i has a required capital ...

Coding & Algorithms
4
0
59 people solved
Jul 16, 2025
Veeva Systems logo
Veeva Systems
Medium
Software Engineer

Compute build order from dependencies

Compute build order from dependencies You are given a directed graph represented as a mapping where each key X maps to a list of tasks that depend on ...

Coding & Algorithms
3
0
42 people solved
Jul 16, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Compute sum of longest positive subarray

Compute sum of longest positive subarray Given an integer array that may contain positive and negative numbers, find the sum of the longest contiguous...

Coding & Algorithms
6
0
47 people solved
Jul 16, 2025
Airbnb logo
Airbnb
Medium
Software Engineer

Design and implement Connect Four engine

Design and implement a Connect Four game engine. Use a default 6x7 board and two players. Provide an API with: drop(col, player) returning the row pla...

Coding & Algorithms
14
0
126 people solved
Jul 16, 2025
Optiver logo
Optiver
Medium
Software Engineer

Count nonnegative buy/sell sequences

You must perform exactly 2n unit trades starting with 0 shares and ending with 0 shares. Each trade is either a buy (+1 share) or a sell (−1 share), a...

Coding & Algorithms
18
0
131 people solved
Jul 16, 2025
Morgan Stanley logo
Morgan Stanley
Medium
Software Engineer

Compute minimal cost to merge numbers

Compute minimal cost to merge numbers Given an array of positive integers, you may repeatedly perform the following operation until one number remains...

Coding & Algorithms
4
0
42 people solved
Jul 16, 2025
Uber logo
Uber
Medium
Software Engineer

Simulate robot on grid with obstacles

Simulate robot on grid with obstacles A robot starts at (0, 0) on an unbounded integer grid. You are given a sequence of commands consisting of charac...

Coding & Algorithms
7
0
80 people solved
Jul 15, 2025
Google logo
Google
Medium
Software Engineer

Decide string transform with directional tokens and walls

Decide string transform with directional tokens and walls You are given two equal-length strings start and target of length n, each consisting only of...

Coding & Algorithms
5
0
60 people solved
Jul 15, 2025
SoFi logo
SoFi
Medium
Software Engineer

Design a key-value store with getLast

Design a key-value store with getLast Design and implement an in-memory key–value store with this API: add(key, value), get(key), remove(key), and get...

Coding & Algorithms
11
0
83 people solved
Jul 15, 2025
Meta logo
Meta
Medium
Software Engineer

Solve tree traversal and two-pointer problems

Solve tree traversal and two-pointer problems Implement the following independent problems: 1) Vertical columns: Given a binary tree, return lists of ...

Coding & Algorithms
3
0
40 people solved
Jul 15, 2025
Meta logo
Meta
Medium
Software Engineer

Copy linked list with random pointers efficiently

Copy linked list with random pointers efficiently Given the head of a singly linked list where each node has next and random pointers, create a deep c...

Coding & Algorithms
1
0
31 people solved
Jul 15, 2025
Meta logo
Meta
Medium
Software Engineer

Merge two sorted arrays in-place

Merge two sorted arrays in-place You are given two sorted integer arrays nums1 and nums2, both sorted in non-decreasing order. - nums1 has length m + ...

Coding & Algorithms
3
0
42 people solved
Jul 15, 2025
Meta logo
Meta
Medium
Software Engineer

Maximize number with one digit swap

Maximize number with one digit swap Given a non-negative integer n (as an int or string), perform at most one swap of two digits to produce the maximu...

Coding & Algorithms
2
0
31 people solved
Jul 15, 2025
Meta logo
Meta
Medium
Software Engineer

Validate word abbreviation and reconcile two abbreviations

Validate word abbreviation and reconcile two abbreviations Implement a function isValidAbbreviation(word: string, abbr: string) that returns true if a...

Coding & Algorithms
3
0
35 people solved
Jul 15, 2025
Amazon logo
Amazon
Medium
Software Engineer

Find first unique character

Find first unique character Given a lowercase/uppercase alphanumeric string s, return the index of the first character that appears exactly once; if n...

Coding & Algorithms
3
0
32 people solved
Jul 15, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Design Efficient Multi-Level Access Control System

Scenario Multi-level access control lists (country → city) must be queried quickly. Question Design and implement a permission system where each geogr...

Coding & Algorithms
7
0
7 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Maximize Non-Overlapping Task Scheduling Efficiency

Scenario Job scheduler on a single machine wants to maximise throughput. Question Given tasks with [start, end) times, return the maximum number of no...

Coding & Algorithms
13
0
9 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Implement Data Structure for Top-K Elements in Streams

Scenario Analytics feature that must constantly report the K largest numbers seen so far. Question Implement a data structure that ingests a stream of...

Coding & Algorithms
27
0
79 people solved
Jul 12, 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