System Design · Junior · Question 32 of 75
Where should form data be validated?
- ✓Correct answer: On the client for convenience and on the server for security
- 2Only on the client - the server receives already-checked data
- 3Only on the server - client-side validation is pointless
Explanation
Client-side validation gives instant feedback but is easily bypassed with a direct request. The server must check everything. A shared schema (e.g. Zod) can be reused on both sides.