Google Software Engineer Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Parse strings and find meeting slots
Question Given a text file where each line contains raw information, extract the user identifier and the numeric quantity on that line and store the r...
Remove elements to avoid k-prefix duplicates
Question Given two lists listA and listB and an integer k, delete elements from listB so that the first k elements of the new listB share no value wit...
Show leadership and teamwork
Behavioral Leadership Question Context You are in an onsite software engineering behavioral and leadership interview. The interviewer wants to assess ...
Find shortest path with blocked nodes
Question Given an unweighted graph, a start node, an end node, and a block_set of nodes that cannot be traversed, return the length of the shortest pa...
Compute city skyline outline
You are given a list of rectangular buildings in a 2D city skyline. Each building is represented by three integers [L, R, H]: - L: the x-coordinate of...
Explain handling a tight project deadline
In a behavioral interview for a software engineering or technical role, you are asked: > Describe a time you had to work under a very tight deadline. ...
Describe a conflict with a colleague
In a behavioral interview for a software engineering or technical role, you are asked: > Tell me about a time you had a conflict or disagreement with ...
Describe a major challenge you faced
In a behavioral interview for a software engineering or technical role, you are asked: > Describe the most significant challenge you have faced in an ...
Shuffle array using random integer API
You are given an array nums of length n representing a deck of distinct cards. You do not have access to a built-in shuffle function, but you are give...
Find maximum value in huge text file
You are given the path to a very large text file on disk. The file has the following properties: - Each line contains exactly one signed 64-bit intege...
Find longest duplicated substring
You are given a string s consisting of lowercase English letters. A substring of s is any contiguous sequence of characters, i.e., s[i..j) for 0 ≤ i <...
Find largest digit-sharing subset
You are given an array of N integers. Each integer has exactly two decimal digits (i.e., each element is between 10 and 99 inclusive). You want to cho...
Solve chat, grid paths, and car rentals
You are given three independent programming tasks. For each, describe and implement an efficient algorithm, and be prepared to analyze its time and sp...
Add two big integers from digit lists
You are given two non-empty singly linked lists (or arrays) representing two non-negative integers. The digits are stored in reverse order, and each n...
Handle joining overworked low-WLB team
Scenario You have just joined a new engineering team. You quickly notice that: - Every team member appears very busy and often works long hours. - Wor...
Find safe travel intervals between planet influences
You are planning a space route along a one-dimensional line (the x-axis). You are given a list of planets. Each planet is represented by an integer pa...
Count same-color squares in a character grid
You are given a 2D grid (matrix) of characters. Each character represents a color: cells with the same character are considered the same color. Formal...
Minimize calls to find all bad test pairs
You have \(n\) atomic tests \(t_1, t_2, \dots, t_n\). You are given access to a black-box function: `python bool runTest(set<Test> S) ` which behaves ...
Find shared objects across two log files
You are given two large log files representing activity on two different days. Each line of each log has three fields: - timestamp: a time value (you ...
Compute servers needed for daily recurring jobs
You operate a cluster of identical servers that run recurring daily jobs. For a single day, you are given a list of job execution intervals. Each inte...