Code Room
Code reviewMediumcr-g023
Subject XssLevel Mid–Senior~20 minCommon in Security interviewsIndustries Software development

Question

Review this TypeScript front-end component that renders a search results header.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewts
function renderHeader(container: HTMLElement) {  const params = new URLSearchParams(window.location.search);  const q = params.get('q') ?? '';  container.innerHTML =    `<h2>Results for "${q}"</h2>` +    `<a href="/search?q=${q}">Refine search</a>`;}
Run or narrate your approach, then ask the coach.