Filter by the role you are applying for, open a question, and practise explaining the answer out loud. Mark it practised when you can.
Why they ask this: Every developer calls or builds APIs; correct method use is a basic expectation.
Answer
| Method | Use | Safe | Idempotent |
|---|---|---|---|
GET | read a resource | yes | yes |
POST | create a resource or trigger an action | no | no |
PUT | replace a resource completely | no | yes |
PATCH | update part of a resource | no | not guaranteed |
DELETE | remove a resource | no | yes |
POST /orders calls can create two orders, while PUT /users/5 with the same body twice gives the same result.This matters for retries: clients and proxies can safely retry idempotent requests after a network error. For payments, use an idempotency key to make POST safe to retry.
Why they ask this: Correct status codes make APIs predictable for frontend and mobile developers.
Answer
200 OK, 201 Created (after a POST that creates something), 204 No Content (success with no body).301 Moved Permanently, 302 Found, 304 Not Modified (use the cached copy).400 Bad Request: malformed request.401 Unauthorized: not authenticated (no token or a bad token).403 Forbidden: authenticated but not allowed.404 Not Found.409 Conflict: for example a duplicate email.422 Unprocessable Content: validation errors (Laravel's default).429 Too Many Requests: rate limited.500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable.A frequent interview trap is the difference between 401 and 403.
Why they ask this: Most backend roles in Nepal build JSON APIs for web and mobile clients.
Answer
REST (Representational State Transfer) is an architectural style for APIs built on HTTP. Key ideas:
/jobs, /jobs/42, /companies/7/jobs.GET /jobs lists, POST /jobs creates, PATCH /jobs/42 updates, DELETE /jobs/42 deletes.Content-Type.Good practice: version the API (/api/v1), paginate lists, use plural nouns and avoid verbs in URLs (POST /jobs/42/applications, not /applyJob).