Google DS and Algo Interview Questions 2026
Google interview preparation

Google DS & Algo Interview Questions 2026

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

DP Graph Line Sweep

Google's interview codebase is very large, with questions of all difficulty levels from super easy to super hard. One question can be a medium question with a couple of follow-ups for optimizations, or it can be just one hard question. It all depends on which question the interviewer chooses.

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

  1. At least 2 "Strong-Hire" votes and no "No-Hire" in the on-site packet.
  2. Candidates who narrated trade-offs and edge cases, and correctly answered counter questions, got bumped from "Hire" to "Strong Hire" even with small bugs.

Now above points have lots of exceptions. For example one person bombed one coding round badly. But they were given a redo by their recruiter. It was late 2024 and he was working long hours, spending even the weekends on call. Still he was laid off alongside other teammates.

Lay off was a blow to his morale. He didn't tell even his parents, just pretended he was working from home. Avoided video calls during "work hours". Initially he spent the days watching anime. But slowly preparation started and when the Google call came, he has already been rejected by multiple companies.

He thought it was all over after he messed up one DSA round. But he was able to do well in the redo round and finally ended up receiving the offer.

Judging how the interview went

Many a times you may not be able to guess correctly , how well or how bad you did. There are tons of experiences where candidate thought something and the opposite happend. A lot of things can go right or wrong. One person had done 400+ leetcode problems but during interviews, panic setup and they were able to only come up with a brute force solution.

Another person had two back to back coding rounds scheduled at a gap of just 15 minutes. And during the first round they realised that solution they provided is incorrect. They thought that they had bombed this round and should just cancel the next round. But interviewer provided some guidance and they were able to solve slightly easier version of the problem. However other rounds went well and they ended up receiving the offer.

What if you are rejected

Even if you are rejected its not the end of world. Google recruiters will almost certainly reach out to you a year later. Just keep preparing. One person was rejected by google for L4 position in 2024. But they reapplied 6 months later and surprisingly got a response. However their first two coding rounds got lean hire. Still recruiter decided to go through with other rounds which wents well. During hiring committee their prospects were weak because of two lean hires in coding. However another DSA round was scheduled for them in which they did well.

They ended up receiving offer for L5. That's like getting a promotion within one year. Although they were lowballed but still it was a 20% raise from their current salary. So overall not a bad end.

I created this list from people posting their experiences on forums, blogs, etc.

Below are the questions which you can directly find on LeetCode.

LeetCode Questions

CodeZym practice questions

The summaries below were prepared from the actual CodeZym problem statements. Each question is presented in its own row so the list remains comfortable to scan.

417

Shortest Word Tile Group

In a word game, lowercase letter tiles are arranged in a row. You want to take one continuous group of tiles and use its letters to form a given word. Find the shortest continuous group containing enough letters to form the word after rearranging them.

https://codezym.com/question/417-min-piano-hand-lifts
419

Longest Repeated Activity Pattern

A factory machine records its activities using lowercase letters from 'a' to 'z'. Each letter represents one activity. For example, 'a' may mean idle, 'b' may mean loading material, 'c' may mean processing, and 'd' may mean inspecting the finished product. Find the longest continuous activity pattern that appears at least twice in the machine's activity log.

https://codezym.com/question/419-longest-repeated-activity-pattern
305

Subset Sum Equal to K

Given a list of integers nums and an integer k, determine whether any subset of the list has a sum equal to k. Each element may be selected at most once. A subset does not need to contain consecutive elements. The empty subset is allowed and has a sum of 0.

https://codezym.com/question/305-subset-sum-equal-to-k
421

Minimum Suspension Strength

A warehouse robot moves across a rectangular floor divided into tiles. Each tile has a surface resistance value. The strain caused by moving between two neighboring tiles is the absolute difference between their resistance values. The suspension strength needed for a route is the largest strain produced by any move on that route.

https://codezym.com/question/421-minimum-suspension-strength
413

Longest Learning Progression

A learning app stores the difficulty level of each lesson completed by a student. The lesson levels appear in chronological order. For the main task, the student wants to build a step-by-step learning progression. Each selected lesson after the first must be exactly one level harder than the previous selected lesson. Return the length of the longest learning progression.

