
12 Frontend Interview Questions That Senior Devs Still Get Wrong
You've been writing React for 5 years. You can center a div (most days). But these 12 questions still trip up senior frontend developers in interviews. I compiled these from 40+ real interview experiences — not theoretical gotchas, but questions that actually separate "senior" from "truly senior." 1. Event Loop: Predict the Output console . log ( ' 1 ' ); setTimeout (() => console . log ( ' 2 ' ), 0 ); Promise . resolve (). then (() => console . log ( ' 3 ' )); console . log ( ' 4 ' ); Answer: 1, 4, 3, 2 Why seniors get it wrong: They know setTimeout is async but forget microtasks (Promises) execute before macrotasks (setTimeout). The event loop processes the entire microtask queue before moving to the next macrotask. Interview tip: Draw the call stack, microtask queue, and macrotask queue. Interviewers love visual thinkers. 2. CSS Specificity: Which Style Wins? #header .nav li a { color : blue ; } /* Specificity: 0-1-2-1 */ .nav-link.active { color : red ; } /* Specificity: 0-0-2-0 */
Continue reading on Dev.to Webdev
Opens in a new tab



