Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

SuprDewd's blog

By SuprDewd, 3 years ago, In English,

A couple of years ago Google launched an interesting website: Google Foobar. If you try to log in, you'll get an error saying:

To login, you have to have logged in before. Confused? Search on...

Pretty mysterious, right? Well, from what I read on Hacker News at the time, this is some kind of a puzzle set up by Google to recruit Python and Java developers. To get in, you'd simply have to search for the correct phrase. Someone reported that searching for "arraylist java" got him inside, but that didn't work for me.

However, I recently found that searching for this actually gets you inside, but you have to be a little bit patient. Here's what you can do:

  1. Open a browser of your choice (it has to be a sufficiently new version so you get the newest version of Google). I've only tested this successfully with Chrome and Firefox.

  2. Go to https://google.com/ncr. (The /ncr at the end is to make sure you go to the main version of Google. Don't know if that's necessary, but doesn't hurt)

  3. Search for "arraylist java" or "python list comprehension". Other programming-related search terms may also work, but these should definitely work.

  4. Here comes the "be a little bit patient" part. Copy the URL for the search results page that you just got (Ctrl+L, Ctrl+C). Now open a lot of tabs with the same URL (repeat Ctrl+T, Ctrl+V, Enter). I'm not sure how many tabs you need to open, but from my experience 10 tabs should be sufficient.

  5. Wait for each of the tabs to load. Then go through them, one by one, and look for a tab that contains a black banner saying "You're speaking our language. Up for a challenge?" at the top of the search results. (If you don't get any tab with this banner, try going back to step 1, possibly using a different browser.)

  6. Click "I want to play". You're in!

Now you will be presented with a terminal that you can use to solve some competitive programming-style problems using Java or Python. They start easy and become progressively harder, and each problem has a certain time frame you have to solve it within.

When you've progressed to the third or fourth level (don't remember which one), you get the opportunity to send your code to Google recruiters. From what I've read online, this has lead to some people getting an interview at Google. So if you're interested in that, this might be your chance! If not, it's still a bunch of fun problems to solve. :)

 
 
 
 
  • Vote: I like it
  • +207
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

But there is only terminal.

how to get to questions>

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    If you type ls you will see a list of files, including a file called start_here.txt. Typing cat start_here.txt prints the following:

    Type request to request a challenge. Type help for a list of commands.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      yeah got it and solving 1 quest

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I'm doing the first question (Braille_translation_2) right but it always shows failed for test case 4,9 & 10. confused :-(

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I can't type anything in the terminal.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How about C++ or other language ??

»
3 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

~ Proceeds to learn Python ~

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Java is probably closer to C++ — the syntax is very similar. I think you may find it easier to learn than Python, because I see you use C++ already.

»
3 years ago, # |
  Vote: I like it -13 Vote: I do not like it

This ain't EARNing the chance of the interview.

»
3 years ago, # |
  Vote: I like it +7 Vote: I do not like it

it's not so tricky to get interviewed by google. They interview almost everyone. It's tricky to get hired by google.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +34 Vote: I do not like it

    wow, almost everyone !?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +34 Vote: I do not like it

    It depends, probably, but for me it was harder to get interviewed. (I had failed attempt to get interviewed, but got offer from first interview)

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +20 Vote: I do not like it

    Almost anyone? I didn't get a reply until I got a referral by someone from google...

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      I got interview after participating in Google Code Jam and I was far from being a winner =)

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it +5 Vote: I do not like it

        I forget about code jam every year. Hopefully codeforces would remind me this year. If you don't mind, how did you perform in google code jam?

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it +8 Vote: I do not like it

          If you register I think you'll get an email when the qualification round starts. (Registration just opened a couple of days ago)

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it +5 Vote: I do not like it

          Round 1C 2016 was the last round for me and my rank was 1435.
          I've sent solution "Senate Evacuation" in 52 minutes and solution for "Slides!" after 2h30m since the start of the contest. I couldn't solve "Fashion Police" even with easy constraints.

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Oh interesting. I wonder what do they look at(maybe it depends on your CV and location). I have friends who got to round 2, but did not get an interview. Thanks for the info :)

            • »
              »
              »
              »
              »
              »
              »
              3 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              Probably, quality of the code. But this is only my speculation.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Almost everyone?! I applied a lot in google.com/jobs, advanced to round 3 in google code jam, also solved the challenges in foobar, but never invited to interview by google :)

    • »
      »
      »
      2 years ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Try to get referral.

      • »
        »
        »
        »
        2 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Yeah, I heard about that, but unfortunately I got no friend working there.

»
3 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

At the end of level 2 you get a referral link At the end of level 3 you get asked for contact information so a recruiter can contact you At the end of level 4 you get a second referral link At the end of level 5 you get an encrypted string that I still have no idea what it means, with a note "for your eyes only"

Proof: http://i.imgur.com/pFxzMlk.png

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    What is a referral link used for?

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      its a link that you send someone and they get instant access to foobar, without going through the trouble of triggering it themselves

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Would you (or anyone) mind sending me a PM with referral link? I'd love to at least see what puzzles they have prepared.

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          It is a single-use referral link, I still have one, which I would like to keep for later.

          Following the procedure in this blog post, I triggered foobar 5 times in 20 tabs. So keep trying and you will get it

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I tried to do that multiple times, still to no success, but well, thanks anyway!

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it +8 Vote: I do not like it

    Decrypting the message is worth it only if you're doing it for fun :)

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Did you manage to decrypt it?

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Yeah, the "for your eyes only" is a key hint.

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          your comment now is a key hint for me :p

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Doesn't seem to work for me, tried Firefox and Chrome :/

Do I have to be logged in?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    yes

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    It didn't work for me either even though I was logged in.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yeah, was logged in too :s

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thanks a lot. The private mode works for me, and it only takes one time for me.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      I was finally able to get it in private mode (not logged in) in Firefox :)

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        How long did it take and how many tabs did you open?

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          Yesterday, I tried a lot of tabs logged in and I guess about 40+ in private mode, but it didn't work.

          Today I tried like 40 tabs logged in, and then 1 tab in private mode and I got it :D

          So I suggest trying on different days, good luck :D

          edit: funnily I can now only reaccess foobar from private mode

»
3 years ago, # |
  Vote: I like it +18 Vote: I do not like it

What happens if you don't solve the problem within the time window?

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Nothing works for me — tried Firefox, Chrome, both queries too. Maybe that's because I have already applied there several times and Google knows everything?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It works for me even if I'm logged out and in incognito mode. However, I just tried this on a computer belonging to a non-programmer, and I can't get it working there... So apparently this only seems to work under some special circumstances. (That, or I didn't open enough tabs.)

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Well, normally when I do all my coding and stuff I am not logged in my Gmail account, so that is probably the reason.

»
3 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

How to switch to editor? I'm pressing TAB + ESC + ENTER, but when pressing TAB, this comes to screen :

verify submit status request ls less help feedback edit deleteme cat cd

Thanks in advance.

I found how to do it, thanks anyway.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    for future reference, use edit solution.java or edit solution.py

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I was able to open terminal also solved one problem. Till what time terminal would be accessible?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Never mind I figured out. It seems like it would be available for a week as I have solved one problem. Its telling you have survived one week in organization.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Can anyone confirm that you do actually have one week to solve the next/remaining problems?

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it
      You survived a week in Commander Lambda's organization, and you even managed to get yourself promoted. Hooray! Henchmen still don't have the kind of security access you'll need to take down Commander Lambda, though, so you'd better keep working. Chop chop!
      

      I don't think this mean it will be available for a week.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I'm pretty sure that you have forever to solve the problems, and the time limit only applies when you request a new one. Why would they limit your availability to the terminal?

