My experience with the Google foobar challenge and tips on what to do if you get it

Parminder Singh
Chingu
Published in
5 min readNov 14, 2018

Recently, I got greeted by an unusual message while searching on Google. It was Google’s secret hiring challenge!

Foobar message

I first heard about the existence of the Google foobar challenge since a friend of mine, Vampiire, got it last year. Because of the referral system inside foobar, a lot of members of Chingu team got to enter this challenge. One of them even got an on-site interview at Google!

I tried to forcibly make it trigger but it didn’t work like that. I forgot about it, just continued with life and coding. Then one day, it suddenly appeared on my screen!

Wait, what is the Google foobar challenge?!

It is a secret hiring challenge from Google which you get when you match some search behaviour on Google search or their documentations. You are given a prompt and if you accept, you are moved to an online shell where you can request questions and solve them. If you complete the challenge you have a high chance of being contacted by a Google recruiter!

More about it

The challenge had 5 levels, with each level having questions related to graphs and maths.

The first level was very similar to an easy interview question. You get 2 days to do it. I completed it right at the moment when I got the invite.

The second level had questions related to the famous algorithms Breadth first search and Depth first search with a little bit of linear algebra. You get three days for each of the two questions. You get a referral link through which you can let a friend enter foobar!

The third level had questions of number theory, dynamic programming, and even steady-state machines. Here you get three questions, you get seven days for each. It scared me at first, but it wasn’t that difficult if you are active in competitive programming.

Up until this point the journey was a breeze until I hit the Markov chaining question. That’s when I knew that foobar is starting to heat up and become more challenging. This one took a day for me to learn and implement.

After the 3rd level, I was asked to fill out my details for being contacted by a Google recruiter. I was very happy as Google doesn’t recruit from my college and I really wanted to interview at Google (who doesn’t?). There is so much to learn from them, I hoped that foobar would open up some opportunities.

The fourth level was quite intense! I was given two weeks for each problem. The problems needed multiple concepts ranging from number theory to graphs. Two classic graph problems i.e. max flow and maximum matching were needed to finish the level 4 section of the challenge. Implementing these made me reference CLRS book, which is short form for Introduction to Algorithms, a great book to learn about algorithms. You also get another referral link here to give to a friend.

If you are going through foobar yourself, wait until you’ve got a lot of time to spend on it before starting the fifth level. It is quite a tricky question and might cause you to keep scratching your head for days without any clue.

The fifth level was purely mathematical! It was related to permutations, Polya’s counting theorem, and group theory. I had a very weak foundation in the concepts and I thought that it is not possible for me to complete it in three weeks. Then I found an online book which had lots of examples and easier on mathematical notations.

This book helped me better understand the building blocks that led me to discover how to count unique permutations of some system along given symmetries. I had to study for three days straight to understand Burnside’s Lemma, which can be used to form an equation for counting unique permutations for the given system. This video helped me a lot when I was just getting started on the problem. I had taken a risk and I didn’t want to lose to this challenge. Finally, it all worked out. Following the book’s procedure and hacking together a solution, I cleared the fifth and final level!

I got a secret string which looked like base64, decrypting is quite easy as there are many gists. The decrypted text wasn’t very important though. I tried doing some curls using that json but there was no hidden easter egg.

Foobar Chapter 2!

Then, after just 2 more weeks, it happened again. I was working at my office, close to a deadline, and needed to learn how to use the Google Maps API quickly! I noticed a weird but familier pink dot on top right corner.

It still appears sometimes.
:D And it begins again!

The format of questions were same again but interestingly no questions repeated. The questions were actually very easy in this run. I went flying through all the questions this time in about 2 weeks. It had taken me a month in previous run. Meanwhile I gave the referral to a friend of mine and he completed foobar challenge in just 3 days!

Some tips:

1. Don’t Overthink

Overthinking can make you use algorithms that might be overkill. For one question I went on to implement Edmund’s Blossom algorithm while all I needed was a simple depth first search based bipartite matching. All the questions in foobar are mostly solvable in under 400 lines of code.

2. Don’t feel like it is the only way into Google

This can cause a lot of panic for you when you are near the time limit and you have to solve it or you won’t get into Google! Not really, actually foobar doesn’t get much special attention either. I was contacted by a Google recruiter but I don’t think she knew I had taken foobar, she just pointed me to take part in Kickstart as a new grad applicant. I didn’t apply, so it was just foobar but they saw it as an application because I had selected “Graduating in 1 year” in level 3 form.

Go in it to learn, not for a job.

3. Refer to the internet when you don’t know

When I got the markov chaining question, I searched “how to find probability of ending states” and I got the theories I needed. Foobar is more about learning quickly and implementing instead of knowing everything and implementing. You might hit a question that you have no idea about. The internet will be a friend, but don’t let it spoil you.

So that’s all folks, here are some dancing bunnies from foobar! If you ever get a foobar invitation: all the best and enjoy the ride!. If not, try learning some Google Maps API (I can’t guarantee it will work). :P

--

--