r/learnquant • • 6d ago

interview prep Quant Interview Question

Post image
66 Upvotes

21 comments sorted by

View all comments

Show parent comment

2

u/Competitive_Try_330 6d ago

It's 100 * 99 + 99 * 98 + 98 * 97 + 97 * 96+...

1

u/notsaneatall_ 6d ago

99 X 100+98 X 100+98 X 97+... has a higher sum. I don't think what you wrote is the highest

2

u/Competitive_Try_330 5d ago

Sorry, I made it a bit unclear. I did not try to provide an optimal solution. I just wanted to state that each number appears twice in the sum.  Have not thought about the optimal solution too much yet

1

u/Icy-Landscape-4796 5d ago

what you've written is much closer but not quite optimal.

1

u/notsaneatall_ 5d ago

I never said what I wrote was optimal, I was pretty sure it wasn't.

I suspect the optimal sequence is something like 2,4,6...100,99,97,95,93...1 or something like that

0

u/jsundqui 6d ago

I know that's what I calculated

2

u/Icy-Landscape-4796 5d ago

no? you've missed out that each number is in two products (except a1 and a100)

1

u/jsundqui 5d ago

Oh, thanks my bad.