Frontend Traffic Light (HTML / CSS / JS)

Asked at Salesforce · Coding Questions · Difficulty: Medium · Last asked Jan 30, 2026

Salesforce's signature frontend coding round, asked even of generalist / backend candidates applying to fullstack-titled roles. Build a traffic light that cycles red 4s -> green 1s -> yellow 1s using only HTML, CSS, and vanilla JavaScript (no React allowed in the CoderPad sandbox).

Loading the problem…