Partial, Pick and Omit

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • medium
  • Pro

You have a User type with an id, a name, an email, a password hash and a creation date. You need three related types: the fields a user may change in an update, where every field is optional and the id can't be changed; the public profile, with only the id and name; and the input for creating a user, with everything except the id and the creation date. Explain how you'd define them without copying fields by hand.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →