Facebook Interview Report
- 1of 1 vote
AnswersSelect Kth largest value in the array. Given an unsorted array of size n, and a value k. Select the kth largest value from the array.
For example:
Array is [5, 3, 9, 1], n is 4
k = 0 => 9
k = 1 => 5
k = 3 => 1
- almunayer May 10, 2016 in United Statespublic int kthLargest(int array[], int k) { // ..... }
| Report Duplicate | Flag | PURGE
Facebook Software Engineer Algorithm - 0of 0 votes
Answers// Reverse the words. Given a String that contains words separated by single space, reverse the words in the String. You can assume that no leading or trailing spaces are there.
// For example: "Man bites dog" => "dog bites Man”
- almunayer May 10, 2016 in United StatesString reverseWords(String value) { // Insert implementation }
| Report Duplicate | Flag | PURGE
Facebook Software Engineer Algorithm
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.