## Ebay Interview Question for Software Engineer / Developers

Team: Traffic
Country: United States
Interview Type: In-Person

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

You need to have an agreement with the contractor that he doesn't sell off the gold pieces you give him till the end of 7th day

Piece 1: \$1000 (1st cut)
Piece 2: \$2000 (2nd cut)
Remainder - P3: \$4000

Day 1: P1
Day2: Take P1 back, Give P2
Day3: Give P1
Day4: Take P1+P2, Give P3
Day5: Give P1
Day6: Get P1 back Give P2
Day7: Give P1

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

Classic, +1.

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

Yes.
Cut should be always on power of 2's. same can be expanded to any number of days .

2^0=1000
2^1=2000
2^2=4000
2^3=8000
and so on... based on the max value.

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

kiran- why shud th cut be power of 2?

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

Sell the gold to someone for \$7000 and then give him cash each day.

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

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

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

``Why should we cut the plate? Or Involve third party? Take security deposit of \$7000 from the contractor and give him the plate and pay him \$1000 everyday for his work.``

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

Why cut the plate? or involve third party? Just take security deposit of \$7000 from the contractor and give him the gold plate then pay him \$1000 everyday for his work.

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

Its working on binary number system see

4, 2 , 1 <= binary weights
0 0 0 = 0
0 0 1 = 1
0 1 0 = 2
0 1 1 = 3
1 0 0 = 4
1 0 1 = 5
1 1 0 = 6
1 1 1 = 7

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

for the sake of convenience, I am assuming the plate is in a square shape, so thin as a paper, but it can be of any other shape.
1st Cut: 1st day: Cut the 1000 \$ worth of plate to pay
2nd cut: 2nd day: fold the paper in 6 folds with equal size(fold vertically such that its length remains same), each fold worth is 1000\$. Now cut the folded paper from the centre along the length not the breadth wise. This will you 6 equal pieces, which are enough to pay.

I have checked cutting a sample paper folding like I explained and it works. Let me know if you have any questions on it...Thanks!!

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.

### 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.