Amazon Interview Question for Software Engineer / Developers


Country: -




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

Permute the array and get all its subsets and then group them based on sum

- nr September 13, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

That question and the example isn't clear. It seems you want pairs of subsets. But, from your example it looks like subsets could also be from the same array ? What is the significance of the other array then? Why not just combine them into one Array?

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

pls make the question clear

- Anonymous September 13, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

// set default values of subSum to false ...;


for(i = 0; i < n; i++)
{
sum = sum + arr[i];
subSum[i][arr[i]] = true
}

value = 0;
for(i = 1 ; i < n; i ++)
{
for ( s = 0 ; s < sum / 2; s++)
{
subSum[i][s] = subSum[i-1][s] || (arr[i] == s) || subSum[i-1][s-arr[i]];

if(subSum[i][s])
value++;
}
}

print value;

- Anonymous September 19, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

No one should pay shit to ppl like techcoderonwork's ambiguous questions. Get these irritating posters out of CC.

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

Hi Anonymous...
Please dont use abusive words at CC else your post will be deleted.

- Srikant Aggarwal January 28, 2012 | Flag


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