Interview practice question
Typing partial update payloads
Frontend Engineering · TypeScript · Intermediate
Your API accepts PATCH requests where any field of a user can be updated except the ID. How do you type the payload?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Partial<Omit<User, "id">>.
- Distinguish undefined vs null (exactOptionalPropertyTypes).
- Readonly fields excluded.
- Validation at runtime.
- Name the type.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.