Roblox | Senior Frontend | Phone

Posted
10 Aug 2026
78 reads

Summary

I had a phone interview for a Senior Frontend role where I was asked to build a piano‑key interaction using vanilla HTML, CSS, and JavaScript.

How it went

Front-End Coding Exercise — "Piano Keys"

Stack: Vanilla HTML / CSS / JavaScript. No frameworks, no libraries


The Problem

You're given a row of six piano keys — C, D, E, F, G, A. Make them respond to input.

A key should appear pressed the entire time it is being held down, and return to normal the instant it's released. "Pressed" means the element has the CSS class active — the styling for .key.active is already written for you

The keys must respond to both input methods:

  1. Mouse — press and hold the mouse button on a key.
  2. Physical keyboard — press and hold the matching letter key (c, d, e, f, g, a).

Requirements

  1. Holding the mouse down on a key adds active to that key; releasing removes it.
  2. Holding the corresponding letter on the physical keyboard adds active to that key; releasing removes it.
  3. Multiple keys can be active at once. Holding c and e together should light up both
  4. Keys not in the set (e.g. k, Enter, arrow keys) are ignored.

Questions asked (1)

  1. 01

    Piano Keys Interaction

    Data Structures & Algorithms

    Implement a front‑end component with six piano keys (C, D, E, F, G, A) that respond to user input. A key should have the CSS class active while it is being pressed and lose it when released. The component must support:

    1. Mouse interaction – pressing and holding the mouse button on a key adds active; releasing removes it.
    2. Physical keyboard interaction – pressing and holding the corresponding letter key (c, d, e, f, g, a) adds active; releasing removes it.

    Multiple keys can be active simultaneously, and any other keys (e.g., k, Enter, arrow keys) should be ignored.

    The solution should be built with vanilla HTML, CSS, and JavaScript without any frameworks or libraries.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Roblox recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!