HackerEarth
Frontend Engineer
Event Delegation in a List
Medium
ROUND 1general_knowledgeCandidate Not Selected
Given the following <ul> with multiple <li> elements, add a single event listener to the parent <ul> that logs the clicked <li> using event delegation. Explain why event delegation is preferred over attaching listeners to every <li>.
This question was asked in
HackerEarth Frontend Engineer Interview Experience
The HackerEarth interview process involved a single round and covered a broad range of topics related to CSS, JavaScript, and React. Candidates can expect questions focused on event handling, CSS layout properties, and the workings of React hooks and components. Overall, the interview presented a moderate difficulty level, challenging candidates to demonstrate both their technical knowledge and practical coding skills.