Adobe Interview Question for Software Engineer / Developers






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

Following will be my strategy,
a) if difference between N and current score is greater than 8. I will choose 4
b) if difference between N and current score is less than 9 but greater than 4. I will (choose N - current_Score -5 )
c) if difference between N and current score is less than 5, I will choose the number it self.

If this strategy is used by both then person from whom we started will win.

- Patron May 21, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

will it work for say score to reach is 20, according to algo A 4
B 4
A 4 as the difference is greater than 8.. this is a losing position for A, if B choses 3
B 3

- aditya June 26, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I am not sure abt this .
keep choosing four and choose n-sum for the final value to be selected ?
Thats the fasted route to reach n.

- Anonymous May 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

actually unable to get the question completely.
be specific and try to provide complete data required.
Question above is incomplete...

- Anonymous May 23, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The trick is to see that who ever gets to N-5 wins. So the strategy is reduces to getting to N-5. But then whoever gets to N-10 wins, etc. It, then is easy to see that whoever can get to N-5k where k is the largest number s.t. N-5k is positive, will win. That could be either player depending on the number.

- memo May 23, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

By choosing 4 continuously and then 1 no. which is left
we can reach N at no. of step N/4 ( if N%4==0) otherwise N%4+1. Now, i don't think for any N it's possible to get lesser step then above. So this strategy is best.

- Anonymous June 14, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

the trick is to define the loosing and winning positions from 0 to N.
for example take N = 10;
and follow the algo:
0,1,2,3,4 are winning positions [base case]
for every i
if we can all winning positions from i-{1,2,3,4} then
i is a loosing positions
else
i is a winning position.

- Anonymous June 14, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

the strategy says that to be in a winning situation you must put the opponent in a
position where the remaining points to reach the score value N is divisible by 5(considering that we are allowed to choose only 1,2,3,4)and he/she has to choose.
Suppose, the remaining points to reach the score is x.

Then, if (x%5)=4 on your turn , choose 4
if (x%5)=3 on your turn , choose 3
if (x%5)=2 on your turn , choose 2
if (x%5)=1 on your turn , choose 1
if (x%5)=0 on your turn , you may not win if the opponent is smart enough
and follows the above strategy

- FYI (B silent) June 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

u see all the coins and their positions

find sum of all coins at even pos and sum all coin at odd pos

which ever is greater. make sure that u pick that index coin when your chance is there, u can either win or hv a tie

- ashish June 24, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if the question says the no one player will chose can not be chosen by other immediately for e.g. if player A has chosen 4 then player B cant choose 4 right at this moment then the no to be choose is = no/4;no = no - no/4;

else the question is trivial...the first person will win always..

- Anonymous June 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

let say A chooses number x
So, b should always choose a number 5- x so that B wins.

Not sure, how will A win if he itself is starting the series and b is already aware of strategy.

- Anonymous April 30, 2012 | 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