Bloomberg L.P.
Work in HR? Unlock Free Profile

Bloomberg L.P. Financial Software Developer Intern Interview Question (student candidate)

"1. How will you find the max and second max of an array of n elements? How will you find the largest k elements? 2. How will you properly shuffle a deck of cards?"
Add Tags [?]

Part of a Financial Software Developer Intern Interview Review - one of 1,743 Bloomberg L.P. Interview Reviews

Answers & Comments

of 0
1. First part is easy. Have two max ints. if currentInt > max1, max2 = max1, max1 = currentInt. When you get k, you need to check each max value in array of size k. You could also sort in O(n log n) and get last k elements.

2. To shuffle, you can pick a random position (after current pos) and swap with current. There are many more ways.
- Anonymous on Oct 11, 2013

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.