Interview practice question
Keeping filter state in the URL
Frontend Engineering · React · Intermediate
Users want to share links to filtered product lists, but filters are lost on refresh. How would you fix this?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Store filters in URL search params.
- Read from router's search params as source of truth.
- Update with replace/push appropriately.
- Validate/parse params.
- Debounce frequent updates.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.