Bird
0
0

You have a REST API that fetches user profile and user posts separately. To apply graceful degradation, which approach is best?

hard📝 Application Q15 of 15
Rest API - Rate Limiting and Throttling
You have a REST API that fetches user profile and user posts separately. To apply graceful degradation, which approach is best?
AIf fetching posts fails, return profile with empty posts list
BIf fetching posts fails, return error and no profile
CStop API if either profile or posts fail
DIgnore profile and only return posts
Step-by-Step Solution
Solution:
  1. Step 1: Understand graceful degradation in multi-part fetch

    It means returning partial data if one part fails, not stopping all.
  2. Step 2: Evaluate options for partial fallback

    If fetching posts fails, return profile with empty posts list returns profile and empty posts if posts fail, matching graceful degradation.
  3. Final Answer:

    If fetching posts fails, return profile with empty posts list -> Option A
  4. Quick Check:

    Partial data returned on failure = graceful degradation [OK]
Quick Trick: Return partial data with fallback for failed parts [OK]
Common Mistakes:
  • Stopping API on any failure
  • Returning no data if one part fails
  • Ignoring fallback for partial data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes