✅ Web development Interview Questions with Answers Part-6
51. What is REST architecture and its principles?
REST is an architectural style for APIs. It uses standard HTTP methods. It is stateless. Resources are identified by URLs. Responses are usually JSON. This keeps APIs simple and scalable.
52. What are HTTP methods and common HTTP status codes?
GET fetches data. POST creates data. PUT updates data. PATCH partially updates data. DELETE removes data. 200 means success. 201 means created. 400 means client error. 401 means unauthorized. 404 means not found. 500 means server error.
53. What does stateless architecture mean?
The server does not store client state. Each request contains all required information. This improves scalability and reliability. Authentication uses tokens instead of sessions.
54. What is the difference between authentication and authorization?
Authentication verifies identity. Authorization checks permissions. Login is authentication. Access control is authorization.
55. How does JWT-based authentication work?
User logs in with credentials. Server validates and generates a token. Token is sent with every request. Server verifies the token signature. No server-side session is stored.
56. What is the difference between cookies, local storage, and session storage?
Cookies are sent with every request. Local storage persists until cleared. Session storage clears when tab closes. I avoid storing sensitive data in all three.
57. What is CORS and how do you resolve CORS issues?
CORS restricts cross-origin requests. It is enforced by the browser. Server must allow required origins and headers. Misconfiguration causes blocked API calls.
58. What is middleware and why is it used?
Middleware runs between request and response. It handles logging, auth, validation. It keeps code modular and reusable.
59. Why is API versioning important?
It prevents breaking existing clients. It allows safe feature evolution. Versions are usually in URL or headers.
60. What is rate limiting and how is it implemented?
Rate limiting restricts request frequency. It protects APIs from abuse. It uses IP or user-based limits. Common tools include Redis-based counters.
Double Tap ♥️ For Part-7
Post #3437
4.23K
- ❤ 16
- 🙏 2