Add office photos
Google logo
Employer?
Claim Account for FREE

Google

4.4
based on 1.7k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Sdet
Skills
Clear (1)

10+ Google Sdet Interview Questions and Answers

Updated 5 Feb 2024

Q1. How to design a search engine? If each document contains a set of keywords, and is associated with a numeric attribute, how to build indices?

Ans.

To design a search engine with keyword-based document indexing and numeric attributes, we need to build appropriate indices.

  • Create an inverted index for each keyword, mapping it to the documents that contain it

  • For numeric attributes, use a B-tree or other appropriate data structure to store the values and their associated documents

  • Combine the indices to allow for complex queries, such as keyword and attribute filters

  • Consider using stemming or other text processing techniques ...read more

Add your answer
right arrow

Q2. Most phones now have full keyboards. Before there there three letters mapped to a number button. Describe how you would go about implementing spelling and word suggestions as people type

Ans.

Implement spelling and word suggestions for full keyboard phones

  • Create a dictionary of commonly used words

  • Use algorithms like Trie or Levenshtein distance to suggest words

  • Implement auto-correct feature

Add your answer
right arrow

Q3. Given an array of integers which is circularly sorted, how do you find a given integer

Ans.

To find a given integer in a circularly sorted array of integers, use binary search with slight modifications.

  • Find the middle element of the array.

  • If the middle element is the target, return its index.

  • If the left half of the array is sorted and the target is within that range, search the left half.

  • If the right half of the array is sorted and the target is within that range, search the right half.

  • If the left half is not sorted, search the right half.

  • If the right half is not so...read more

Add your answer
right arrow

Q4. How would you determine if someone has won a game of tic-tac-toe on a board of any size?

Ans.

To determine if someone has won a game of tic-tac-toe on a board of any size, we need to check all possible winning combinations.

  • Create a function to check all rows, columns, and diagonals for a winning combination

  • Loop through the board and call the function for each row, column, and diagonal

  • If a winning combination is found, return the player who won

  • If no winning combination is found and the board is full, return 'Tie'

  • If no winning combination is found and the board is not f...read more

Add your answer
right arrow
Discover Google interview dos and don'ts from real experiences

Q5. Given two files that has list of words (one per line), write a program to show the intersection

Ans.

Program to find intersection of words in two files

  • Read both files and store words in two arrays

  • Loop through one array and check if word exists in other array

  • Print the common words

Add your answer
right arrow

Q6. Given an array of numbers, replace each number with the product of all the numbers in the array except the number itself *without* using division

Ans.

Replace each number in an array with the product of all other numbers without using division.

  • Iterate through the array and calculate the product of all numbers to the left of the current index.

  • Then, iterate through the array again and calculate the product of all numbers to the right of the current index.

  • Multiply the left and right products to get the final product and replace the current index with it.

Add your answer
right arrow
Are these interview questions helpful?

Q7. Write a program to find depth of binary search tree without using recursion

Ans.

Program to find depth of binary search tree without recursion

  • Use a stack to keep track of nodes and their depths

  • Iteratively traverse the tree and update the maximum depth

  • Return the maximum depth once traversal is complete

Add your answer
right arrow

Q8. Find the maximum rectangle (in terms of area) under a histogram in linear time

Ans.

Find the maximum rectangle (in terms of area) under a histogram in linear time

  • Use a stack to keep track of the bars in the histogram

  • For each bar, calculate the area of the rectangle it can form

  • Pop the bars from the stack until a smaller bar is encountered

  • Keep track of the maximum area seen so far

  • Return the maximum area

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. Describe recursive mergesort and its runtime. Write an iterative version in C++/Java/Python

Ans.

Recursive mergesort divides array into halves, sorts them and merges them back. O(nlogn) runtime.

  • Divide array into halves recursively

  • Sort each half recursively using mergesort

  • Merge the sorted halves back together

  • Runtime is O(nlogn)

  • Iterative version can be written using a stack or queue

Add your answer
right arrow

Q10. Create a cache with fast look up that only stores the N most recently accessed items

Ans.

Create a cache with fast look up that only stores the N most recently accessed items

  • Implement a hash table with doubly linked list to store the items

  • Use a counter to keep track of the most recently accessed items

  • When the cache is full, remove the least recently accessed item

Add your answer
right arrow

Q11. Efficiently implement 3 stacks in a single array

Ans.

Implement 3 stacks in a single array efficiently

  • Divide the array into 3 equal parts

  • Use pointers to keep track of top of each stack

  • Implement push and pop operations for each stack

  • Handle stack overflow and underflow cases

Add your answer
right arrow

More about working at Google

Back
Awards Leaf
AmbitionBox Logo
Top Rated Large Company - 2024
Awards Leaf
Awards Leaf
AmbitionBox Logo
Top Rated Internet/Product Company - 2024
Awards Leaf
HQ - Mountain View,California, United States
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Google Sdet

based on 2 interviews
Interview experience
4.5
Good
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Sdet Interview Questions from Similar Companies

Bharti Airtel Logo
4.0
 • 11 Interview Questions
View all
Recently Viewed
SALARIES
Quess
SALARIES
Alldigi Tech
SALARIES
Quess
SALARIES
Quess
SALARIES
Quess
SALARIES
Eris Lifesciences
SALARIES
Quess
SALARIES
Quess
SALARIES
Williams Lea
SALARIES
QX Global Group
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter