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

Count user sessions from logs

Given a large log file where each line is "timestamp,user,action", compute the number of sessions per user. Assume a session ends if the gap between c...

Coding & Algorithms
11
0
82 people solved
Sep 6, 2025
PayPal logo
PayPal
Medium
Machine Learning Engineer

Maximize ones with limited flips

Given a binary array and an integer k, return the length of the longest contiguous subarray achievable by flipping at most k zeros to ones. Explain an...

Coding & Algorithms
3
0
45 people solved
Sep 6, 2025
PayPal logo
PayPal
Medium
Machine Learning Engineer

Search a word in a grid

Given a 2D grid of characters and a target word, determine if the word can be traced by moving up, down, left, or right, using each cell at most once....

Coding & Algorithms
3
0
45 people solved
Sep 6, 2025
Microsoft logo
Microsoft
Medium
Software Engineer

Solve load balancing and perfect pairs

1) Contiguous load balancing: You have n identical resources (servers) and m ordered tasks with processing times burstTime[0..m-1]. Each server must b...

Coding & Algorithms
10
0
72 people solved
Sep 6, 2025
Intuit logo
Intuit
Medium
Software Engineer

Implement LRU, Extend to LFU, Analyze Complexity

Implement an in-memory Least Recently Used (LRU) cache with capacity N that supports get(key) -> value and put(key, value). Achieve O( 1) average time...

Coding & Algorithms
3
0
67 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Compute grid shortest path with obstacles

You are given an m x n grid of integers where cells with value -1 represent obstacles and all other cells are traversable. Starting at (0, 0) and targ...

Coding & Algorithms
5
0
38 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Detect cycles in lists and graphs

Given a singly linked list, determine whether it contains a cycle. Implement an O( 1)-space algorithm and explain the intuition and correctness. Follo...

Coding & Algorithms
3
0
29 people solved
Sep 6, 2025
LinkedIn logo
LinkedIn
Medium
Software Engineer

Solve six algorithmic problems

Answer the following independent algorithmic prompts. For each, explain your approach, justify data structures, analyze time/space complexity, and pro...

Coding & Algorithms
7
0
135 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Solve jumps and anagram-similarity problems

You are given two independent tasks. Task A (Maximize calories over jumps): - There are n blocks with integer heights height[i] ≥ 0. - You start on th...

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

Implement automatic braking logic in Python

Using Python, implement a simple automatic braking function. Given current speed v (m/s), distance to obstacle d (m), maximum deceleration a_max (m/s^...

Coding & Algorithms
3
0
54 people solved
Sep 6, 2025
Bloomberg logo
Bloomberg
Medium
Software Engineer

Count subarrays with product under target

Given an array of positive integers nums and an integer T > 1, return the number of contiguous subarrays whose product is strictly less than T. Provid...

Coding & Algorithms
1
0
36 people solved
Sep 6, 2025
Airtable logo
Airtable
Medium
Software Engineer

Implement BFS serializer and deserializer

Implement two functions, serialize(obj) -> representation and deserialize(representation) -> obj, for a Python object graph containing str, int, and d...

Coding & Algorithms
24
0
191 people solved
Sep 6, 2025
Amazon logo
Amazon
Medium
Software Engineer

Maximize credits with limited skips

You are given n warehouses with inventories inventory[0..n-1], and two dispatch amounts: you dispatch dispatch1 units first each turn, then your co-wo...

Coding & Algorithms
2
0
26 people solved
Sep 6, 2025
Snowflake logo
Snowflake
Medium
Software Engineer

Design error detection and propagation algorithms

You are given three related sub-problems about error detection and propagation. A) Log search: You have a chronologically ordered array of log lines. ...

Coding & Algorithms
4
0
32 people solved
Sep 6, 2025
Palo Alto Networks logo
Palo Alto Networks
Medium
Software Engineer

Mirror a binary tree and analyze complexity

Given the root of a binary tree, convert it to its mirror by swapping every node’s left and right children. Implement both recursive and iterative (us...

Coding & Algorithms
5
0
43 people solved
Sep 6, 2025
Palo Alto Networks logo
Palo Alto Networks
Medium
Software Engineer

Find normalized list difference efficiently

Given two lists of strings, list1 and list2, return all elements that appear in list1 but not in list2 after applying a consistent normalization step ...

Coding & Algorithms
4
0
52 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Compute top-N active customers

Maintain and return the top N customers by cumulative activity amount, where activity is defined as the sum of deposit amounts, pay amounts, and trans...

Coding & Algorithms
5
0
40 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Fill rooms with nearest gate distances

You are given an m×n integer grid representing rooms, where -1 is a wall, 0 is a gate, and INF (a large sentinel such as 2^31− 1) is an empty room. Fo...

Coding & Algorithms
1
0
26 people solved
Sep 6, 2025
Akuna Capital logo
Akuna Capital
Medium
Software Engineer

Compute min operations to transform integers

Given integers A and B, transform A into B using the minimum number of operations. Allowed operations: ( 1) subtract 1 from the current value; ( 2) mu...

Coding & Algorithms
3
0
50 people solved
Sep 6, 2025
Optiver logo
Optiver
Medium
Data Scientist

Solve a Skyscraper puzzle efficiently

Design and implement a solver for the Skyscraper logic puzzle on an $N \times N$ grid, where $3 \le N \le 7$. The board is a grid of building heights....

Coding & Algorithms
47
0
329 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