Google Interview Questions
Practice the exact questions companies are asking right now.
Design a fraud detection system
Scenario You are designing an end-to-end fraud detection system for an online platform (e.g., e-commerce marketplace, payments, account signup, or ad ...
Solve matrix groups and recipe inventory
Problem 1: Find the smallest 3×3 group in a matrix You are given an m × n 2D integer array grid. - Partition the grid into non-overlapping 3×3 blocks,...
Determine whether two nodes are related
Problem You are given genealogy information for a set of chickens. The data consists of parent → child relationships (e.g., (parentId, childId) pairs)...
Compute minimax grid path and network delay
Problem (two related shortest-path tasks) Part 1 — Minimize the maximum value along a grid path ("minimax" path) You are given an m x n integer grid H...
Find median of merged RLE arrays
Problem You are given two run-length encoded (RLE) arrays A and B. Each is sorted by value in non-decreasing order. - Each element is a pair (value, f...
Answer core teamwork and conflict stories
You are in a behavioral interview. Prepare to answer the following prompts using concrete examples from your experience. Prompts 1. Describe a challen...
Solve order-statistics and XOR-triplet problems
You are given two separate algorithmic problems. Problem 1: Count smaller elements to the right Given an integer array nums of length n, for each inde...
Compute distance-sum from every tree node
Problem You are given an undirected tree with n nodes labeled 0..n-1 and a list of n-1 edges. The tree is connected and contains no cycles. For each n...
Design street-view image ingestion and storage system
Prompt Design a system to ingest, store, and process street-level images for a "Street View"-like product. Scenario - A fleet of taxis is equipped wit...
Answer conflict, failure, and proud project questions
Behavioral questions Answer the following behavioral prompts using real examples from your experience: 1. Conflict: Tell me about a time you had a con...
Design an object-oriented poker game
Design the object-oriented architecture for a command-line poker game. Requirements (clarify and state assumptions) Assume a standard 52-card deck (no...
Recommend top-K movies from similarity graph
Movie Recommendation: Top K You are building a simple movie recommendation feature. Input - A set of movies 0..(M-1). - An undirected similarity graph...
Design large-scale near-duplicate video detection
Design a product-grade fuzzy (near-)duplicate detection system for a large short-video platform. You need to detect whether an uploaded video is a nea...
Compute distance to nearest taxi in grid
You are given an R x C grid representing a city map. - grid[r][c] = 1 means there is a taxi located at cell (r, c). - grid[r][c] = 0 means the cell is...
Maximize 1D deliveries within distance and minimize total distance
You are given positions on a 1D line: - people: an array of N integers (positions of people) - shops: an array of M integers (positions of milk-tea sh...
Return top-k subset sums in descending order
Problem You are given n distinct objects, each with a non-negative integer weight. A subset can be any selection of these objects (including the empty...
Assign meetings to rooms with delays
You are given: - An integer n (number of meeting rooms, labeled 0..n-1). - A list of m meetings meetings[i] = [start_i, end_i) with start_i < end_i. A...
Answer parity-alternation range queries
You are given an integer array nums of length n and q queries. Each query is a pair [l, r] (0-indexed, inclusive). A subarray nums[l..r] is called alt...
Solve meeting-room scheduling and shortest paths
You are asked to solve two algorithmic problems. Part A: Meeting-room scheduling (intervals) You are given an array of meeting time intervals interval...
Design a real-time recommendation system
You are asked to design a real-time recommendation system for a large-scale consumer product (for example, recommending items or content to users in a...