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

Compute prices, distances, and Top-K for orders

Compute prices, distances, and Top-K for orders Build functions for a food‑delivery analytics module. Data: - Restaurants: id, (x, y) location, menu m...

Coding & Algorithms
13
0
99 people solved
Jul 31, 2025
xAI logo
xAI
Medium
Software Engineer

Design a Least Frequently Used (LFU) Cache with O(1) Operations

Design and implement a data structure for a least frequently used (LFU) cache. Implement a class LFUCache with the following operations: - LFUCache(in...

Coding & Algorithms
0
0
10 people solved
Jul 30, 2025
Ramp logo
Ramp
Medium
Software Engineer

Navigate maze via HTTP API

Question Implement a program that repeatedly calls a provided HTTP API which returns the next URL in a maze; continue following the URLs until reachin...

Coding & Algorithms
13
0
53 people solved
Jul 29, 2025
LinkedIn logo
LinkedIn
Medium
Software Engineer

Find lowest common ancestor

Question LeetCode 236. Lowest Common Ancestor of a Binary Tree — Given a binary tree, find the lowest common ancestor (LCA) of two given nodes. Follow...

Coding & Algorithms
8
0
37 people solved
Jul 29, 2025
Ramp logo
Ramp
Medium
Software Engineer

Find exit URL via BFS API calls

Question Design and implement a function that, given a starting URL "/", performs BFS or DFS by repeatedly sending HTTP GET requests of the form GET "...

Coding & Algorithms
97
0
310 people solved
Jul 29, 2025
Meta logo
Meta
Medium
Software Engineer

Compute product of array except self

Given an integer array nums, return an array out where out[i] equals the product of all elements in nums except nums[i]. Do it in O(n) time using cons...

Coding & Algorithms
2
0
24 people solved
Jul 29, 2025
Pinterest logo
Pinterest
Medium
Software Engineer

Find minimal time to serve customers

Find minimal time to serve customers You manage a bank with k tellers; teller i takes serviceTimes[i] minutes to serve one customer and works continuo...

Coding & Algorithms
5
0
91 people solved
Jul 28, 2025
Apple logo
Apple
Medium
Software Engineer Locked

Find k Smallest Pair Sums

This question evaluates skills in algorithm design, working with sorted arrays, pairing and ordering elements, and analyzing time and space complexity...

Coding & Algorithms
9
0
65 people solved
Dec 22, 2025
OpenAI logo
OpenAI
Medium
Software Engineer

Implement an expiring GPU credits ledger

Implement an expiring GPU credits ledger for multiple users with three operations: 1) add_credit(user_id, amount, expiry_time): add a lot of credits t...

Coding & Algorithms
51
0
424 people solved
Jul 27, 2025
Lyft logo
Lyft
Medium
Software Engineer

Implement paginated retrieval of transactions

Implement paginated retrieval of transactions Given a large list of transaction records (id, userId, amount, createdAt), implement APIs to return tran...

Coding & Algorithms
11
0
168 people solved
Jul 27, 2025
TikTok logo
TikTok
Medium
Software Engineer

Solve top-K and string rotation match

Solve top-K and string rotation match 1) Given an unsorted array of integers and an integer k, return the k largest elements in descending order. Impl...

Coding & Algorithms
2
0
41 people solved
Jul 26, 2025
Palantir logo
Palantir
Medium
Software Engineer

Solve two algorithm problems from a menu

Choose two problems from an algorithms menu (arrays, strings, hash maps, graphs). For each: 1) state clarifying assumptions, 2) implement a correct so...

Coding & Algorithms
13
0
129 people solved
Jul 26, 2025
Retool logo
Retool
Medium
Software Engineer

Compute max profit with forced trades

Compute max profit with forced trades Given an array prices where prices[i] is the stock price on day i, solve two related tasks under a forced-trade ...

Coding & Algorithms
11
0
82 people solved
Jul 26, 2025
NVIDIA logo
NVIDIA
Medium
Software Engineer Locked

Solve anagram grouping and in-place allocator

This two-part question evaluates algorithmic problem-solving across string grouping and constrained in-place memory allocation, testing string-process...

Coding & Algorithms
6
0
53 people solved
Dec 21, 2025
Salesforce logo
Salesforce
Medium
Software Engineer

Solve array duplicate flags and binary swaps

Problem 1: Flag duplicates on the left and right You are given an integer array nums of length n. For each index i, determine: 1. Left-duplicate: whet...

Coding & Algorithms
26
0
187 people solved
Dec 17, 2025
TikTok logo
TikTok
Medium
Software Engineer

Implement O(1) randomized multiset

Implement O(1) randomized multiset Write code for a data structure that supports add(x), remove(x), and getRandom() in average O( 1) time where duplic...

Coding & Algorithms
2
0
40 people solved
Jul 17, 2025
Stripe logo
Stripe
Medium
Software Engineer

Implement tiered shipping calculator

Implement tiered shipping calculator Implement in JavaScript a shipping-cost calculator with three progressively richer pricing models based on a conf...

Coding & Algorithms
4
0
37 people solved
Jul 17, 2025
HubSpot logo
HubSpot
Easy
Software Engineer

Find a special person using knows(a,b)

Problem You are given n people labeled 0 to n-1 at a party. You can call an API: - knows(a, b) -> bool: returns true if person a knows person b, other...

Coding & Algorithms
13
0
102 people solved
Dec 15, 2025
Meta logo
Meta
Easy
Software Engineer

Merge overlapping time intervals

Problem You are given a list of closed intervals intervals, where each interval is [start, end] and start <= end. Merge all intervals that overlap and...

Coding & Algorithms
2
0
34 people solved
Dec 15, 2025
Google logo
Google
Medium
Software Engineer

Compute shortest delivery route with dangerous stops

Delivery Route Planning With Dangerous Stops You are given delivery stops (nodes) and a set of routes. Each route is a list of stops, and you can trav...

Coding & Algorithms
15
0
153 people solved
Dec 15, 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