FastPrepKth Largest Element in an Array
Problems/Kth Largest Element in an Array

Kth Largest Element in an Array

LinkedIn logoLinkedIn● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a LinkedIn phone screen. The report names the well-known task but does not give the full statement. Our version is about 99% the same as the reported question.

Given an integer array nums and an integer k, return the kth largest element in sorted order.

For this exercise, assume duplicate occurrences count separately; the answer is not the kth distinct value.

Function

findKthLargest(nums: int[], k: int) → int

Examples

Example 1

nums = [3,2,1,5,6,4]k = 2return = 5

Descending order is [6,5,4,3,2,1], whose second value is 5.

Example 2

nums = [3,2,3,1,2,4,5,5,6]k = 4return = 4

The two occurrences of 5 occupy separate ranks, so the fourth largest occurrence is 4.

Constraints

  • 1 <= k <= nums.length <= 10^5.
  • -10^4 <= nums[i] <= 10^4.

More LinkedIn Phone Screen questions

  • Maximum Product of a Contiguous SubarrayPHONE SCREEN · Seen Nov 2026
  • Maximum Sum of a Contiguous SubarrayPHONE SCREEN · Seen Nov 2026
  • Merge Two Sorted ListsPHONE SCREEN · Seen Nov 2026
  • Sqrt(x)PHONE SCREEN · Seen Nov 2026
  • Total Years of Work ExperiencePHONE SCREEN · Seen Nov 2026
  • Sum an Arbitrary-Dimensional ArrayPHONE SCREEN · Seen Oct 2026
  • Known Words Matching Phone DigitsPHONE SCREEN · Seen Oct 2026
  • Inverse-Depth Nested List SumPHONE SCREEN · Seen Oct 2026
  • Valid Number with ExponentsPHONE SCREEN · Seen Oct 2026
  • Sort a Quadratic-Transformed ArrayPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Mutual-Friend RecommendationsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN
  • Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Maximum Number of Events That Can Be AttendedByteDance · PHONE SCREENByteDance interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Select the Top User MatchesDuolingo · PHONE SCREENDuolingo interview questions
  • Meeting Rooms IIQuince · PHONE SCREENQuince interview questions
  • Meeting Rooms IISecuronix · PHONE SCREEN
  • Merge Multiple Sorted StreamsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Maximum Number of Events That Can Be AttendedSnowflake · PHONE SCREENSnowflake interview questions

LinkedIn interview experiences

  • LinkedIn Senior MLE Interview Questions: 1 Experience
  • LinkedIn Staff AI Engineer Phone Screens: 1 Experience
  • LinkedIn Experienced MLE Onsite: 1 Experience
  • LinkedIn Coding with AI Interview: 4 Experiences
  • LinkedIn Experienced Infrastructure SWE Onsite: 1 Experience
All LinkedIn interview questionsSee LinkedIn hiring insights
Saved
class Solution {
    public int findKthLargest(int[] nums, int k) {
        // Write your code here.
    }
}
Checking account…