Google Interview Questions (44+ Questions)
Last Updated: June 8, 2026 • 44 Questions • Real Company Interviews
Prepare for your Google interview with our comprehensive collection of 44+ real interview questions and detailed answers. These questions have been curated from actual Google technical interviews across various roles including DevOps Engineer, Data Engineer, QA Engineer, and more.
Table of Contents
- Validating Network Routes (medium)
- Detecting High CPU Usage (medium) 🔒
- Rapid Disk Growth on /var (hard)
- Detect Memory Leak by Monitoring RSS (medium)
- Debug TLS to HTTP Mismatch (medium) 🔒
- Troubleshoot and Fix Deployment Scheduling Configuration (medium) 🔒
- Viewing systemd Service Logs from Current Boot (easy) 🔒
- Evaluate Reverse Polish Notation (medium)
- Reverse Linked List (easy)
- Linked List Cycle (easy)
- Maximum Depth of Binary Tree (easy)
- Decoupled Job Processing with SQS, ECS and ALB (medium)
- Architect a Secure Edge to Origin Delivery Architecture (medium)
- Filter Orders by Date Range (easy)
- Pivot Daily Sales (easy) 🔒
- Using COALESCE to Handle Nulls (easy) 🔒
- Calculate Descriptive Statistics for Numeric Columns in Pandas (easy)
- Window Functions without Partitions (medium)
- Calculating Average Building Height (easy)
- Filter Employees by Department (medium) 🔒
- Query to Detect Gaps in Data (medium) 🔒
- Re-enrollment Rate Calculator (medium)
- Event Stream Deduplicator (medium)
- Min Stack (medium)
- Design Twitter (medium)
- Design Add and Search Words Data Structure (medium)
- Implement Trie (Prefix Tree) (medium)
- LRU Cache (medium)
- Continuous Subarray Sum (medium)
- Accounts Merge (medium)
- Subarray Sum Equals K (medium)
- Sliding Window Median (hard)
- Median Search Frequency (hard)
- Add Two Numbers (medium)
- Supplier Delivery Time Analyzer (medium) 🔒
- Interactive Sales Funnel Analyzer (easy) 🔒
- Customer Churn Rate Calculator (medium) 🔒
- Top Seller by Region with RANK() (medium) 🔒
- Complex Aggregation and Join: Employee Project Assignments and Salary Calculation (hard) 🔒
- Payment Processing API Testing (medium) 🔒
- Video Conference API Testing (hard) 🔒
- User Authentication API Testing (medium) 🔒
- Dynamic Table Data Extraction Testing (medium) 🔒
- Multi-Window Context Switching Testing (hard) 🔒
Our Google interview questions cover a wide range of technical topics and difficulty levels, from entry-level positions to senior roles. Each question includes detailed explanations and answers to help you understand the concepts and prepare effectively for your interview.
💡 Pro Tips for Google Interviews
- Practice each question and understand the underlying concepts
- Review Google's specific technologies and methodologies
- Prepare follow-up questions and edge cases
- Practice explaining your solutions clearly and concisely
Interview Questions & Answers
1. Validating Network Routes
Learn how to inspect, modify, and verify routing table entries on Linux using Bash commands. This guide covers detecting incorrect routes, deleting problematic entries, and adding new routes through specific gateways and interfaces essential for fixing routing misconfigurations and ensuring proper traffic flow in multi-interface networks.
2. Detecting High CPU Usage
3. Rapid Disk Growth on /var
Learn how to identify and analyze large files consuming disk space in /var using Linux Bash commands. This guide covers recursive file searching, sorting by size, generating size reports, and pinpointing space consuming services, essential for troubleshooting disk capacity issues and optimizing log retention policies in production systems.
4. Detect Memory Leak by Monitoring RSS
Detect and diagnose memory leaks in Linux processes by monitoring RSS (Resident Set Size) growth over time. Learn how to track process memory consumption, identify steadily increasing memory usage patterns, confirm memory leaks through repeated sampling, and remediate by terminating leaking processes. This guide covers using ps to extract RSS values, detecting memory growth trends, distinguishing between normal memory fluctuations and actual leaks, and implementing automated memory monitoring. Essential for preventing OOM killer events, debugging long-running services, maintaining production stability, and identifying memory-intensive processes that require code fixes.
5. Debug TLS to HTTP Mismatch
Diagnose and fix TLS/HTTPS protocol mismatches in microservices receiving encrypted traffic instead of plain HTTP. Learn how to identify protocol mismatches by analyzing network traffic with packet capture, recognize TLS handshake data in service logs, and implement TLS termination using openssl s_server or similar tools. This guide covers understanding client-server protocol expectations, using tcpdump to inspect incoming traffic, fixing load balancer configuration issues, and ensuring proper TLS decryption before forwarding to HTTP backends. Essential for microservices debugging, load balancer troubleshooting, and resolving mysterious connection failures in containerized environments.
6. Troubleshoot and Fix Deployment Scheduling Configuration
Debug Kubernetes pod scheduling issues: fix NodeSelector misconfigurations, implement PriorityClass, and resolve Pending pods. Master K8s scheduling troubleshooting.
7. Viewing systemd Service Logs from Current Boot
Investigate a failed systemd service by extracting and saving its complete journal logs from the current boot session using journalctl with appropriate filtering options.
8. Evaluate Reverse Polish Notation
def eval_rpn(tokens: list[str]) -> int:
stack = []
for c in tokens:
if c == "+":
stack.append(stack.pop() + stack.pop())
elif c == "-":
b, a = stack.pop(), stack.pop()
stack.append(a - b)
elif c == "*":
stack.append(stack.pop() * stack.pop())
elif c == "/":
b, a = stack.pop(), stack.pop()
stack.append(int(a / b))
else:
stack.append(int(c))
return stack[0]
9. Reverse Linked List
Definition for singly-linked list.
class ListNode:
def init(self, val=0, next=None):
self.val = val
self.next = next
def reverse_list(head: Optional[ListNode]) -> Optional[ListNode]:
prev = None
curr = head
while curr:
nxt = curr.next
curr.next = prev
prev = curr
curr = nxt
return prev
10. Linked List Cycle
Definition for singly-linked list.
class ListNode:
def init(self, x):
self.val = x
self.next = None
def has_cycle(head: Optional[ListNode]) -> bool:
slow, fast = head, head
while fast and fast.next:
slow = slow.next
fast = fast.next.next
if slow == fast:
return True
return False
11. Maximum Depth of Binary Tree
Definition for a binary tree node.
class TreeNode:
def init(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
def max_depth(root: Optional[TreeNode]) -> int:
if not root:
return 0
return 1 + max(max_depth(root.left), max_depth(root.right))
12. Decoupled Job Processing with SQS, ECS and ALB
Deploy a decoupled job processing architecture on AWS using SQS for message queuing, ECS Fargate for running API and worker containers, and an Application Load Balancer for public access, with proper VPC networking, security groups, and least privilege IAM roles.
13. Architect a Secure Edge to Origin Delivery Architecture
Test your AWS architecture skills by designing a secure, globally distributed web application using CloudFront, an internal Application Load Balancer, and Route 53 with strict origin isolation.
14. Filter Orders by Date Range
How to Construct an SQL Query to Fetch Order Details within a Specific Date Range
If you're preparing for an interview, crafting a precise SQL query to fetch order details is a skill you need to master. The task involves fetching order_id, customer_name, order_date, and total_amount from the orders table, only for orders placed between January 1, 2023, and June 30, 2023. The results must be sorted by order_date in ascending order. Here’s a step-by-step guide on how to nail this:
SQL Query Example
To achieve this, you need to follow these pointers:
- Select the desired columns:
order_id,customer_name,order_date, andtotal_amount. - Filter the results to only include orders where the
order_datefalls inclusively between '2023-01-01' and '2023-06-30'. - Order the results by
order_datein ascending order to get the earliest orders at the top.
Here is the SQL query you need:
SELECT order_id, customer_name, order_date, total_amount
FROM orders
WHERE order_date BETWEEN '2023-01-01' AND '2023-06-30'
ORDER BY order_date ASC;
Explanation
- FROM orders: Indicates the data source, which is the
orderstable. - SELECT order_id, customer_name, order_date, total_amount: Specifies the columns you want to retrieve.
- WHERE order_date BETWEEN '2023-01-01' AND '2023-06-30': Filters the results to include only those orders placed within the defined date range.
- ORDER BY order_date ASC: Ensures that the output is sorted by
order_datein ascending order.
This query effectively pulls the required data while maintaining the specified conditions and ordering.
Conclusion
Being able to craft an SQL query that accurately fetches order details based on specific criteria is crucial for data analysis and reporting. This particular query showcases your ability to filter data by date and sort it effectively, ensuring that you can produce meaningful and organized insights from your data tables. Practice writing and running similar queries to enhance your SQL skills and be interview-ready.
15. Pivot Daily Sales
How to Transform Sales Data for Specific Dates with SQL
Objective: In this task, you are required to utilize your SQL skills to transform sales data from a table named Sales. The table includes three significant attributes: product_name, sale_date, and sales_amount. Your goal is to ...
🔒 Premium Content
Detailed explanation and solution available for premium members.
16. Using COALESCE to Handle Nulls
Detailed Explanation of SQL Query to Retrieve Order Information
If you're preparing for a technical interview and face a question related to extracting data from an SQL table, it's crucial to demonstrate both your understanding of SQL functions and your ability to solve problems efficiently. Be...
🔒 Premium Content
Detailed explanation and solution available for premium members.
17. Calculate Descriptive Statistics for Numeric Columns in Pandas
Read a CSV file with mixed data types, calculate descriptive statistics (mean, median, std, min, max, quartiles) for numeric columns only, and save results as a formatted CSV report using pandas.
18. Window Functions without Partitions
Master global sorting and sequential numbering in PySpark. Learn how to join DataFrames and use the row_number() window function across an entire unpartitioned dataset.
19. Calculating Average Building Height
Master mathematical operations in PySpark. Learn how to perform column-wise division, handle division-by-zero errors gracefully using F.when(), and round your results to a specific decimal place.
20. Filter Employees by Department
Detailed Explanation for SQL Query to Retrieve Sales Department Employee Details
Optimizing for search engines while still creating informative content is essential for ranking highly in search results, especially for competitive keywords such as "SQL query join tables." Here's an SEO-friendly ...
🔒 Premium Content
Detailed explanation and solution available for premium members.
21. Query to Detect Gaps in Data
Identifying Gaps Between Consecutive Dates
Interview questions that test your ability to identify gaps between consecutive dates involve both problem-solving and SQL query skills. You will be provided with a table named dates that contains a column date, listing specific, sorted, and unique...
🔒 Premium Content
Detailed explanation and solution available for premium members.
22. Re-enrollment Rate Calculator
Objective
Write a SQL query to calculate the re-enrollment rate of students based on their consecutive term enrollments. The re-enrollment rate is defined as the percentage of students who have enrolled in two or more consecutive terms.
Additional Information
- Consecutive terms are identified by increasing term_ids without any gaps.
- The result should be rounded to two decimal places.
- Output the re-enrollment rate as a percentage.
- Constraints:
student_idis an integer identifier for each student.term_idis an integer identifier for each term.course_idis a string identifier for each course.
- The
enrollmentstable schema:student_id(INT)term_id(INT)course_id(VARCHAR)
Detailed Explanation
To calculate the re-enrollment rate of students, consider these steps:
Identify Consecutive Terms for Each Student:
- Use window functions to determine contiguous sequences of term_ids for each student.
- Group the terms into sequences where the difference between each student's term_id and its corresponding row number partitioned by student_id remains constant.
Count the Number of Consecutive Term Enrollments:
- Filter the groups to retain only those sequences with two or more consecutive terms.
- Count the number of students in these groups.
Calculate Total Students:
- Determine the total number of unique students to calculate the denominator for the re-enrollment rate.
Compute the Re-enrollment Rate:
- Calculate the percentage of students with re-enrolled terms by dividing the number of students with consecutive enrollments by the total number of unique students.
- Multiply by 100 to convert the fraction to a percentage and round to two decimal places.
Example SQL Solution:
WITH consecutive_enrollments AS (
SELECT
student_id,
term_id,
LEAD(term_id) OVER(PARTITION BY student_id ORDER BY term_id) AS next_term_id
FROM enrollments
),
enrolled_twice_or_more AS (
SELECT DISTINCT
student_id
FROM consecutive_enrollments
WHERE next_term_id = term_id + 1
),
total_students AS (
SELECT COUNT(DISTINCT student_id) AS total
FROM enrollments
)
SELECT
ROUND(
(SELECT COUNT(*) FROM enrolled_twice_or_more) * 100.0 / (SELECT total FROM total_students),
2
) AS re_enrollment_rate;
This SQL query efficiently determines the re-enrollment rate by leveraging window functions and common table expressions (CTEs). It identifies students with consecutive term enrollments, calculates the total number of unique students, and then computes the percentage of students re-enrolled in consecutive terms. The final output is rounded to two decimal places, satisfying the problem requirements. This solution effectively handles the constraints and delivers a precise re-enrollment rate.
23. Event Stream Deduplicator
class Deduplicator:
def init(self, ttl):
self.ttl = ttl
self.seen = {}
def process(self, timestamp, eventId):
expired = [k for k, t in self.seen.items() if timestamp - t > self.ttl]
for k in expired:
del self.seen[k]
if eventId in self.seen:
self.seen[eventId] = timestamp
return False
self.seen[eventId] = timestamp
return True
24. Min Stack
class MinStack:
def init(self):
self.stack = []
self.min_stack = []
def push(self, val: int) -> None:
self.stack.append(val)
if self.min_stack:
self.min_stack.append(min(val, self.min_stack[-1]))
else:
self.min_stack.append(val)
def pop(self) -> None:
self.stack.pop()
self.min_stack.pop()
def top(self) -> int:
return self.stack[-1]
def getMin(self) -> int:
return self.min_stack[-1]
25. Design Twitter
class Twitter:
def init(self):
self.count = 0
self.tweetMap = {}
self.followMap = {}
def postTweet(self, userId: int, tweetId: int) -> None:
if userId not in self.tweetMap:
self.tweetMap[userId] = []
self.tweetMap[userId].append([self.count, tweetId])
self.count -= 1
def getNewsFeed(self, userId: int) -> list[int]:
res = []
minHeap = []
if userId not in self.followMap:
self.followMap[userId] = set()
self.followMap[userId].add(userId)
for followeeId in self.followMap[userId]:
if followeeId in self.tweetMap and len(self.tweetMap[followeeId]) > 0:
index = len(self.tweetMap[followeeId]) - 1
count, tweetId = self.tweetMap[followeeId][index]
heapq.heappush(minHeap, [count, tweetId, followeeId, index - 1])
while minHeap and len(res) < 10:
count, tweetId, followeeId, index = heapq.heappop(minHeap)
res.append(tweetId)
if index >= 0:
next_count, next_tweetId = self.tweetMap[followeeId][index]
heapq.heappush(minHeap, [next_count, next_tweetId, followeeId, index - 1])
self.followMap[userId].remove(userId)
return res
def follow(self, followerId: int, followeeId: int) -> None:
if followerId not in self.followMap:
self.followMap[followerId] = set()
self.followMap[followerId].add(followeeId)
def unfollow(self, followerId: int, followeeId: int) -> None:
if followerId in self.followMap and followeeId in self.followMap[followerId]:
self.followMap[followerId].remove(followeeId)
26. Design Add and Search Words Data Structure
class TrieNode:
def init(self):
self.children = {}
self.is_end = False
class WordDictionary:
def init(self):
self.root = TrieNode()
def addWord(self, word: str) -> None:
curr = self.root
for char in word:
if char not in curr.children:
curr.children[char] = TrieNode()
curr = curr.children[char]
curr.is_end = True
def search(self, word: str) -> bool:
def dfs(j, root):
curr = root
for i in range(j, len(word)):
char = word[i]
if char == '.':
for child in curr.children.values():
if dfs(i + 1, child):
return True
return False
else:
if char not in curr.children:
return False
curr = curr.children[char]
return curr.is_end
return dfs(0, self.root)
27. Implement Trie (Prefix Tree)
class TrieNode:
def init(self):
self.children = {}
self.is_end_of_word = False
class Trie:
def init(self):
self.root = TrieNode()
def insert(self, word: str) -> None:
curr = self.root
for char in word:
if char not in curr.children:
curr.children[char] = TrieNode()
curr = curr.children[char]
curr.is_end_of_word = True
def search(self, word: str) -> bool:
curr = self.root
for char in word:
if char not in curr.children:
return False
curr = curr.children[char]
return curr.is_end_of_word
def startsWith(self, prefix: str) -> bool:
curr = self.root
for char in prefix:
if char not in curr.children:
return False
curr = curr.children[char]
return True
28. LRU Cache
class Node:
def init(self, key=0, val=0):
self.key = key
self.val = val
self.prev = None
self.next = None
class LRUCache:
def init(self, capacity: int):
self.cap = capacity
self.cache = {}
self.left = Node()
self.right = Node()
self.left.next = self.right
self.right.prev = self.left
def remove(self, node):
prev_node = node.prev
next_node = node.next
prev_node.next = next_node
next_node.prev = prev_node
def insert(self, node):
prev_mru = self.right.prev
prev_mru.next = node
self.right.prev = node
node.prev = prev_mru
node.next = self.right
def get(self, key: int) -> int:
if key in self.cache:
self.remove(self.cache[key])
self.insert(self.cache[key])
return self.cache[key].val
return -1
def put(self, key: int, value: int) -> None:
if key in self.cache:
self.remove(self.cache[key])
self.cache[key] = Node(key, value)
self.insert(self.cache[key])
if len(self.cache) > self.cap:
lru = self.left.next
self.remove(lru)
del self.cache[lru.key]
29. Continuous Subarray Sum
def check_subarray_sum(nums: list[int], k: int) -> bool:
remainder_map = {0: -1}
prefix_sum = 0
for i in range(len(nums)):
prefix_sum += nums[i]
remainder = prefix_sum % k
if remainder in remainder_map:
if i - remainder_map[remainder] >= 2:
return True
else:
remainder_map[remainder] = i
return False
30. Accounts Merge
class UnionFind:
def init(self):
self.parent = {}
def find(self, x):
if x not in self.parent:
self.parent[x] = x
if self.parent[x] != x:
self.parent[x] = self.find(self.parent[x])
return self.parent[x]
def union(self, x, y):
rootX = self.find(x)
rootY = self.find(y)
if rootX != rootY:
self.parent[rootY] = rootX
def accounts_merge(accounts: list[list[str]]) -> list[list[str]]:
uf = UnionFind()
email_to_name = {}
for acc in accounts:
name = acc[0]
first_email = acc[1]
for i in range(1, len(acc)):
email = acc[i]
email_to_name[email] = name
uf.union(first_email, email)
merged_emails = {}
for email in email_to_name:
root = uf.find(email)
if root not in merged_emails:
merged_emails[root] = []
merged_emails[root].append(email)
res = []
for root, emails in merged_emails.items():
res.append([email_to_name[root]] + sorted(emails))
return res
31. Subarray Sum Equals K
def subarray_sum(nums: list[int], k: int) -> int:
count = 0
prefix_sum = 0
prefix_map = {0: 1}
for num in nums:
prefix_sum += num
diff = prefix_sum - k
if diff in prefix_map:
count += prefix_map[diff]
prefix_map[prefix_sum] = prefix_map.get(prefix_sum, 0) + 1
return count
32. Sliding Window Median
def median_sliding_window(nums: list[int], k: int) -> list[float]:
small = []
large = []
lazy = {}
for i in range(k):
heapq.heappush(small, -nums[i])
for i in range(k // 2):
heapq.heappush(large, -heapq.heappop(small))
def get_median():
if k % 2 == 1:
return float(-small[0])
return (-small[0] + large[0]) / 2.0
res = [get_median()]
for i in range(k, len(nums)):
out_num = nums[i - k]
in_num = nums[i]
lazy[out_num] = lazy.get(out_num, 0) + 1
balance = 0
if out_num <= -small[0]:
balance -= 1
else:
balance += 1
if small and in_num <= -small[0]:
balance += 1
heapq.heappush(small, -in_num)
else:
balance -= 1
heapq.heappush(large, in_num)
if balance < 0:
heapq.heappush(small, -heapq.heappop(large))
elif balance > 0:
heapq.heappush(large, -heapq.heappop(small))
while small and lazy.get(-small[0], 0) > 0:
lazy[-small[0]] -= 1
heapq.heappop(small)
while large and lazy.get(large[0], 0) > 0:
lazy[large[0]] -= 1
heapq.heappop(large)
res.append(get_median())
return res
33. Median Search Frequency
WITH
expanded AS (
SELECT
searches
FROM
search_frequency
CROSS JOIN GENERATE_SERIES(1, num_users)
)
SELECT
ROUND(
PERCENTILE_CONT(0.5) WITHIN GROUP (
ORDER BY
searches
)::DECIMAL,
1
) AS median_searches
FROM
expanded;
34. Add Two Numbers
Definition for singly-linked list.
class ListNode:
def init(self, val=0, next=None):
self.val = val
self.next = next
def add_two_numbers(l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
dummy = ListNode(0)
curr = dummy
carry = 0
while l1 or l2 or carry:
val1 = l1.val if l1 else 0
val2 = l2.val if l2 else 0
total = val1 + val2 + carry
carry = total // 10
curr.next = ListNode(total % 10)
curr = curr.next
if l1: l1 = l1.next
if l2: l2 = l2.next
return dummy.next
35. Supplier Delivery Time Analyzer
Objective
Write an SQL query to determine the average delivery time for each supplier. The delivery time is defined as the number of days between the order date and the delivery date. The result should list each supplier's name and the average delivery time in ascending order of average delivery...
🔒 Premium Content
Detailed explanation and solution available for premium members.
36. Interactive Sales Funnel Analyzer
How to Calculate Records at Each Stage of a Sales Funnel and Determine Conversion Rates with SQL
Objective
In this article, we will walk you through creating an SQL query to calculate the number of records at each stage of a sales funnel and determine the conversion rate from one stage to ...
🔒 Premium Content
Detailed explanation and solution available for premium members.
37. Customer Churn Rate Calculator
Are you preparing for an SQL interview and looking for ways to demonstrate your expertise in data analysis for subscription services? A common interview question revolves around calculating the monthly churn rate using SQL. This detailed explanation will take you through the process step-by-step...
🔒 Premium Content
Detailed explanation and solution available for premium members.
38. Top Seller by Region with RANK()
Objective
Write an SQL query to determine the best-selling product in each region based on the total quantity sold. The output should list the region name, product name, and total sales of each top-selling product, sorted in descending order by the total sales.
Additional information
- Assu...
🔒 Premium Content
Detailed explanation and solution available for premium members.
39. Complex Aggregation and Join: Employee Project Assignments and Salary Calculation
How to Answer the SQL Query Interview Question on Calculating Total Compensation for Employees
Objective
In an SQL-based interview, you may be asked to write a query that calculates the total compensation for employees involved in at least two distinct projects. The compensation comprises ...
🔒 Premium Content
Detailed explanation and solution available for premium members.
40. Payment Processing API Testing
Stripe processes billions of dollars in payments annually for millions of businesses. QA testing of payment APIs requires comprehensive validation of charge processing, refunds, webhook security, and transaction history to ensure reliable financial operations....
🔒 Premium Content
Detailed explanation and solution available for premium members.
41. Video Conference API Testing
Zoom hosts over 300 million daily meeting participants across 220+ countries. QA testing of video conferencing APIs requires comprehensive validation of meeting creation, participant management, recording controls, and quality analytics to ensure seamless remote collaboration....
🔒 Premium Content
Detailed explanation and solution available for premium members.
42. User Authentication API Testing
Microsoft Azure Active Directory handles millions of authentication requests daily. QA testing of authentication APIs requires comprehensive validation of login flows, password resets, user registration, and profile management to ensure secure user access control....
🔒 Premium Content
Detailed explanation and solution available for premium members.
43. Dynamic Table Data Extraction Testing
Master table data extraction with Selenium. Learn row navigation, cell parsing, and comprehensive data validation techniques....
🔒 Premium Content
Detailed explanation and solution available for premium members.
44. Multi-Window Context Switching Testing
Master multi-window testing with Selenium. Learn window handle management, context switching, and data extraction across browser windows....
🔒 Premium Content
Detailed explanation and solution available for premium members.
Ready to Practice More?
Explore interview questions from other companies or try our hands-on labs to build practical experience.