/Foobar_Challenge

Primary LanguagePythonMIT LicenseMIT

Foobar Challenge

The Foo bar challenge by Google is a known in the dev community to be a secret way Google shortlists developers.

Now, there are several ways for getting an invite. For some of us it may be random based on our search history. For others, it can be triggered. The following video by Aaishika provides a nice walthrough for this:

Alt text

If Google still hires through this process or not is a mystery. However, the problems were really nice for practicing one's coding skills.

Please note: This repository is purely for educational purposes. We do not claim any responsibility for any misuse of this!

Instructions for a headstart

  • When you get the invite and accept it, do not forget to sign in. Otherwise, if you close that tab, your session will be saved. And even you open the same link again, you won't be able to access it

  • A list shell of commands that help you to navigate through their UNIX terminal like window:

No other shell commands work other than these

  • You can either use Java or Python 2.7 to solve the problems

  • Every time you want to solve a new problem, type request and then press Y. A problem is fetched within a few seconds and a timer is started for that problem.( The time alloted depends on the level you are at. The min is 48 hours)

  • Note: The timer is still running in the background even if you close the particular tab or window and revisit later on

  • To check if you got the problem, type ls (Typically the problem statement and the other files for it is fetched inside a dedicated folder)

  • Note: Google allows you to have only problem at a time. You cannot request another problem, unless you have solved the current one

  • Now move inside the folder using cd name-of-the-problem

  • Typically you'll see there are 4 files by doing ls

    • readme.txt : Contains the problem statement
    • constraints.txt : Contains the contraints of the given problem statement
    • solution.py: The file where you can write your solution in Python
    • solution.java: The file where you can write your solution in Java
  • To view the problem statement type cat readme.txt

  • To start solving using Python(my personal preferrence) or Java, type edit solution.py or edit solution.java

  • Now an editor pops up towards the right of the screen

  • Solve the question here or do some trials in an editor like VSCODE and paster your solution here

  • Remember: The python solutions are to be written in Python 2.7 and not Python 3. You can use an online compiler to change the version and test it

  • Note: You should not change the name of the function while you write your solution here otherwise it won't run

  • Press CTRL+S to save your changes

  • Now press CTRL+E to exit the editor

  • To test your solution on the given test cases (including hidden ones), type verify solution.py or verify solution.java

  • If all of your test cases are satisfied, submit by typing submit solution.py or submit solution.java

Questions

The challenge is divided into 5 levels of increasing difficulty. The number of questions in each level are:

  • Level 1: 1 question
  • Level 2: 2 questions
  • Level 3: 3 questions
  • Level 4: 2 questions
  • Level 5: 1 question

It's hilarious that Google has a palindrome hidden here as "12321" šŸ¤£

Nevertheless, here is a collection of questions and their accepted solutions majority of people have encountered.

Please note: This repository is purely for educational purposes. The solutions given below are what worked for us and there might be even more efficient ones possible. We do not claim responsibility for any misuse of this!

Level 1:

Problem Solution(s)
I Love Lance and Janice Solution
* Prison Labor Dodgers Solution
** Braille Translation Solution
*** Minion Labor Shifts Solution

Level 2:

Problem Solution(s)
Please Pass the Coded Messages Solution
Numbers Station Coded Messages Solution
* Hey I already did that Solution
** Power Hungry Solution
**** Lovely Lucky Lambs Solution

Level 3:

Problem Solution(s)
Queue To Do Solution
The Grandest Staircase of them All Solution
Find the Access Codes Solution
* Fuel Injection Perfection Solution
* Bomb Baby Solution
** Doomsday Fuel Solution
*** Prepare the bunnies escape Solution

Level 4:

Problem Solution(s)
Bringing Gun to Guard Fight Solution
Running with the bunnies Solution
* Escape Pods Solution
** Free the Bunny Prisoners Solution

Level 5:

Problem Solution(s)
Disorderly Escape Solution
** Expanding Nebula Solution
^ Dodge the Lasers Solution

Problems Contributed by: