Back to Interview Hub

API Design Questions

REST, GraphQL, gRPC, and payload security.

Showing 1-1 of 1 questions

1 / 1
1QuestionsEasy🔥 62% Asked

How do you secure an API endpoint?

Asked in:GoogleAirbnb
  1. Authentication/Authorization: Use JWT or OAuth2. Ensure roles/permissions are checked.
  2. Rate Limiting: Prevent DDoS and brute force by limiting requests per IP/User.
  3. Payload Validation: Never trust client input. Use libraries like Zod or Joi to validate request body/params.
  4. CORS: Restrict allowed origins.
  5. HTTPS: Encrypt data in transit.

Note: For more insights, explore our Developer Tools.