What are the top coding interview questions for Google?

When preparing for a coding interview at Google, it's crucial to practice a range of problems that test your knowledge of algorithms, data structures, and problem-solving skills. Here are some of the top coding interview questions that are commonly asked at Google:

Arrays and Strings

  1. Two Sum:

    • Problem: Find two numbers in an array that add up to a specific target.
    • Solution: Use a hash map to store the complement of each number as you iterate through the array.
  2. Longest Substring Without Repeating Characters:

    • Problem: Find the length of the longest substring without repeating characters.
    • Solution: Use a sliding window approach to track the current substring and a set to check for duplicates.
  3. Product of Array Except Self:

    • Problem: Return an array where each element is the product of all elements in the original array except the current element.
    • Solution: Use two passes: one to accumulate products from the left, and one from the right.

Linked Lists

  1. Merge Two Sorted Lists:

    • Problem: Merge two sorted linked lists into one sorted linked list.
    • Solution: Use a dummy node to simplify the merging process.
  2. Detect Cycle in a Linked List:

    • Problem: Determine if a linked list has a cycle.
    • Solution: Use Floyd’s cycle-finding algorithm (tortoise and hare).
  3. Reverse a Linked List:

    • Problem: Reverse a singly linked list.
    • Solution: Iterate through the list, reversing the pointers as you go.

Trees and Graphs

  1. Lowest Common Ancestor of a Binary Tree:

    • Problem: Find the lowest common ancestor of two nodes in a binary tree.
    • Solution: Use recursion to traverse the tree and find the split point where the nodes diverge.
  2. Binary Tree Level Order Traversal:

    • Problem: Return the level order traversal of a binary tree.
    • Solution: Use a queue to perform a breadth-first search (BFS).
  3. Number of Islands:

    • Problem: Count the number of islands in a 2D grid of water and land.
    • Solution: Use DFS or BFS to explore each island and mark it as visited.

Dynamic Programming

  1. Longest Increasing Subsequence:

    • Problem: Find the length of the longest increasing subsequence in an array.
    • Solution: Use dynamic programming with a dp array to store the length of the LIS ending at each index.
  2. Coin Change:

    • Problem: Find the minimum number of coins needed to make up a given amount.
    • Solution: Use a bottom-up dynamic programming approach with an array to store the minimum coins for each amount.
  3. Edit Distance:

    • Problem: Compute the minimum number of operations to convert one string to another.
    • Solution: Use dynamic programming with a 2D array to track the minimum operations for each substring pair.

Sorting and Searching

  1. Merge Intervals:

    • Problem: Merge overlapping intervals.
    • Solution: Sort the intervals by start time and then merge overlapping intervals.
  2. Find Peak Element:

    • Problem: Find a peak element in an array.
    • Solution: Use binary search to find a peak in O(log n) time.
  3. Search in Rotated Sorted Array:

    • Problem: Search for a target value in a rotated sorted array.
    • Solution: Use binary search with a modified condition to handle the rotation.

Miscellaneous

  1. Median of Two Sorted Arrays:

    • Problem: Find the median of two sorted arrays.
    • Solution: Use a binary search approach to partition the arrays and find the median.
  2. Word Ladder:

    • Problem: Find the length of the shortest transformation sequence from a start word to an end word.
    • Solution: Use BFS to explore all possible transformations.
  3. Top K Frequent Elements:

    • Problem: Find the k most frequent elements in an array.
    • Solution: Use a heap or bucket sort to efficiently find the top k elements.

Practicing these questions will help you build a strong foundation for your Google coding interview. Be sure to understand the underlying principles and techniques used to solve these problems, as variations and follow-up questions are common.

TAGS
Coding Interview
CONTRIBUTOR
Arslan Ahmad
Arslan Ahmad
ex-FAANG engineering manager and author or Grokking series.
-

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Explore Answers
When should I use a List vs a LinkedList in C#?
What are the strategies for re-applying after a rejected application?
What is dom in React?
What is the basics of multithreading?
What Is the Waymo Interview Process Like? (Round by Round)
Waymo's loop runs Google-caliber coding with AV-flavored framing, latency-aware system design, domain low-level design, and a behavioral round built on critiquing your own work.
What is the package for freshers in Cisco?
Related Courses
New
Grokking the AI System Design Interview course cover
Grokking the AI System Design Interview
Learn to design AI systems the way interviewers expect: classic ML products, LLM and RAG architectures, and agentic systems, all through the lens of the system design interview.
4.8
(1,192 learners)
Discounted price for Your Region

$123

Grokking the Coding Interview: Patterns for Coding Questions course cover
Grokking the Coding Interview: Patterns for Coding Questions
The 24 essential patterns behind every coding interview question. Available in Java, Python, JavaScript, C++, C#, and Go. The most comprehensive coding interview course with 543 lessons. A smarter alternative to grinding LeetCode.
4.6
Discounted price for Your Region

$197

Grokking Modern AI Fundamentals course cover
Grokking Modern AI Fundamentals
Master the fundamentals of AI today to lead the tech revolution of tomorrow.
4.1
Discounted price for Your Region

$72

Design Gurus logo
One-Stop Portal For Tech Interviews.
Copyright © 2026 Design Gurus, LLC. All rights reserved.