CS FundamentalsModerateProduct-company MCQ pattern
A logged-in user with a valid token calls an admin-only API endpoint. Which status code should the server return?
- A. 404 Not Found
- B. 401 Unauthorized
- C. 403 Forbidden
- D. 400 Bad Request
Correct answer: C. 403 Forbidden
The user is authenticated but lacks permission, so 403. 401 means authentication is missing or invalid (no or bad credentials). Some APIs return 404 to hide the resource, but 403 is the standard answer.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- In the IaaS model (for example a plain cloud virtual machine), which of these is the customer's responsibility rather than the provider's?
- A Scrum team's last three sprints delivered 28, 32 and 30 story points. 240 points remain in the backlog and sprints are 2 weeks long…
- Using basic COCOMO for an organic project (E = 2.4 × KLOC^1.05 person-months), what is the estimated effort for a 32 KLOC project?
- For the code if (x > 0) { y = 1; } followed by print(y), a single test with x = 5 is run. What coverage does it achieve?
- A server has a mean time between failures of 990 hours and a mean time to repair of 10 hours. What is its availability?
- A new build arrives and testers first run a small, broad set of checks (does it install, launch, log in, open the main screens?) before…