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

Build a Quadtree and Analyze a Graph

Solve the following two coding problems. 1. Build a quadtree from an image You are given an N x N matrix of integers representing an image, where N is...

Coding & Algorithms
8
0
62 people solved
Dec 28, 2025
Tesla logo
Tesla
Medium
Software Engineer

Optimize Trapping Rain Water

Question LeetCode 42. Trapping Rain Water – implement a brute-force solution, analyze its complexity, then optimize to an O(n) solution with O(n) spac...

Coding & Algorithms
10
0
92 people solved
Aug 4, 2025
NVIDIA logo
NVIDIA
Medium
Software Engineer

Construct tree from inorder & postorder

Question LeetCode 106. Construct Binary Tree from Inorder and Postorder Traversal – Given the inorder and postorder traversal arrays of a binary tree,...

Coding & Algorithms
7
0
64 people solved
Aug 4, 2025
Instacart logo
Instacart
Medium
Software Engineer

Solve bank, password, expression algorithm tasks

Solve bank, password, expression algorithm tasks Implement a banking system that supports four specified operations within 90 minutes. Implement a pas...

Coding & Algorithms
6
0
99 people solved
Aug 4, 2025
Google logo
Google
Medium
Software Engineer

Solve tree, graph, sliding-window problems

Question LeetCode 103. Binary Tree Zigzag Level Order Traversal – given a binary tree root, return its zigzag level-order traversal. LeetCode 207. Cou...

Coding & Algorithms
12
0
89 people solved
Aug 4, 2025
Meta logo
Meta
Medium
Software Engineer

Solve linked-list and top-K algorithm tasks

Question Given a singly linked list, return the k-th node counted from the end. Given an integer array, return the top k most frequent numbers. Given ...

Coding & Algorithms
6
0
52 people solved
Aug 4, 2025
Spokeo logo
Spokeo
Medium
Data Scientist

Solve Logic Puzzles: Algorithms and Proofs Required

Solve Logic Puzzles: Algorithms and Proofs Required Scenario On-site logic/algorithm quiz with hiring manager and VP Question Solve six AMC-8–level ma...

Coding & Algorithms
4
0
34 people solved
Aug 4, 2025
Meta logo
Meta
Medium
Data Scientist

Optimize Travel Costs and Generate Rotational Symmetric Numbers

Scenario You are building a travel-search engine that must 1) show customers the cheapest round-trip they can book if departure and return prices vary...

Coding & Algorithms
8
0
59 people solved
Aug 4, 2025
PayPal logo
PayPal
Medium
Data Scientist

Count Word Frequency and Print Top Three Words

Scenario First-round Python coding screening Question Using only basic Python, write a function that receives a list of strings and returns a dictiona...

Coding & Algorithms
7
0
52 people solved
Aug 4, 2025
Jane Street logo
Jane Street
Medium
Machine Learning Engineer

Connect-N on an Infinite Board with Gravity

You are asked to implement a variant of the classic Connect Four game, played on an unbounded board. Game Rules - The board consists of vertical colum...

Coding & Algorithms
1
0
17 people solved
Dec 26, 2025
DocuSign logo
DocuSign
Medium
Software Engineer

Implement a key-value CRUD store

Implement an in-memory key–value store that supports create, read, update, and delete operations. Expose APIs such as put(key, value), get(key), updat...

Coding & Algorithms
15
0
116 people solved
Aug 1, 2025
Google logo
Google
Medium
Software Engineer

Validate course catalog dependencies

Design a function to validate an e-learning course catalog. You are given: ( 1) a set of course IDs, and ( 2) a list of prerequisite pairs (u, v) mean...

Coding & Algorithms
4
0
62 people solved
Aug 1, 2025
Figma logo
Figma
Medium
Software Engineer

Design document editor with undo/redo and batching

Design a document-editing layer that supports applying edits and undo. Implement an API with apply(Operation op), undo(), and getText(). Then add tran...

Coding & Algorithms
22
1
345 people solved
Aug 1, 2025
Snapchat logo
Snapchat
Medium
Software Engineer

Solve rotating-lock BFS with blockers

You are given a 4-digit lock starting at "0000". In one move, you may pick a single position and rotate it +1 or −1 with wrap-around (0→9 on −1, 9→0 o...

Coding & Algorithms
2
0
49 people solved
Jul 31, 2025
Fidelity logo
Fidelity
Medium
Software Engineer

Describe Java 8 features

Describe Java 8 features What are the key new features introduced in Java 8? Explain when and how you would use lambda expressions, the Stream API, Op...

Coding & Algorithms
5
0
44 people solved
Jul 31, 2025
Applied Intuition logo
Applied Intuition
Medium
Software Engineer

Design duplicate-file detection using size

You are given a large POSIX-like filesystem containing millions of files across nested directories. Design an algorithm to find groups of duplicate fi...

Coding & Algorithms
10
0
77 people solved
Jul 31, 2025
Duolingo logo
Duolingo
Medium
Software Engineer

Design an Animal Chess OOP simulation

Design and implement a simplified Animal Chess (Dou Shou Qi) game using object-oriented principles. Include: 1) Piece classes Elephant, Lion, Tiger, L...

Coding & Algorithms
9
0
67 people solved
Jul 31, 2025
Current logo
Current
Medium
Software Engineer

Solve transaction aggregation and search tasks

Solve transaction aggregation and search tasks Complete the following coding tasks: (a) Given a list of transactions, each with userId and amount (cre...

Coding & Algorithms
5
0
89 people solved
Jul 31, 2025
LinkedIn logo
LinkedIn
Medium
Software Engineer

Analyze time and space complexity

Analyze time and space complexity For any algorithm you implement, analyze its time and space complexity using Big-O notation. Derive and justify the ...

Coding & Algorithms
5
0
60 people solved
Jul 31, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Implement sliding-window moving average

Design a class MovingAverage that supports a constructor MovingAverage(k) and a method next(val) returning the average of the last k values from a dat...

Coding & Algorithms
5
2
46 people solved
Jul 31, 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