Interview practice question
Typing environment variables and configuration
Frontend Engineering · TypeScript · Intermediate
Your app reads environment variables, and missing or misspelled values cause runtime errors. How would you make this type-safe?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Validate env at startup with schema.
- Export typed config object.
- Fail fast with clear errors.
- Distinguish public vs secret vars (frontend).
- Avoid scattered process.env access.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.