Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google FooBar challenge showing Blacklisted_Code error [closed]

Tags:

java

I stumbled upon the Google Foo Bar challenge today. While solving the first question which was pretty simple --> Involved creating concatenation of all prime numbers in String, let's call it as primeString, and then just taking 5 lettered substring from that primeString from given index i.

I was happy that it was easy and tried approach of generating prime numbers using Sieve. It showed the error shown in the image below. I also tried normal brute force method of generating prime numbers, again it showed the same error.

I am using Java language to solve it. I am using an online Java compiler as IDE and then I copy-pasted my code into the editor since the default editor does not have any code compilation feature.

I searched throughout the meaning of this error. I couldn't find any solution. Can someone please explain to me what this error is?

verify Solution.java error

like image 817
Sukanya Pai Avatar asked May 06 '20 19:05

Sukanya Pai


People also ask

Does Google actually hire from Foobar?

Google Foobar challenge is a secret hiring process of Google to recruiting top programmers and developers around the world. This is a way through which they provide direct interviews to the individual who cleared the challenge.

What is blacklisted code in Foobar?

This can be the result of a Compilation Error, Run Time Error or Change of format from their template. Blacklisted Code - There are some libraries that are prohibited to use. If you use one of them, your code will be blacklisted.

Does Google Foobar challenge expire?

Level 1 has one challenge with a time limit of 48 hours (2 days). Level 2 has two challenges with a time limit of 72 hours (3 days) per challenge. Level 3 has three challenges with a time limit of 96 hours (4 days) per challenge.

What happens after completing Google Foobar?

Foobar is Google's Secret Hiring Process. Typically, after you finish Level-3, you should see a question asking if you're interested to hear from a Recruiter at Google. That gives you an opportunity to get interviewed for a position at Google that matches your qualifications. That's the benefit — you get shortlisted!


Video Answer


1 Answers

I came across the constraint.txt file in the challenge which had the below rules for Java:

Java Constraints

So based on the point highlighted, I had used import java.utils.* wildcard import statement in my java code. Wildcard imports would constitute Blacklisted code, which was why I was getting the error. Thanks everyone for your help.

like image 193
Sukanya Pai Avatar answered Nov 07 '22 10:11

Sukanya Pai