Adobe Interview Question for Software Engineer in Tests


Country: India




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

Solutions are here careercup.com/question?id=8872057

- anonymous2 September 23, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Your code is probably wrong. This question is NP hard. We know a NP problem: check if a subset of given numbers sums up to 0.

So, suppose the average of the given set is avg. We subtract every number by avg. Then, the posted question becomes: find a subset of numbers whose sum is 0, which is NP hard.

The practical algorithm is enumeration.

- Anonymous January 29, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

S= S1 union S2
be the partition
s1 is summation of S1
s2 is summation of S2

s1/n1 =s2/n2 = (s1+s2)/(n1+n2)=s/n where s is summation of all elements of S

let P(i,j) denote there is a subset of 1..i such that summation=j
so find P(i,j) such that j=s/n
and
P(i,j) = max { P(i-1,j) ,P(i-1,j-ai) } ai is the ith element

if P(n,s/n)=1 then return "yes"
else return "no partition"

- subhadeep October 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

can u pls explain ur code

- rakesh October 12, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

can u pls explain ur code

- rakesh October 12, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

we have to sort it the array
suppose 142356
123456
every alternative should be added to different array .
i guess we cant have exactly same result all the time... if n is even or odd .

- manju February 23, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.


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