Google Foobar Challenge

TL, DR

Google Foobar is a hidden coding challenge by Google. You can access it because of your coding-related Google searches or via an invite by somebody which is already in the challenge. Beside the fun, you may be contacted by Google recruiters if you progress enough in the game.

This post is part of a series on Google Foobar, with all the challenges I encountered. The full series is available here.

Searches and Easter eggs

Everybody uses Google. Programmers that need to fix some issue in their code often abuse it. Stack Overflow, Reddit, Github, and plenty of other resources are just a click away from a Google search.

Beside finding what you may need, there is also another potential bonus in your coding-related Google search. It may be related to your search pattern, to the keyword you used, or maybe to something else. Independently from the reason, you may be surprised by an enticing invite.

Google Foobar challenge invitation from google search
Image from https://github.com/tandav/google-foobar – I forgot to screenshot mine!

The webpage will open like a surprise box, and you will be asked if you are up for a challenge. It took me a few seconds to realize that indeed was Google to invite me to play!

Once you click on the green button, you will be brought to a Unix terminal-like webpage. You will be asked to login with your Google account and save your progress. Else you may risk to lose access to the challenge if something happen to your connection.

Foobar mission begins

The story resembles a bunny-themed Star Wars episode, with an evil Commander Lambda that plans to wreak havoc in the galaxy. You are an undercover agent that needs to defeat her.

Google has a code challenge ready for you.
Success! You've managed to infiltrate Commander Lambda's evil organization, and finally earned yourself an entry-level position as a Minion on their space station. From here, you just might be able to subvert Commander Lambda's plans to use the LAMBCHOP doomsday device to destroy Bunny Planet. Problem is, Minions are the lowest of the low in the Lambda hierarchy. Better buck up and get working, or you'll never make it to the top...
Initial steps of Google Foobar Challenge

If you type help, the terminal will show you the list of commands you can use. It’s kind of a subset of a typical Unix shell, with some ad-hoc commands like verify or edit.

Use the following shell commands:

    cdchange directory [dir_name]
    catprint file [file_name]
    deletemedelete all of your data associated with foobar
    editopen file in editor [file_name]
    feedbackProvide feedback on foobar
    lessprint a file a page at a time [file_name]
    lslist directory contents [dir_name]
    requestrequest new challenge
    statusprint progress
    submitsubmit final solution file for assessment [file_name]
    verifyruns tests on solution file [file_name]


Keyboard help:

    ⌘ + Ssave the open file [when editor is focused]
    ⌘ + Eclose the editor [when editor is focused]


Toggle between the editor and terminal using ESC followed by TAB, then activate with ENTER.
Google Foobar commands

When you feel ready, you can type request, and you will receive a new coding challenge. Challenges are time limited, you need to complete them within the prescribed time frame or you will lose access to the Foobar site.

You are about to begin a TIME-LIMITED challenge. You will have 7 days to complete each newly requested challenge or LOSE ACCESS to this site.
Do you wish to proceed and start the timer on your first challenge?
[Y]es or [N]o: Y
Requesting challenge...
Why did you sign up for infiltration duty again? The pamphlets from Bunny HQ promised exotic and interesting missions, yet here you are drudging in the lowest level of Commander Lambda's organization. Hopefully you get that promotion soon...
New challenge "Re-ID" added to your home folder.
Time to solve: 168 hours.
Google Foobar first challenge

The two languages available to solve challenges are Java and Python 2.7.13. Yes, I know Python 2.7 is long past its sunset date of January 1st 2020. However, it’s evidently still relevant to Google. In fact, you can still run Python 2 applications on Google Cloud. If you are used to Python 3 you may need to take into account some differences.

Levels and prizes

There are 5 levels in Google Foobar. You need to solve challenges in order to progress and unlock new levels. There is some bonus during the game progression:

  • When you graduate from level 2 to level 3, you receive an invite link to enter Google Foobar. It’s single use, so you better decide carefully to whom you send it!
  • Passing from level 3 to level 4 you can send your challenge solutions and additional details (LinkedIn or Github profile) to a Google recruiter.
  • Completing level 4 and moving to level 5 you receive an additional single-use invite link.
  • Finally, when you complete level 5 you will receive a final encrypted message…just for your enjoyment!

I have read a few posts around the web, seems time limits have been changed over time. When I did Google Foobar, I got 168 hours for each individual challenge until Level 3, 360 hours for the challenges at level 4, and 528 hours for the challenge at level 5.

I will write about each individual challenge in a dedicated post. You will find the post series via the link at the end of this post, stay tuned for updates!

Related links

  • Google Foobar link (it is by invitation only)
  • My series of posts on Google Foobar link
  • Python 2 sunset notice
  • Python 2 status on Google Cloud notice

Do you like our content? Check more of our posts in our blog!