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

Build blog UI with API data and likes

You are asked to implement a small single-page web application in JavaScript (you may use any modern framework or plain JavaScript) to display and int...

Coding & Algorithms
5
0
47 people solved
Nov 20, 2025
Rippling logo
Rippling
Medium
Software EngineerIntern

Find median of two sorted arrays

You are given two sorted arrays of integers nums1 and nums2 in non-decreasing order. Let the lengths be m = nums1.length and n = nums2.length. Either ...

Coding & Algorithms
18
0
136 people solved
Nov 20, 2025
Tradedesk logo
Tradedesk
Medium
Machine Learning Engineer

Design a time-travel key-field store with TTL

Problem Implement an in-memory “database” that stores records by key and fields within each key. Each operation is given a timestamp (integer, non-dec...

Coding & Algorithms
5
0
91 people solved
Nov 19, 2025
Anthropic logo
Anthropic
Hard
Software Engineer

Implement staircase printing and distributed mode/median

Problem A: Print a “staircase” pattern Implement a function that prints a staircase with n rows. Input - An integer n (n >= 1) Output - Print n lines....

Coding & Algorithms
67
0
923 people solved
Nov 19, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Merge overlapping intervals

You are given an array of intervals, where each interval is represented as a pair of integers [start, end] with start <= end. The intervals may be uns...

Coding & Algorithms
3
0
55 people solved
Nov 19, 2025
Amazon logo
Amazon
Medium
Machine Learning Engineer

Implement decoder-only GPT-style transformer

Goal Implement a simplified decoder-only Transformer language model (similar in spirit to GPT) for next-token prediction. The implementation should be...

Coding & Algorithms
20
0
173 people solved
Nov 18, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Find max consecutive elements with sum below target

You are given: - An integer array nums of length n, sorted in non-decreasing order. - An integer index such that 0 ≤ index < n. - An integer target. S...

Coding & Algorithms
8
0
84 people solved
Nov 17, 2025
Uber logo
Uber
Hard
Software Engineer

Check feasibility of AI course schedule

You are designing a learning path for n AI-related courses, labeled from 0 to n - 1. Some courses have prerequisites. For example, to take course b, y...

Coding & Algorithms
7
0
79 people solved
Nov 17, 2025
Optiver logo
Optiver
Hard
Software EngineerNew Grad

Cargo Order Allocation Across Departing Planes

A freight company assigns incoming shipping orders to a fixed fleet of cargo planes. You must implement the order-processing logic: decide whether eac...

Coding & Algorithms
0
0
10 people solved
Nov 16, 2025
Google logo
Google
Medium
Software Engineer

Compute minimal transfers to settle group expenses

Problem A group of friends go on a trip and share expenses. Each expense is recorded as an object: - payer (string): who paid the full amount - amount...

Coding & Algorithms
11
0
81 people solved
Nov 16, 2025
Navan logo
Navan
Medium
Software Engineer

Design time-based key-value store

Design an in-memory key-value store that supports time-based lookups. Operations Implement a class (or module) with the following methods: 1. set(key,...

Coding & Algorithms
6
0
117 people solved
Nov 7, 2025
Affirm logo
Affirm
Easy
Software Engineer

Implement an LRU cache

Problem Design and implement an LRU (Least Recently Used) cache that supports the following operations in average O(1) time: - get(key) -> value: Retu...

Coding & Algorithms
10
0
89 people solved
Nov 6, 2025
Applovin logo
Applovin
Hard
Software Engineer

Count invalid nodes in a BST

You are given the root of a binary tree. A valid Binary Search Tree (BST) must satisfy: for every node with value v, all values in its left subtree ar...

Coding & Algorithms
6
0
49 people solved
Nov 3, 2025
Google logo
Google
Easy
Software Engineer

Find k pairs with smallest sums

You are given two sorted integer arrays arr1 and arr2 (each sorted in non-decreasing order), and an integer k. Consider all possible pairs formed by t...

Coding & Algorithms
10
0
74 people solved
Nov 1, 2025
Schonfeld logo
Schonfeld
Medium
Data Scientist

Compute probability last passenger gets own seat

There are 100 passengers boarding a plane with 100 seats, numbered 1 to 100. Passenger i (for 1 ≤ i ≤ 100) has a ticket for seat i. The boarding proce...

Coding & Algorithms
2
0
40 people solved
Nov 1, 2025
Amazon logo
Amazon
Medium
Software EngineerIntern Locked

Implement nested object path lookup

This question evaluates parsing and traversal of nested maps and arrays, robust error handling for missing keys and out-of-bounds indices, and reasoni...

Coding & Algorithms
3
0
37 people solved
Oct 31, 2025
Bloomberg logo
Bloomberg
Medium
Software Engineer

Answer multi-round grid and data-structure questions

You are given several independent interview-style coding questions. 1) Find first/last occurrence in sorted array (+ dynamic updates follow-ups) Given...

Coding & Algorithms
18
0
135 people solved
Oct 30, 2025
Meta logo
Meta
Medium
Software Engineer Locked

Implement several string, tree, and BFS problems

This multi-part problem evaluates proficiency with core data structures and algorithms: binary tree traversal with column-aligned output, string parsi...

Coding & Algorithms
6
0
50 people solved
Oct 30, 2025
Apple logo
Apple
Medium
Software EngineerSenior+

Solve Digit-Square and Grid BFS Problems

Solve the following coding problems. Problem 1: Digit-square convergence Given a positive integer n, repeatedly replace n with the sum of the squares ...

Coding & Algorithms
0
0
9 people solved
Oct 28, 2025
Affirm logo
Affirm
Medium
Software Engineer Locked

Find shortest unique substring per word

This question evaluates string-processing and algorithmic problem-solving skills, focusing on identifying substrings unique to each word while handlin...

Coding & Algorithms
11
0
86 people solved
Oct 27, 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