101 problems · 20 Easy, 58 Medium, 23 Hard · Ranked #7 of 459
Difficulty breakdown
20 Easy
20% · avg 23%
58 Medium
57% · avg 59%
23 Hard
23% · avg 18%
Top topics
array
48.5%
string
26.7%
hash-table
17.8%
depth-first-search
16.8%1.8x
dynamic-programming
14.9%
sorting
13.9%
Interview profile
Based on 101 reported problems, Google interviews are slightly harder than average - 23% Hard vs 18% across all companies. The majority (57%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.
Compared to the industry average, Google puts unusual emphasis on line-sweep (2% of problems, 9.6x the industry average), binary-indexed-tree (2% of problems, 4.5x the industry average), segment-tree (2% of problems, 3.3x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (48.5%), string (26.7%), hash-table (17.8%), depth-first-search (16.8%). Problems below are sorted by frequency, the ones at the top are asked most often.
All 101 problems
Problem
Difficulty
Frequency
Topics
Two Sum
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
There is a tree of n nodes labeled from 0 to n - 1, rooted at node 0. You are given a 0-indexed integer array vals of length n where vals[i] denotes the value o...
You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (inclusive)....
You have a graph of n nodes labeled from 0 to n - 1. You are given an integer n and a list of edges where edges[i] = [ai, bi] indicates that there is an undirec...
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...
Number of Connected Components in an Undirected Graph
You have a graph of n nodes. You are given an integer n and an array edges where edges[i] = [ai, bi] indicates that there is an edge between ai and bi in the gr...
Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive c...
You are given an array of strings ideas that represents a list of names to be used in the process of naming a company. The process of naming a company is as fol...
There are n dominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to the left or...
A triplet is an array of three integers. You are given a 2D integer array triplets, where triplets[i] = [ai, bi, ci] describes the ith triplet. You are also giv...
You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing...
There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an...
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length...
The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two midd...
Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justifie...
You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and interv...
Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <=...
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and heights of...
Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and...
According to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway...
Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked li...
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:
Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf to root).
There is a row of n houses, where each house can be painted one of three colors: red, blue, or green. The cost of painting each house with a certain color is di...
There is a tree of n nodes labeled from 0 to n - 1, rooted at node 0. You are given a 0-indexed integer array vals of length n where vals[i] denotes the value o...
You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (inclusive)....
You have a graph of n nodes labeled from 0 to n - 1. You are given an integer n and a list of edges where edges[i] = [ai, bi] indicates that there is an undirec...
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...
MediumVery Likely
linked-listmathrecursion
Number of Connected Components in an Undirected Graph
You have a graph of n nodes. You are given an integer n and an array edges where edges[i] = [ai, bi] indicates that there is an edge between ai and bi in the gr...
Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive c...
You are given an array of strings ideas that represents a list of names to be used in the process of naming a company. The process of naming a company is as fol...
There are n dominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to the left or...
A triplet is an array of three integers. You are given a 2D integer array triplets, where triplets[i] = [ai, bi, ci] describes the ith triplet. You are also giv...
You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing...
There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an...
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length...
The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two midd...
HardLikely
two-pointersdesignsorting
Find the Index of the First Occurrence in a String
Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justifie...
You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and interv...
Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <=...
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and heights of...
Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and...
According to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway...
Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked li...
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition:
Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf to root).
There is a row of n houses, where each house can be painted one of three colors: red, blue, or green. The cost of painting each house with a certain color is di...
MediumRare
arraydynamic-programming
How often are these problems asked?
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Google interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Preparing for your Google coding interview
Google interviews focus heavily on array, string, hash-table problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.
Beyond solving problems, practice explaining your approach. Google interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.
What coding problems does Google ask in interviews?add
Google has been reported to ask 101 distinct coding problems. The most common topics are array, string, hash-table. 20 are Easy difficulty, 58 are Medium, and 23 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
How hard are Google coding interviews?add
Based on 101 reported problems, Google interviews are slightly harder than average - 23% Hard vs 18% across all companies. 57% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
How should I prepare for a Google coding interview?add
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, hash-table. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real Google coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.