Google interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Google
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Graph Theory, Data Structures, STL library, Dynamic Programming, Time and Space Complexity
Tip
Tip

Tip 1 : Do mock interviews. With your friends, mentors, or even in front f the mirror. Questions you are sure of may suddenly have you at a loss during the actual interview.
Tip 2 : Practice all the basic programming algorithms and repeated questions. Coding Ninja's courses is a good place to start.
Tip 3 : Practice solving programs in a limited timeframe. You get only 45 minutes in the interview!

Application process
Where: Other
Eligibility: No Backlogs
Resume Tip
Resume tip

Tip 1 : Tailor your resume according to the job description. Ensure your skills matches those required, and your projects are on the same topic.
Tip 2 : Google also gives an option of cover letter. Use it! Make it personal, interesting and witty.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 minutes
Interview date16 Aug 2020
Coding problem2

Timing : Evening
Online : No webcam proctoring

1. Count distinct Bitwise OR of all subarrays

Easy
10m average time
90% success
0/40
Asked in companies
GoogleOYOOla

You are given an array consisting of N positive integers, your task is to count the number of distinct possible values that can be obtained by taking the bitwise OR of the elements of all possible subarrays of the given array

Note:

1) A subarray is a part of the array which is contiguous (i.e. elements in the original array occupy consecutive positions) and inherently maintains the order of elements. For example, the subarrays of the array {1, 2, 3} are {1}, {1, 2}, {1, 2, 3}, {2}, {2, 3}, and {3}.
2) Bitwise OR operation takes two numbers and performs OR operation on every bit of those two numbers. For example, consider two numbers 2 and 3 their bitwise OR will be 3. Because the binary representation of 2 is 10 and the binary representation of 3 is 11. And OR of 10 and 11 will be 11 which evaluates to 3.
3) The array may contain duplicate elements.
Problem approach

I maintained two arrays one with normal addition of element (0 query) and other of Xor elements (1 query) when it’s 0 ,I iterate the pointer of index of both arrays and add element to normal array, when it’s 1 I only updated xor array with xor of query element and the number already present in the xor array. At the end I did suffix of Xor array and xored the suffixes with normal array.
Then sorted and returned normal array.

Try solving now

2. Search In Rotated Sorted Array

Moderate
30m average time
65% success
0/80
Asked in companies
Tata 1mgWalmartDelhivery

Aahad and Harshit always have fun by solving problems. Harshit took a sorted array consisting of distinct integers and rotated it clockwise by an unknown amount. For example, he took a sorted array = [1, 2, 3, 4, 5] and if he rotates it by 2, then the array becomes: [4, 5, 1, 2, 3].

After rotating a sorted array, Aahad needs to answer Q queries asked by Harshit, each of them is described by one integer Q[i]. which Harshit wanted him to search in the array. For each query, if he found it, he had to shout the index of the number, otherwise, he had to shout -1.

For each query, you have to complete the given method where 'key' denotes Q[i]. If the key exists in the array, return the index of the 'key', otherwise, return -1.

Note:

Can you solve each query in O(logN) ?
Try solving now
02
Round
Easy
Video Call
Duration45+45= 90 minutes
Interview date17 Sep 2020
Coding problem2

2 rounds of interview of 45 minutes each
Was scheduled late at night: 9 pm(Interviewers were from USA)
Through Google meet and google online code platform
One interviewer per session

1. Count Palindrome Words in A String

Easy
15m average time
85% success
0/40
Asked in companies
CognizantMakeMyTripGoogle

You are given a string S of words. Your task is to find the number of palindrome words in the given string S. A word is called palindrome, if it reads the same backwards as forwards.

Note:
Words are separated by one or more whitespace characters.
For Example:
For the given string “Madam oyo cat”, “Madam”, and “oyo” are the palindrome words 
Try solving now

2. House Robber

Moderate
15m average time
80% success
0/80
Asked in companies
UberGoogleIntuit

Mr. X is a professional robber planning to rob houses along a street. Each house has a certain amount of money hidden.


All houses along this street are arranged in a circle. That means the first house is the neighbour of the last one. Meanwhile, adjacent houses have a security system connected, and it will automatically contact the police if two adjacent houses are broken into on the same night.


You are given an array/list of non-negative integers 'ARR' representing the amount of money of each house. Your task is to return the maximum amount of money Mr. X can rob tonight without alerting the police.


Note:
It is possible for Mr. X to rob the same amount of money by looting two different sets of houses. Just print the maximum possible robbed amount, irrespective of sets of houses robbed.


For example:
(i) Given the input array arr[] = {2, 3, 2} the output will be 3 because Mr X cannot rob house 1 (money = 2) and then rob house 3 (money = 2), because they are adjacent houses. So, he’ll rob only house 2 (money = 3)

(ii) Given the input array arr[] = {1, 2, 3, 1} the output will be 4 because Mr X rob house 1 (money = 1) and then rob house 3 (money = 3).

(iii) Given the input array arr[] = {0} the output will be 0 because Mr. X has got nothing to rob.
Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

Which operator is used for exponentiation in Python?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Google
1309 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by Google
1512 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Google
1412 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Google
9637 views
4 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13855 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
13095 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
9196 views
2 comments
0 upvotes