0
0
HLDsystem_design~10 mins

REST API design for systems in HLD - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the HTTP method used to retrieve data in REST API design.

HLD
To fetch data from a REST API, the client sends a [1] request.
Drag options to blanks, or click blank then click option'
APOST
BDELETE
CPUT
DGET
Attempts:
3 left
💡 Hint
Common Mistakes
Using POST instead of GET to retrieve data.
Confusing GET with DELETE or PUT methods.
2fill in blank
medium

Complete the code to define the correct status code for a successful resource creation in REST API.

HLD
When a new resource is created successfully, the server responds with status code [1].
Drag options to blanks, or click blank then click option'
A201
B200
C404
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using 200 instead of 201 for creation.
Confusing 404 (Not Found) with success codes.
3fill in blank
hard

Fix the error in the REST API endpoint path to follow best practices for resource naming.

HLD
The incorrect endpoint path is: '/getUserDetails/[1]'. Correct it to a RESTful style.
Drag options to blanks, or click blank then click option'
A/getUserDetails/{{BLANK_1}}
B/users/{{BLANK_1}}
C/user-details/{{BLANK_1}}
D/userDetails/get/{{BLANK_1}}
Attempts:
3 left
💡 Hint
Common Mistakes
Including verbs like 'get' in the endpoint path.
Using singular nouns inconsistently.
4fill in blank
hard

Fill both blanks to complete the REST API design for updating a resource using the correct HTTP method and status code.

HLD
To update a resource, the client sends a [1] request, and the server responds with status code [2] if successful.
Drag options to blanks, or click blank then click option'
APUT
BPATCH
C200
D204
Attempts:
3 left
💡 Hint
Common Mistakes
Using PATCH instead of PUT for full updates.
Using 204 when content is expected in response.
5fill in blank
hard

Fill all three blanks to complete the REST API design snippet for deleting a resource, including HTTP method, endpoint path, and expected status code.

HLD
The client sends a [1] request to '[2]/[3]' to delete a resource, and the server responds with status code 204.
Drag options to blanks, or click blank then click option'
ADELETE
Busers
C123
DGET
Attempts:
3 left
💡 Hint
Common Mistakes
Using GET instead of DELETE to remove resources.
Omitting the resource ID in the path.