FastPrepCompetitive Gaming Ranks
Problems/Competitive Gaming Ranks

Competitive Gaming Ranks

Roblox logoRoblox● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The candidate names Competitive Gaming. Separate reference screenshots give competition ranks, the rule that zero scores are left out, and the limits. The screenshots are not this candidate's own images. Our version is about 95% the same as the reported question.

A player’s competition rank is 1 + the number of players with a strictly greater score. Tied players share a rank, and the next rank skips the tied positions. Scores [100,100,100,90] therefore have ranks [1,1,1,4].

Count players whose rank is at most k and whose score is positive. A zero-score player never levels up, regardless of rank. For this exercise, assume k = 0 admits no players. Do not change the input.

Function

numPlayers(k: int, scores: int[]) → int

Examples

Example 1

k = 3scores = [100,50,50,25]return = 3

The ranks are 1, 2, 2, 4, so the first three players qualify.

Example 2

k = 2scores = [100,100,100,90]return = 3

All three top players have rank 1, even though more than k players qualify.

Example 3

k = 3scores = [0,0,0]return = 0

Zero-score players cannot level up.

Constraints

  • 1 <= scores.length <= 100000.
  • 0 <= scores[i] <= 100.
  • 0 <= k <= scores.length.

More Roblox Online Assessment questions

  • Centered Block Placement QueriesOA · Seen Oct 2026
  • Robot Navigation Around LasersOA · Seen Oct 2026
  • Factory Batch Profit (Game Adaptation)OA · Seen Sep 2026
  • Nested Recipe Blocks (Game Adaptation)OA · Seen Sep 2026
  • Vehicle Builds for Required Terrain (Game Adaptation)OA · Seen Sep 2026
  • Track Received Byte RangesOA · Seen Sep 2026
  • Break a PalindromeOA · Seen Jun 2026
  • Count Pairs Differing in One DigitOA · Seen Oct 2025
  • Find Zero Cells in a 2×2 GridOA · Seen Oct 2025
  • Cat Route Budget Planning (Game Adaptation)OA · Seen Aug 2025

Similar questions at other companies

  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • Word Frequency Counts in Alphabetical OrderAbridge · OAAbridge interview questions
  • Minimum Magic Stones After MergesElevenLabs · OAElevenLabs interview questions
  • Items SortAkuna Capital · OAAkuna Capital interview questions
  • Count Cross-Array Target-Sum PairsVisa · OAVisa interview questions
  • Array Rank TransformTata Consultancy Services · OATata Consultancy Services interview questions
  • Find Max Health SumAmazon · OA
  • Influencers SquadTikTok · OATikTok interview questions
  • Count Teams Outscoring a Target TeamBloomberg LP · OABloomberg LP interview questions
  • Count Soldiers with a Next-Rank SuperiorMarshall Wace · OAMarshall Wace interview questions

Interview reports that mention this question

  • Roblox New Grad Engineer Rounds: 13 Experiences (Part 6 of 7)

Roblox interview experiences

  • Roblox New Grad Early OA Tasks: 10 Experiences (Part 7 of 7)
  • Roblox New Grad HackerRank OA: 18 Experiences (Part 5 of 7)
  • Roblox New Grad CodeSignal Finals: 23 Experiences (Part 4 of 7)
  • Roblox New Grad Games and BQ: 25 Experiences (Part 3 of 7)
  • Roblox New Grad Coding Rounds: 23 Experiences (Part 2 of 7)
All Roblox interview questionsSee Roblox hiring insights
Saved
class Solution {
    public int numPlayers(int k, int[] scores) {
        // write your code here
    }

}
Checking account…