← Questions

Top k largest elements

0
Microsoft AIMicrosoftMetaCodingLast asked Sep 2026

A coding interview question asked in Microsoft AI's coding round and at Microsoft and Meta, last asked Sep 2026. It tests heap, quickselect and arrays.

Given an integer array nums and an integer k, return the k largest elements of nums. You may return them in any order.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Microsoft AI · Coding · Last asked Sep 2026Live coding
  • Microsoft · Technical phone screen · Last asked Aug 202660 min · One technical round
  • Meta · AI-enabled coding · Last asked Sep 202560 min · Several progressive tasks on a starter codebase in CoderPad with an AI assistant panel; usually two rounds · The first task usually without AI, later tasks with it

What it tests

heap · quickselect · arrays

Your code and the AI tutor open when you unlock this question.