Google Coding & Algorithms Interview Questions
Preparing for Google Coding & Algorithms interview questions means getting ready for a rigorous, process-driven evaluation that emphasizes clean problem solving, clear communication, and algorithmic depth. Google tends to focus on core data structures and algorithmic patterns—arrays and strings, trees and graphs, dynamic programming, hashing, and complexity trade-offs—while also assessing how you reason through edge cases, test your ideas, and write production-minded code in a collaborative environment. Expect live coding on a shared document during screens and multiple 45‑minute coding rounds in onsite or virtual loops, with system design and behavioral evaluations added for more senior roles. Effective interview preparation balances breadth and depth: practice medium-to-hard algorithmic problems under timed conditions, review core computer science fundamentals, and rehearse explaining tradeoffs and correctness aloud. Work on structured problem walkthroughs, mock interviews that simulate Google’s collaborative doc format, and concise post-solution optimizations. Also prepare concise, impact‑focused stories for the behavioral round and plan a realistic multi-week schedule that includes focused drills, full mock loops, and targeted review of persistent weak spots.
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...
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...
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...
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...
Minimize travel time with optional meeting point
You are given a connected graph representing travel between locations. - Each node is a location. - Each edge has a non-negative travel time (if your ...
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...
Match people to questions using tags and priorities
You are building a simplified “Q&A matching” feature. You have: - people: N people, where person i has a set of expertise tags P[i]. - questions: M qu...
Design a logger that returns top-K messages
Problem Design an in-memory logging component that supports recording log events and querying the top K most frequent messages. Each log event has: - ...
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...
Maximize coins with tokens moving by +3
You are given a 1D board represented by a string s of length n (1 <= n <= 100). Each character is one of: - '.': empty cell - 'C': a cell containing o...
Design data structure similar to LRU cache
You are asked to design and implement a data structure that behaves similarly to an LRU (Least Recently Used) cache, but with a small variation: - The...
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...
Find longest increasing contiguous subarray
Problem You are given an integer array nums (length n). Part 1 Find the length of the longest contiguous subarray that is strictly increasing (i.e., f...
Maximize sum without choosing adjacent elements
Problem You are given an integer array nums where nums[i] is the value in position i. Select a subset of indices such that no two selected indices are...
Determine winner in stack-merging game
Game: Babylon stack merging (two-player, perfect play) You are given a two-player turn-based game. There are n stacks of tiles. Each stack has: - a he...
Find shortest subarray with at least k distinct
Problem Given an integer array nums and an integer k, find the length of the shortest contiguous subarray that contains at least k distinct integers. ...
Solve several streaming, DAG, and DP tasks
You were asked multiple algorithmic questions. 1) Streaming longest subarray with average S You receive an infinite stream of integers (can be positiv...
Simulate room assignments for scheduled meetings
Problem You are given n meeting rooms labeled 0..n-1 and a list of meetings meetings, where each meeting is [start, end] with start < end. Meetings ar...
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...
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...