Question bank › Heap
Dsa Heap Easy

Kth Largest Temperature

You are given a list of daily temperatures for a week. Your task is to find the Kth largest temperature from this list. The input will consist of the number of temperatures, K, and the list of temperatures in degrees Celsius. Input format: - The first line contains two integers N and K (1 <= K <= N <= 100). - The second line contains N integers representing the daily temperatures (-50 <= temperature <= 50). Output format: - Output a single integer representing the Kth largest temperature. Example: Input: 7 3 20 35 15 25 10 30 40 Output: 25

Key concepts

heappriority queuesorting

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.