»
3 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Anyone getting "Error compiling the code, please try again later" (java) on the second round? It compiles on my local machine.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes me Have you found the problem ???

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Please tell whats the issue? Why is it saying "Error compiling the code, please try again later" (java)"?

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        you need not to take input from console just make a function like you do in Topcoder SRM.

»
3 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Not sure if this is the most relevant place to discuss problems from it, but can someone who has solved grid zero(with an approximate/non-approximate solution) from level 5 give some hint to their approach? I read it long back but never figured anything out, some googling revealed that the problem is NP hard?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Also not sure if it's a great idea to be discussing the problems, but just wanted to point out that people seem to be getting different problems, so you'd need to post the statement.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      1. Regarding problem statement: the link has it
      2. I just googled the problem and found a lot of websites discussing the problem(so I thought it is okay to discuss them), but if it's not okay, please don't reply to my comment.
      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Sorry, didn't see the link.

        How big can n be? If it's small, e.g. n <= 15 as mentioned in the link, and BFS is too slow, then bidirectional search would be my next bet.

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
          Rev. 2   Vote: I like it +5 Vote: I do not like it

          Are you talking about this problem or did I miss something?

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I believe he was talking about this problem from Google Foobar. However, it seems to be exactly the same problem, but with a much smaller grid. I guess this problem is not NP-Hard after all, as suggested by the referenced Stack Overflow question?

            • »
              »
              »
              »
              »
              »
              »
              3 years ago, # ^ |
              Rev. 2   Vote: I like it +5 Vote: I do not like it

              This is if n is even and seems to be very bad if n is odd.

              If n is even, row[i] + column[j] mod 2 changes only for toggled (i,j), where row[i] is the sum of all elements of row i and column[j] is the sum of all elements of column j.

              If n is odd it is equivalent to some bad-looking problem. You're given an odd-size matrix A modulo 2. You may invert any it's row or column and the number of (all) inversions must be even. You must minimize the number of zeroes in this matrix. I have no idea how to solve this faster than O(2 n).

              • »
                »
                »
                »
                »
                »
                »
                »
                3 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                Ah, OK, I missed the part about n being even in the problem you posted. But yeah, interesting.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Getting error:-> Error compiling the code, please try again later. in java please help My solution is working on my machine and also on online editors such as codeforces custom input

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Check constraints.txt, maybe you use a Java 8 feature?

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I am using java 7 in my local computer. It runs successfully but still got the same error. "Error compiling the code, please try again later." What to do now ?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I'm pretty sure Google compiling is broken. In fact, I tried to judge the exact same code that had compiled and been judged earlier, but it still give error! I think only solution is to wait.

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      thanks

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I am a little worried though. It has already been a full day and it still will not work!

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I used java 7 in my computer and run the code here. It worked well in local environment. The test output showed correct result. I waited 1.5 days long according to your statement. But still got the same error. Now I am searching for a solution. please help me.

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I have no more hope left for Google.

            • »
              »
              »
              »
              »
              »
              »
              3 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              How do I get help ? Do you have any idea ? Because, I searched for google help for Foober. But there is nothing found.

              • »
                »
                »
                »
                »
                »
                »
                »
                3 years ago, # ^ |
                Rev. 2   Vote: I like it +3 Vote: I do not like it

                It's already been almost 3 days without working for me, and I only have one hour left for my 3 day challenge. As far as I can tell, it's going to be broken indefinitely. Never knew Google could make such mistakes.

                UPD: My time just ran out. GG

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 years ago, # ^ |
                    Vote: I like it +3 Vote: I do not like it

                  What happens after your time runs out? Are able to login and restart the whole process?

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 years ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  I can still log in and do stuff in the terminal. I read online somewhere that you can request a new challenge, but I am going to wait a week or so before doing it.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 years ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  My code finally works. I guess you used other class like inner class to make a node or something. Foobar server does not allow this. Actually I did it before to make a tree of nodes. But once I removed inner class and used so many variables instead of inner class it works !!!

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 years ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  I didn't use an inner class.

»
3 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

WOW it worked...

