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

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

Questions in this quiz
  1. What is the difference between `schema.parse(value)` and `schema.safeParse(value)`?
  2. A `ZodError` carries the failure details in:
  3. Which schema validates an object with `name: string` and `age: number`?
  4. How do you make a field accept `null` but not be omitted?
  5. `z.string().regex(/^[a-z0-9-]+$/)` does what?
  6. By default, what happens to unknown keys when parsing an object schema?
  7. `schema.partial()` and `schema.required()` on an object schema do what?
  8. A common, robust place to call `schema.parse(...)` is:
  9. Which is the right Zod schema for a plain string?
  10. `z.string().email()` checks that the string:
  11. `schema.refine(predicate, { message: "..." })` is used to:
  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

.NET.NET MAUIAbsintheAccessibilityActixActix Web