Google DS & Algo Round Interview Questions in 2026
Google Interview Prep · 2026

Google DS & Algo Round Interview Questions in 2026

This list is built from Google interview experiences posted on forums/blogs etc in 2026.

What successful candidates had in common

There are two common things about candidates who clear Google interviews and for whom overall process is smooth.

At least 2 "Strong-Hire" votes and no "No-Hire" in the on-site packet.

Candidates who narrated trade-offs and edge cases, and correctly answered counter questions, got bumped from "Hire" to "Strong Hire".

Point 2 is also valid for other top tech companies like Microsoft, Amazon, Meta, etc.

Trade-offs Edge cases Counter questions Strong-Hire

Important topics

Google has one of the toughest DS & Algo rounds in the industry. DSA rounds are there for both frontend and backend roles.

DP, Graph, and Line Sweep are important topics.

Google's interview codebase is very large, with questions of all difficulty levels from super easy to super hard.

DP Graph Line Sweep

PS:

All Questions List: https://codezym.com/lld/google

We keep updating and adding more DSA questions to above list.

I also take LLD mock interviews: https://topmate.io/prashant_priyadarshi

Follow r/LowLevelDesign for more companywise interview question lists.

Questions directly available on LeetCode for Free

1 Minimum Window Substring leetcode.com/problems/minimum-window-substring
2 Meeting Rooms III leetcode.com/problems/meeting-rooms-iii
3 Longest Duplicate Substring leetcode.com/problems/longest-duplicate-substring
4 Decode String leetcode.com/problems/decode-string
5 Decode Ways leetcode.com/problems/decode-ways
6 Path With Minimum Effort leetcode.com/problems/path-with-minimum-effort
7 Course Schedule II leetcode.com/problems/course-schedule-ii
8 Sum of Distances in Tree leetcode.com/problems/sum-of-distances-in-tree
9 Course Schedule leetcode.com/problems/course-schedule
10 House Robber leetcode.com/problems/house-robber
11 Special Array II leetcode.com/problems/special-array-ii
12 Lowest Common Ancestor of a Binary Tree leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
13 Guess the Word leetcode.com/problems/guess-the-word
14 First Bad Version leetcode.com/problems/first-bad-version
15 Partition Equal Subset Sum leetcode.com/problems/partition-equal-subset-sum
16 Number of Visible People in a Queue leetcode.com/problems/number-of-visible-people-in-a-queue
17 Find if Path Exists in Graph leetcode.com/problems/find-if-path-exists-in-graph
18 Permutation Sequence leetcode.com/problems/permutation-sequence
19 Positions of Large Groups leetcode.com/problems/positions-of-large-groups
20 Find First and Last Position of Element in Sorted Array leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
21 Expressive Words leetcode.com/problems/expressive-words
22 Top K Frequent Elements leetcode.com/problems/top-k-frequent-elements
23 Happy Number leetcode.com/problems/happy-number

More frequently asked DS & Algo questions

The questions below are frequently asked in Google interview rounds. Their problem statements also include follow-up questions asked by interviewers.

1. Compress String using Prefix Pattern

You are given an undirected tree where each node contains exactly one lowercase English letter. You are also given a string s.

For every prefix of s, find how many times that prefix appears in the tree.

Practice Link: https://codezym.com/question/137

2. Detect First Timed Out Job from Logs

You are given a list of logs for jobs, requests, or RPC calls.

Each log entry contains:

a job id

a timestamp

an event type: START or END

You are also given an integer timeoutThreshold.

A job starts when its START log appears and finishes when its matching END log appears.

A job is considered timed out if either:

its END log appears and endTimestamp - startTimestamp > timeoutThreshold, or

at a current scan timestamp t, if t - startTimestamp > timeoutThreshold even though its END log has not appeared yet.

Process the logs in chronological order and detect the earliest timeout that becomes known while scanning the logs.

Practice Link: https://codezym.com/question/138

3. Count Visible People in Queue with Taller Observer Rule

There are n people standing in a queue from left to right, numbered from 0 to n - 1. You are given a list heights of distinct integers where heights[i] represents the height of the ith person.

