All jobs / Frontend / web developer / Security
Frontend / web developer interview question · 5+ years
A junior's PR works but has an XSS hole and no tests. How do you mentor in review?
The strongest answer
Block the vuln, explain the path, pair on a test, and don't shame them
Why it works
Security is non-negotiable; the lesson is the point of seniority. Pairing beats a drive-by fix.
What a good answer covers
- Protect users, then teach.
- Do not merge the hole.
- Walk the failure mode.
- Write the test together.
Answers that fall short
- Close, but not the strongest: Fix it yourself silently and approve
Silent fixes teach nothing and leave the next PR the same. - Weak: Approve now and mention it later
Approving a known XSS is the incident. - Red flag: Roast them in a public channel
Public roast is how people hide bugs from you next time.
Who gets asked this
More Security questions
- How do you keep consent state consistent across web, a WebView, and a pixel manager?
- Marketing wants to render a CMS HTML snippet in React. Strongest answer?
- A cookie-session SPA posts state-changing requests. What do you do in the browser about CSRF?
- Auth token in localStorage versus an httpOnly cookie for a SPA — how do you argue it?
- You need a small inline boot script but CSP forbids unsafe-inline. What do you do?
- Two 401s trigger two refresh calls and one of them logs the user out. How do you design the client?
- Product wants full click tapes plus form field values in the frontend logger. How do you respond?
- Legal says marketing pixels cannot run before consent. How do you architect the frontend?