2. Which of the following is the correct way a client sends a request to a server in REST API?
easy
A. Using a SQL SELECT statement
B. Using an HTTP GET method
C. Using a FTP upload command
D. Using a local file read operation
Solution
Step 1: Identify REST API request methods
REST APIs use HTTP methods like GET, POST, PUT, DELETE to communicate.
Step 2: Match method to client request
GET is used by clients to request data from servers.
Final Answer:
Using an HTTP GET method -> Option B
Quick Check:
REST client requests use HTTP methods [OK]
Hint: REST clients use HTTP verbs like GET to ask [OK]
Common Mistakes:
Confusing SQL with REST API
Using FTP commands for REST requests
Thinking local file reads send requests
3. What will the server respond with if a client sends a GET request to /users/123 and the user exists?
medium
A. A JSON object with user details
B. An error message saying 'User not found'
C. A redirect to the homepage
D. A blank page with no content
Solution
Step 1: Understand GET request to resource
A GET request to /users/123 asks for user data with ID 123.
Step 2: Server response when user exists
If user exists, server sends back user details, usually as JSON.
Final Answer:
A JSON object with user details -> Option A
Quick Check:
GET existing resource returns data [OK]
Hint: GET returns data if resource exists, else error [OK]
Common Mistakes:
Assuming error if user exists
Thinking GET causes redirect
Expecting blank page on success
4. A client sends a POST request to create a new user, but the server responds with a 404 error. What is the most likely cause?
medium
A. The client sent too much data
B. The client used the wrong HTTP method
C. The server successfully created the user
D. The server URL endpoint is incorrect or missing
Solution
Step 1: Understand 404 error meaning
404 means the requested URL or endpoint was not found on the server.
Step 2: Link error to cause
If POST returns 404, likely the client sent request to wrong or missing URL.
Final Answer:
The server URL endpoint is incorrect or missing -> Option D
Quick Check:
404 means URL not found [OK]
Hint: 404 means wrong or missing URL endpoint [OK]
Common Mistakes:
Confusing 404 with method error
Assuming success on 404
Thinking data size causes 404
5. You want to design a REST API where clients can update user info only if they provide a valid token. Which client-server architecture concept helps enforce this?
hard
A. Client directly modifying server database
B. Client caching data locally
C. Authentication and authorization on the server
D. Server sending data without checks
Solution
Step 1: Identify security need
Allowing updates only with valid token means controlling access.
Step 2: Apply client-server security concept
Authentication verifies identity; authorization controls permissions on server side.
Final Answer:
Authentication and authorization on the server -> Option C
Quick Check:
Access control = Authentication + Authorization [OK]
Hint: Use server-side auth to control client access [OK]
Common Mistakes:
Thinking client caches control access
Assuming server sends data without checks
Believing client can modify database directly
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.