A person may look both to the left and to the right.

Person i can see person j if i != j and every person standing strictly between them is shorter than at least one of the two endpoint people.

More formally, let left = min(i, j) and right = max(i, j). Person i can see person j if:

max(heights[i], heights[j]) > max(heights[left + 1], heights[left + 2], ..., heights[right - 1])

If there is no person between them, then they can always see each other.

This means that if one endpoint person is taller than everyone in between, then that endpoint can still see the other person even if some shorter intermediate people are present.

Return a list answer of length n where answer[i] is the number of people person i can see in the queue.

Practice Link: https://codezym.com/question/139

4. Maximum Sum Subarray with Equal First and Last Elements

Given a list of integers, find the maximum sum of a contiguous subarray such that the first and last elements of the subarray are equal.

Practice Link: https://codezym.com/question/140

5. Design a rate limiter

Design an in-memory rate limiter . Implement a RateLimiter Class with an isAllowed method.

Requests will be made to different resourceIds. Each resourceId will have a strategy associated with it .

Practice Link: https://codezym.com/question/34

6. Longest Constrained Path in Matrix

You are given a grid of positive integers.

The grid is provided as a list of strings, where each string represents one row and the values in that row are separated by commas.

Find the length of the longest valid path in the grid.

Practice Link: https://codezym.com/question/141

7. Repeated Characters in Dictionary Words Due To Faulty Keyboard

A user has a faulty keyboard where some keys get stuck, causing characters to repeat more than intended.

You are given the final typed string and a dictionary of valid words.

Return all possible words the user intended to type.

Practice Link: https://codezym.com/question/142

8. Detect Squares Rotated along the XY Plane

You are given a stream of points on the X-Y plane.

Design a data structure that supports adding points from the stream and counting how many squares can be formed with a given query point.

Unlike the simpler axis-aligned version, the square may be rotated at any angle on the plane.

Practice Link: https://codezym.com/question/143

9. Sum of All Good Arithmetic Sequences

An arithmetic sequence is a list of numbers where the difference between every pair of adjacent elements is the same constant.

A good arithmetic sequence is an arithmetic sequence whose common difference is either 1 or -1.

For example, [4, 5, 6] is a good arithmetic sequence, and any sequence that has only one element is also a good arithmetic sequence.

You are given a list of integers nums. Return the sum of the sums of all contiguous subarrays that are good arithmetic sequences.

Practice Link: https://codezym.com/question/144

10. Compile Packages with Dependencies in a Multi-Threaded Environment

You are given a dependency graph of packages to compile in a multithreaded environment.

Return the order in which packages are compiled across all rounds.

Practice Link: https://codezym.com/question/145

11. Equal Sum Subsets with K Changes

You are given a list of integers nums.

Divide the list into two non-empty disjoint subsets such that every element of nums belongs to exactly one subset.

The two subsets form valid equal sum parts if the sum of the values in the first subset is the same as the sum of the values in the second subset.

Number of elements in subsets may be different.

Practice Link: https://codezym.com/question/146

12. Undirected Graph Path Queries

You are given a list of integers arr of size N, and an integer diff.

Consider an undirected graph where each node corresponds to one index of arr.

Add an edge between nodes i and j if |arr[i] - arr[j]| ≤ diff.

You are also given a list of queries queries, where each query is a comma-separated string "u,v". For each query, return whether there is a path between node u and node v.

Practice Link: https://codezym.com/question/147

13. Array Range Update Queries

You are given an array arr of size n and q queries.

Each query updates all elements from index l to index r to value k.

Return the final state of the array after processing all queries in order.

There are two variations:

All queries use the same value k.

Different queries may use different values k.

Practice Link: https://codezym.com/question/148

14. Router Reachability on Broadcast and Shutdown Message

You are given a network of routers.

Each router has:

a unique router id

a 2D location (x, y)

a status indicating whether it is WORKING or DEFECTIVE

A special message called Broadcast and Shutdown works as follows:

