Goldman Sachs Interview Question for Software Engineer / Developers






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

the question seems incomplete. u were not provided with more information? on what basis do you plan to check the 100th value? have you to account for repetition? are you searching in any particular way? else you could just pick out the last value as its an array. can anyone clear the confusion?
Arithmetic progression in this case makes no sense as you have not specified any particular sequence in which numbers have been entered or a common difference between the entered numbers.

- jango July 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You're assuming no repeats when the question doesn't state it.

- Vince July 11, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

XOR trick

- XYZ July 11, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@Vince , If Repeats are allowed will you be able to tell what Exactly will be the 100th number for sure ?

lets say the array has 99 1s ... whats your pick on 100th number ?

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

have arimetic progression formula n(n+1)/2..
here n= 100..
sum = n(n+1)/2; n=100;
run a loop where sum = sum - a[i]
final value of sum after exiting the loop is the 100th/unknown number...
running time O(n)

- T July 13, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

They should ban Ganesh or any poster who posted incomplete questions... they should have a flag or rating system here where the poster will be flag by people if the question is incomplete

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

First clear your head and then jump into water ..

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

Alternative is using a bitset, bitset[100]. set bitset[a[i]] = 1, now we are left with elements that are not in the array. This also solves repetitions

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

//given *arr of size=99
int findMissingNumber(int *arr, int size) {
    int sum=0;
    for(int i=0; i<size; ++i) sum+=arr[i];
    return (size+1)*((size+2)/2)-sum;
}

- Anonymous March 02, 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