FastPrepSlowest Key Press
Problems/Slowest Key Press

Slowest Key Press

Roblox logoRoblox● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report describes keystrokes as coded letters and times, and asks for the slowest key. Its wording on timing is unclear. We read it as release times that add up, with presses one after another, ties going to the letter later in the alphabet, and limits on the numbers. Our version is about 75% the same as the reported question.

You are given keystrokes. Each row contains an encoded lowercase letter and its release time: [key, time]. Key 0 represents a, key 1 represents b, and key 25 represents z.

For this exercise, assume the times are cumulative release times measured from time 0, in strictly increasing order. Exactly one key is pressed at a time, and the next press begins as soon as the previous key is released. Therefore, the first press lasts keystrokes[0][1] time units; each later press lasts its release time minus the preceding row’s release time.

Return the letter whose single press lasted the longest, as a one-character string. Do not add together separate presses of the same letter. For this exercise, assume ties are resolved by returning the alphabetically larger letter.

Function

slowestKey(keystrokes: int[][]) → String

Examples

Example 1

keystrokes = [[0,2],[1,5],[0,9],[2,15]]return = "c"

The individual press durations are 2, 3, 4 and 6. The c press lasts 6 time units.

Example 2

keystrokes = [[1,3],[0,6],[2,9]]return = "c"

All three presses last 3 time units. The tie rule selects c.

Example 3

keystrokes = [[25,5],[0,9],[25,12]]return = "z"

The first z press lasts 5 time units, longer than the later 4 and 3 time-unit presses.

Constraints

  • 1 <= keystrokes.length <= 1000.
  • Every row contains exactly two integers.
  • 0 <= keystrokes[i][0] <= 25.
  • 1 <= keystrokes[i][1] <= 10^9, and release times are strictly increasing.

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
  • Inventory Discount TrackerOA · 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

Similar questions at other companies

  • REST API: Highest International StudentsRippling · OARippling interview questions
  • Count Invalid Log GroupsIBM · OAIBM interview questions
  • Filter Transaction Logs and Calculate Reliability MetricsStripe · OAStripe interview questions
  • Compare Character Arrays with BackspacesOdoo · OAOdoo interview questions
  • Compress Editor Actions into Operational Transform OperationsReplit · OA · PHONE SCREEN · ONSITE INTERVIEW
  • Best TV Show in a GenreAdyen · OAAdyen interview questions
  • Cheating CodemakerJane Street · OAJane Street interview questions
  • Correct Apartment Bedroom CountsRamp · OARamp interview questions
  • Reflow and Fully Justify Text LinesIntuit · OAIntuit interview questions
  • Cumulative Typosquatting DetectionPalantir · OAPalantir interview questions

Interview reports that mention this question

  • Roblox OA: What It Tests (2026)
  • Roblox New Grad Engineer Rounds: 13 Experiences (Part 6 of 7)
  • Roblox New Grad HackerRank OA: 18 Experiences (Part 5 of 7)

Roblox interview experiences

  • Roblox New Grad Early OA Tasks: 10 Experiences (Part 7 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)
All Roblox interview questionsSee Roblox hiring insights
Saved
class Solution {
    public String slowestKey(int[][] keystrokes) {
        // write your code here
    }

}
Checking account…