When a WORKING router receives the message for the first time, it immediately broadcasts the same message to every other WORKING router that lies within the wireless range.

After broadcasting, that router shuts down and can no longer send or receive messages.

A DEFECTIVE router can neither send nor receive the message.

Given the list of routers, the wireless range, a source router id, and a destination router id, determine whether the Broadcast and Shutdown message, when initiated from the source router, will eventually be received by destination router.

Two routers can communicate directly if the Euclidean distance between their coordinates is less than or equal to range.

Return true if the destination router receives the message at any point. Otherwise, return false.

Practice Link: https://codezym.com/question/149

15. First Bad Product Version

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.

Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad.

You are given an API boolean isBadVersion(int version) which returns whether a version is bad. Implement a function to find the first bad version.

Practice Link: https://codezym.com/question/150

16. Design Logger Message Printer

Design a logger system that processes a stream of messages along with their timestamps.

Each unique message can be printed at most once within any 10 second window. That means if a message is printed at timestamp t, the same message cannot be printed again before timestamp t + 10.

Practice Link: https://codezym.com/question/151

17. Longest Path in Grid

Given a 2D grid, it contains empty spaces 0 and some walls 1.

We can enter the grid from any empty cell in the first row and exit the grid from any empty cell in the last row. We can move left, right, up, and down. We can only travel through empty cells.

Find the longest path we can travel.

Practice Link: https://codezym.com/question/152

18. Merge Working Hour Intervals Timeline

Person name and their working hours are given.

Return the timeline that tells the time interval and whoever is working during that interval.

Each person is represented by one string entry containing the person name, start time, and end time.

A person is considered working at both startTime and endTime.

Split the full timeline into the smallest non-overlapping time intervals such that the set of working people stays the same throughout each interval.

Return only the intervals where at least one person is working.

Practice Link: https://codezym.com/question/153

19. Days When Everyone is Free

You are given a list of records and an integer d representing the range of days from 1 to d.

Each record represents one blocked interval for one person.

Each record is given as a string in the format "id,start,end".

A record "id,start,end" means person id is not available on every day from start to end, inclusive.

Return all days between 1 and d on which every person is free. This list will be sorted in ascending order.

Practice Link: https://codezym.com/question/154

20. Size of Unpainted Segments

You are given a list of half-open intervals.

Each interval represents a segment on the number line in the form [start, end).

We paint the intervals one by one in the given order.

For each interval, return the size of the part that has not already been painted by any previous interval.

Return a list where the value at index i is the size of the newly painted segment contributed by the ith interval.

Practice Link: https://codezym.com/question/155

21. Overall Distance Error Between Checkpoints and Samples

There are two sorted streams by timestamp.

The first stream contains a small set of ground truth checkpoints.

The second stream contains noisy measured samples.

For each sample, compute its error by:

locating the surrounding checkpoints in time,

interpolating the expected position at that timestamp,

computing the distance error between the expected position and the sample position.

Return the sum of the distance errors for all valid samples.

Practice Link: https://codezym.com/question/156

22. Minimum CPUs Needed for Earliest Tasks Completion

You are given a list of task start times and an integer taskLength.

Each task has the same length taskLength.

A task may start at its given start time or at any later time.

A CPU can run at most one task at a time.

Once a task starts on a CPU, it runs continuously for exactly taskLength time units.

Find the minimum number of CPUs needed so that all tasks finish as early as possible.

Practice Link: https://codezym.com/question/157

23. Total Scores of Leaf Domains

You are given a list of domain names and an integer score for each of them.

A domain is a leaf if it does not have any child domains in the input.

A leaf domain's total score is the sum of:

its own score, and

the scores of all of its ancestor domains that are present in the input.

Write a program that, given the input list, returns all leaf domains with their respective total scores.

Practice Link: https://codezym.com/question/158

24. Place Nth Rook

You are given an N x N chess board.

There are already N - 1 rooks placed on the board.

These rooks do not attack each other. More formally:

no row contains more than one rook

no column contains more than one rook

You need to place the Nth rook and return the position (i, j) where it should be placed.

Practice Link: https://codezym.com/question/159