Bird
0
0

You want to batch update user roles but only for users currently active. Which pattern best fits this requirement?

hard📝 Application Q15 of 15
Rest API - Batch and Bulk Operations
You want to batch update user roles but only for users currently active. Which pattern best fits this requirement?
ASend a PATCH request with an array of user objects filtered to active users only.
BSend separate PATCH requests for all users regardless of status.
CUse GET request to update roles for active users.
DSend a DELETE request with active users to update roles.
Step-by-Step Solution
Solution:
  1. Step 1: Identify filtering need

    Only active users should be updated, so filter users before sending batch update.
  2. Step 2: Choose correct method and payload

    PATCH with an array of filtered user objects updates roles efficiently in one request.
  3. Final Answer:

    Send a PATCH request with an array of user objects filtered to active users only. -> Option A
  4. Quick Check:

    Filter then batch update with PATCH [OK]
Quick Trick: Filter data first, then batch update with PATCH [OK]
Common Mistakes:
MISTAKES
  • Sending updates for all users without filtering
  • Using GET or DELETE for updates
  • Sending multiple separate requests instead of batch

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes