My journey through the Google interview process

Google Coding Interviews are one of the toughest interviews to crack. From the time I found my passion in Competitive coding, my aim was to crack Google Coding Interviews.

Here I am trying to list down the complete process that I went through. It was a 4-month long process and there were a lot of questions that kept on popping in my head from time to time, so I’ll try to answer every such question.

**Recruiter Connect**

In the first week of February, I got an email from Singapore based Google recruiter mentioning…

These are some problems that I practiced before my Google Interview in a span of 2 weeks.

https://leetcode.com/problems/two-sum/

https://leetcode.com/problems/3sum/

https://leetcode.com/problems/max-consecutive-ones-iii/

https://leetcode.com/problems/maximum-product-subarray/

https://leetcode.com/problems/maximum-product-subarray/

https://leetcode.com/problems/next-permutation/

https://leetcode.com/problems/valid-number/

https://leetcode.com/problems/valid-parentheses/

https://leetcode.com/problems/palindromic-substrings/

https://leetcode.com/problems/minimum-window-substring/

https://leetcode.com/problems/longest-repeating-character-replacement/

https://leetcode.com/problems/populating-next-right-pointers-in-each-node/

https://leetcode.com/problems/binary-search-tree-iterator/

https://leetcode.com/problems/kth-smallest-element-in-a-bst/

https://leetcode.com/problems/serialize-and-deserialize-binary-tree/

https://leetcode.com/problems/diameter-of-binary-tree/

https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/

https://leetcode.com/problems/single-element-in-a-sorted-array/

https://leetcode.com/problems/find-k-closest-elements/

https://leetcode.com/problems/clone-graph/

https://leetcode.com/problems/number-of-islands/

https://leetcode.com/problems/reconstruct-itinerary/

https://leetcode.com/problems/next-greater-element-ii/

https://leetcode.com/problems/cheapest-flights-within-k-stops/

https://leetcode.com/problems/search-in-rotated-sorted-array/

https://leetcode.com/problems/median-of-two-sorted-arrays/

https://leetcode.com/problems/top-k-frequent-elements/

https://leetcode.com/problems/merge-k-sorted-lists/

https://leetcode.com/problems/reverse-linked-list/

https://leetcode.com/problems/linked-list-cycle/

https://leetcode.com/problems/merge-k-sorted-lists/

https://leetcode.com/problems/remove-nth-node-from-end-of-list/

https://leetcode.com/problems/reorder-list/

https://leetcode.com/problems/letter-combinations-of-a-phone-number/

https://leetcode.com/problems/generate-parentheses/

https://leetcode.com/problems/n-queens/

https://leetcode.com/problems/regular-expression-matching/

https://leetcode.com/problems/permutations/

https://leetcode.com/problems/coin-change/

https://leetcode.com/problems/longest-common-subsequence/

https://leetcode.com/problems/climbing-stairs/

https://leetcode.com/problems/word-break/

**Question**

Write an algorithm to find the kth number such that only prime factors are 3,5 and 7.

This question seems very simple but there is one interesting solution that I am going to explain below:

**Solution**

Let’s maintain 3 queues such that:

Q3: Has previously unseen multiples of 3

Q5: Has previously unseen multiples of 5

Q7: Has previously unseen multiples of 7

To find the minimum we only need to look at the fronts of each queue:

y=min(Q3.head(),Q5.head(),Q7.head())

Once we compute y, we need to insert 3y into Q3, 5y into Q5, 7y into Q7. And we only…

I had already mastered DS and Algo and thought to give CTCI a try. I had the opinion what is left for me to study now! Little did I know that this book is going to be one of the most insightful books I could ever read.

I started with the thought “Let’s read the questions and I wouldn’t ever need to turn to the solution”. But guess what? I spent about 25–40 minutes on every question and its solutions that the book has provided. I knew the solution to most of the problems but the solutions in the book…

Inspired by Naval Ravikant

Recently, I have been reading a book called “The Almanack of Naval Ravikant”.

I came across this article that categorises the kind of luck one can have.

The first kind of luck is blind luck where one just gets lucky because something completely out of their control happened. This includes fortune, fate, etc.

Then, there’s luck through persistence, hard work, hustle, and motion. This is when you’re running around creating opportunities. You’re generating a lot of energy, you’re doing a lot to stir things up. It’s almost like mixing a petri dish or mixing a bunch…

Hi Everyone,

I am working as a Software Engineer for the past 2 years and I have cracked Google interview.

How I started my journey?

I am from a Tier 1 institute of India, I started coding in my 2nd year of college and learnt it on my own. I was among the top coders from my college.

For the past 1 year, I have been very much active on Codeforces that helped me crack interviews at Google and Flipkart.

How I can help you?

I am trying to build a community of coders where in:

- I will help you…

Rock, Paper, Scissors

**Problem Description**

There are 2 players Alice and Bob, who are playing Rock, Paper and Scissors game. Alice can pick rock ‘a’ times, scissors ‘b’ times and paper ‘c’ times. Similarly, Bob can pick rock ‘x’ times, scissors ‘y’ times and paper ‘z’ times.

*Note: The ordering given in the question is RSP and not RPS*

We need to find what is the minimum and maximum number of times that Alice can win.

**Solution and Approach**

Let’s first find the maximum number of times that Alice can win.

Alice will win only when Bob loses. And Bob…

I got an offer from Flipkart for the SDE1 post. Here I am trying to explain the question and my proposed solution for the Machine Coding Round.

The question was explained to all the interviewees together and then we had to code for 2 hours and our screens were monitored.

Watch this video of full explanation of code.

**Question:**

One of the core problems which people face at every company is the unavailability of conference rooms. So we thought of building one conference room management system. The system should have the following features.

**Assumptions:**

- Conference rooms are scattered across multiple…

I interviewed with GS in January 2021 for the post of Java/Python Developer. There were 5 rounds in total.

**Interview Questions Based on DS & Algo**

Q1. https://www.geeksforgeeks.org/find-element-appears-array-every-element-appears-twice/

Q2. https://www.geeksforgeeks.org/detect-loop-in-a-linked-list/ with an explanation of the proof.

Q3. https://bucky21.medium.com/arrangement-of-bricks-fc5a213d4f94

Q4. Given n number of cars with varying speeds, speed is given in a form of an array of integers. Initially, all the cars are placed at the starting point and they have to reach the ending point. We need to calculate the total number of overtakes that will happen till all the cars reach the final destination. https://www.geeksforgeeks.org/counting-inversions/

Q5. https://www.geeksforgeeks.org/median-of-two-sorted-arrays-of-different-sizes/

The following are some of the channels I found really insightful during my preparation for interviews of various companies, including Google.

His videos for various algorithms made me understood the most complex problems which I was never able to understand.

One such problem was the KMP algorithm. I have tried to understand this algorithm from every possible resource but never understood it very clearly. Watching this video twice I was able to understand the basic logic for this algorithm.

One more such video was Median of 2 sorted arrays using Binary Search.

The guru for all the folks who want…