It felt so cool I thought I was hacking the pentagon or something...too bad I can't write in JAVA or python...

Good luck guys!!!

:)

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    Why not use it as a motivation to learn the basics of one of those languages? :) The tasks are quite easy at the start and you cannot lose, only win!

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +6 Vote: I do not like it

      *You are given days to solve simple implementation task, with unlimited tries, that's how hard to lose

      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Do you have unlimited tries? I was so scared of failing so I tested super thoroughly.

        • »
          »
          »
          »
          »
          3 years ago, # ^ |
            Vote: I like it +5 Vote: I do not like it

          Yes, I can confidently say that.

          • »
            »
            »
            »
            »
            »
            3 years ago, # ^ |
              Vote: I like it -22 Vote: I do not like it

            Fucked in the ass. Once you submit you can't try the same problem. You should be punished!

            • »
              »
              »
              »
              »
              »
              »
              3 years ago, # ^ |
                Vote: I like it +3 Vote: I do not like it

              Oh god, I think they made it clear that it's a one time submission. What was unlimited is the verify command, and so far everytime I got AC in verify led to 100% in submission. (Not sure if they will check if the code is flawed manually)

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I'd like to discuss about the problem "Distract the guards", as I realize that my submitted AC code actually fails in a counter test case that I came up with during reviewing my code.

If anyone is interested please PM me, I'd like to hear some thoughts from others on that problem.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    So,finally did you get an interview call (Or what was the response from google)??

    • »
      »
      »
      3 years ago, # ^ |
      Rev. 2   Vote: I like it +14 Vote: I do not like it

      I've got my interview call

      Edit: Quite a few people have wrote to me about my situation so I would just put it here, if you want some extra details you are always welcome to PM me. :)

      1. How long till you receive email from Google?

      Around two weeks later, a recruiter wrote to me and confirmed my intention of applying for an internship, and assured me that there will be a phone interview for the next internship recruitment cycle. (For the China region, this is around Jan on each year)

      1. Have you solved the levels afterwards? Were there any extra favours?

      Yes I have solved them afterwards but there was no follow-up email. As other's have mentioned what you will get is another invite link, an encryted message (it is encrypted slightly different for each user), and some feedback forms.

      1. Does this stack up with the APAC (or kickstart) test?

      So far there is no evidence supporting this, but I will update if I have found any traces throughout my pursuit next year.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Worked for me.. Currently on 4 level.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I'm stuck on problem — Bringing a Gun to a Guard Fight

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Did anyone come across a question on Level 4 that requires to plan the path in such a way that maximum number of nodes should be visited between the starting and ending node in the graph with the constraint being that this has to be done with total weight of the path less than or equal to a given limit, and the path has to end at the end (last) node?

For example, if the graph is [[0, 1, 1, 1, 1], [1, 0, 1, 1, 1], [1, 1, 0, 1, 1], [1, 1, 1, 0, 1], [1, 1, 1, 1, 0]] with the limit on weight of the path being 3, 0th node be the starting node, and 4th node be the ending node, the answer would be [1, 2], i.e. 1st node and 2nd node.

I tried using DFS recursively from starting node to get all the valid paths (within limit and ending at last node) and return the path with maximum nodes, but it is slow. Any resource or idea in this space would be appreciated?

»
3 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

tgsdfgsdfv

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

After log in with a referal, how much time I have before the referal get expired? Before sending a request command?

  • »
    »
    2 months ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    I think there's no such defined expiration period of a referral after signing in. Time starts only when you request a challenge. So, don't worry. Request a challenge only when you're actually prepared.

»
5 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Does Google still hire through Foobar? I wasn't able to find any new posts on this topic. So I'm just curious to know if this challenge is still active or not.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I was able to log in today using the method in the post and I did the first challenge so its still active.

    • »
      »
      »
      12 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      That's good but actually, I wanted to know does Google still hire developers using Foobar? I didn't come across any post that was posted after 2018 about Foobar.