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/12Score 0

What is the difference between `schema.parse(value)` and `schema.safeParse(value)`?

In this round
  1. What is the difference between `schema.parse(value)` and `schema.safeParse(value)`?
  2. How do you mark a field as optional in a Zod object schema?
  3. `schema.partial()` and `schema.required()` on an object schema do what?
  4. Which Zod schema represents an array of strings?
  5. `schema.pick({ name: true })` and `schema.omit({ email: true })` are used to:
  6. Which adds a length range to a string schema?
  7. What is Zod?
  8. How do you make a field accept `null` but not be omitted?
  9. For server-side validation (e.g. an Express/Next.js handler), the recommended pattern is:
  10. How do you create a Zod schema for a fixed set of string values, e.g. `"draft" | "published"`?
  11. `z.union([z.string(), z.number()])` produces a schema that accepts:
  12. `objectSchema.extend({ extra: z.string() })` does what?
Gaps to close?
Read the curated Zod notes — core concepts, patterns, interview prep.
Zod notes

More quizzes

.NETAccessibilityAgile MethodologyAlertmanagerAlgorithmsAndroid