https://codezym.com/question/413-longest-learning-progression
414

Periodic Table Word Ways

You are given a list of chemical element symbols and a word. Count the number of different ways to form the entire word by joining symbols from the list. Symbols may be reused, and matching is case-insensitive. Each character of the word must belong to exactly one selected symbol.

https://codezym.com/question/414-periodic-table-word-ways
415

Chess Players Rank

There are n chess players numbered from 0 to n - 1. You are given the results of some games. Each result is represented by the string "u,v", meaning player u defeated player v. A smaller numerical rank represents a stronger player, and the stronger player always wins. Use the known results and their transitive relationships to determine which players have an exact rank.

https://codezym.com/question/415-chess-players-rank
416

Minimum Piano Hand Lifts

You are given a sequence of piano notes and a maximum hand span k. Each note is represented by its integer position on the keyboard. During one hand placement, the difference between the leftmost and rightmost playable keys cannot exceed k. If the next note cannot be reached from the current placement, the hand must be lifted and positioned again.

https://codezym.com/question/416-min-piano-hand-lifts
309

Total Number of Ways to Decode a Message

A message containing letters from A to Z is represented using numbers from 1 to 26. Given a digit string s, return the total number of valid ways to decode the entire string. Encoding A -> 1 B -> 2 ... Z -> 26 Every digit must belong to a valid one-digit or two-digit encoding. A segment cannot begin with 0, so values such as "0", "06", and "30" cannot be decoded as individual letters.

https://codezym.com/question/309-number-of-ways-to-decode-message
137

Count String Prefixes on Tree Paths

For every prefix of s, find how many times that prefix appears in the tree. A prefix appears in the tree if you can choose an ordered simple path of nodes such that the sequence of letters on that path is exactly equal to that prefix.

https://codezym.com/question/137-string-prefix-on-tree-paths
336

Valid Course Order with Prerequisites

There are numCourses courses labeled from 0 to numCourses - 1. Some courses must be completed before other courses can be taken. Each prerequisite is represented by a string "course,prerequisite". It means that prerequisite must be completed before course. Return an order in which all courses can be completed.

https://codezym.com/question/336-valid-course-order
138

Detect First Timed Out Job from Logs

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. Return the id of the first job that is detected to have timed out.

https://codezym.com/question/138-detect-first-timed-out-job-logs
139

Count Visible People in Queue with Taller Observer Rule

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. Return a list answer of length n where answer[i] is the number of people person i can see in the queue.

https://codezym.com/question/139-count-visible-people-queue-taller
372

Maximum Score from Non-Adjacent Tiles

A game contains tiles with non-negative scores. A player may select tiles to collect their scores, but two neighboring tiles cannot both be selected. Determine the maximum score the player can collect when the tiles are arranged in a straight line and when they are arranged in a circle. Rules Each tile may be selected at most once. Two neighboring tiles cannot both be selected.

https://codezym.com/question/372-max-score-from-non-adjacent-tiles
144

Sum of All Good Arithmetic Sequences

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.

https://codezym.com/question/144-sum-good-arithmetic-sequences
147

Undirected Graph Path Queries

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.

https://codezym.com/question/147-undirected-graph-path-queries
150

First Bad Product Version

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. You should minimize the number of calls to the API. Method Signatures

https://codezym.com/question/150-first-bad-product-version
152

Longest Path in Grid

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.

https://codezym.com/question/152-longest-path-grid
154

Days When Everyone is Free

Each record represents one blocked interval for one person. Each record is given as a string in the format "id,start,end". Return all days between 1 and d on which every person is free. This list will be sorted in ascending order.

https://codezym.com/question/154-days-when-everyone-is-free
155

Size of Unpainted Segments

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.

https://codezym.com/question/155-size-of-unpainted-segments
156

Overall Distance Error Between Checkpoints and Samples

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.

https://codezym.com/question/156-distance-error-checkpoints-samples
158

Total Scores of Leaf Domains

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.

https://codezym.com/question/158-total-scores-leaf-domains
159

Place Nth Rook

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.

https://codezym.com/question/159-place-nth-rook

Thanks for reading

Wish you the best of luck with your Google interview preparation.