SpinTheMic
Pro

Interview practice question

Remembering a user's preference between visits

Frontend Engineering · Async JavaScript and the Browser · Beginner

How would you remember a user's theme preference between visits?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • localStorage for simple non-sensitive data.
  • Read on load, apply early.
  • try/catch (storage may fail).
  • Sync with server for logged-in users.
  • Respect system default.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics