Q1. What is input validation and why does it matter?
Input validation is the practice of checking data from users before your app uses it, things like confirming an email field actually contains an @ sign or that a number field is not empty. It matters because untrusted input causes the most common bugs and security holes: crashes from malformed data, corrupted databases, and injection attacks like SQL injection or XSS. Validating at the boundary keeps the rest of your code able to assume its inputs are well-formed.