Roblox frontend phone screen, Piano Keys
Roblox frontend phone screen, Piano Keys
Didn't see many posts on the Roblox frontend track so writing this down. One coding round, around 45 min, plain HTML/CSS/JS only, no frameworks or libraries allowed.
You get a row of piano keys (C D E F G A) already styled, with a .key.active class that makes a key look pressed. Mouse down on a key and hold adds the class, release removes it. Same thing with the keyboard, hitting c d e f g a presses the matching key and letting go releases it. Multiple keys can be held at once, and every other key on the keyboard has to be ignored.
The part that kinda tripped me up was mouse and keyboard stepping on each other, like holding a key down on the keyboard and also clicking it. Also key repeat when you hold a physical key. I ended up tracking what's currently down instead of just toggling the class. Had a working version with a few minutes left but never got to edge cases like releasing the mouse outside the key.
Interviewer was friendly and let me talk through it, tbh that helped. Haven't heard back yet.