All quizzes
Free quiz · 27 questions in the bank

Zod quiz

Test your Zod knowledge with a free interactive quiz — 27 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

How do you mark a field as optional in a Zod object schema?

Questions in this quiz
  1. How do you mark a field as optional in a Zod object schema?
  2. `type User = z.infer<typeof userSchema>` is used to:
  3. `z.union([z.string(), z.number()])` produces a schema that accepts:
  4. `schema.refine(predicate, { message: "..." })` is used to:
  5. Which is the right Zod schema for a plain string?
  6. `z.string().email()` checks that the string:
  7. `schema.pick({ name: true })` and `schema.omit({ email: true })` are used to:
  8. By default, what happens to unknown keys when parsing an object schema?
  9. Which schema validates an object with `name: string` and `age: number`?
  10. Which adds a length range to a string schema?
  11. Which Zod schema represents an array of strings?
  12. How do you make a field accept `null` but not be omitted?
Gaps to close?
Read the curated Zod notes — core concepts, patterns, interview prep.
Zod notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web