Coupang Interview Question for Software Engineer / Developers


Country: United States
Interview Type: Phone Interview




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

Forced to give downvote to all. Think about it. What you are going to do when we have 0's lets say? One zero?

input: [1 2 0 5 6]
output: [ 0 0 60 0 0 ]

Hmm.
That was the trick all along.

- NoOne April 22, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

void printArrayMultiplicationBI(int[] array) {
		BigInteger multiplication = new BigInteger("1");
		for (int a : array) {
			multiplication = multiplication.multiply(new BigInteger(Integer.toString(a)));
		}
		for (int a : array) {
			System.out.print(multiplication.divide(new BigInteger(Integer.toString(a)))+" ");
		}
	}

- RP April 23, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

function result(a []int, n int){
max=1;
for i=0;i<n;i++{
max=max*a[i];
}

a[0]=max;
for i=1;i<n;i++{
a[i]=max/a[i];

}
return a

}

- manish September 10, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Multiply all the numbers in first iteration.
In second iteration, divide the above number with current element.

- L April 21, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

public static void result(int array[], int k){
int result =1;
//Time complexity O(n)
for(int i = 0 ; i < k-1 ; i++){
result *=array[i];
}
for(int i = k; i < array.length ; i++){
result *=array[i];
}
array[k-1] = result;
}

- Arun April 21, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

public static void result(int array[], int k){
		int result =1;
		//Time complexity O(n)
		for(int i = 0 ; i < k-1 ; i++){
			result *=array[i];
		}
		for(int i = k; i < array.length ; i++){
			result *=array[i];
		}
		array[k-1] = result;

}

- Arun April 21, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

static void printArrayMultiplication(int[] array) {
		int multiplication = 1;
		for (int a : array) {
			multiplication *= a;
		}
		for (int a : array) {
			System.out.println(multiplication / a);
		}

}

- RP April 21, 2017 | 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