Adobe Interview Question for Interns


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
6
of 6 vote

How can they ask such question in interviews. Its something very weird and i doubt it to be an interview question.

- Nascent June 15, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 vote

the prime_no between 31 to 3000000 will be one of the multiple in 3000000! / 30!
for prime_no <=30; 30*prime_number will be one of the multiple in 3000000! / 30!

power by 100000 will not change the divisibility

so
if (prime_no <= 3000000) return 0 ;
else return prime_no;

- vikash August 06, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Your approach was probably right, but answer was wrong.
the range for ( anything % prime_no ) will be 0 to prime_no-1...
So, returning prime_no is incorrect.

- Rajesh January 11, 2014 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

If you knew Lucas' theorem, then you could solve this easily.

The number is nothing but

(3000000 choose (3000000 - 30)) * ((3000000 - 30) choose (3000000 - 60)) * ( (3000000 - 60) choose (3000000 - 90)) ....

Each binomial coefficient can be computed modulo the prime p using Lucas's theorem (which involves writing the numbers in base p).

If you don't know Lucas' theorem, perhaps you can try and do some clever cancellations to simplify it...

- Loler June 14, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

what is choose here ?

- imrhk June 14, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Binomial coefficient.

- Anonymous June 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@Loler: would you mind elaborating more?I had a look at Lucas theorem but it doesn't seem to fit here.

math.hmc.edu/funfacts/ffiles/30002.4-5.shtml

- anonymous June 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

It is always 0.

Say the prime number is P.

There are two cases

1) P>30
in this case P will be present in (3000000!)/(30!) so (3000000!)/(30) % P will be zero(^10000 does not matter)

2) P < 30
for any prime number P (which is less than 30) there will be at least one number X such that X%P=0 && X>30 .(for P=5..X=35 and for P=7 ...X=49....etc) even in this case ((3000000!)/(30!)) %P will be 0 because of the presence of X.

so in any case the answer is zero

- Karthik June 15, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

ppo thayoli

- sulu February 12, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

(3,000,000)0

- Anonymous July 03, 2016 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More