Bird
0
0

If User Service returns {"name": "Alice"} and Order Service returns {"orders": 3}, what will the BFF likely return to the frontend?

medium📝 Analysis Q13 of 15
Microservices - Advanced Patterns
Consider a BFF that calls two microservices: User Service and Order Service. If User Service returns {"name": "Alice"} and Order Service returns {"orders": 3}, what will the BFF likely return to the frontend?
A{"name": "Alice"}
B{"orders": 3}
C{"name": "Alice", "orders": 3}
D{"user": {"name": "Alice"}, "order": {"orders": 3}}
Step-by-Step Solution
Solution:
  1. Step 1: Understand BFF data aggregation

    BFF combines data from multiple microservices into a single response for frontend simplicity.
  2. Step 2: Analyze the combined response

    The best practice is to namespace responses to avoid key collisions, resulting in {"user": {"name": "Alice"}, "order": {"orders": 3}}.
  3. Final Answer:

    {"user": {"name": "Alice"}, "order": {"orders": 3}} -> Option D
  4. Quick Check:

    BFF namespaces microservices data to avoid conflicts [OK]
Quick Trick: BFF namespaces microservices responses [OK]
Common Mistakes:
  • Merging keys without namespaces causing conflicts
  • Returning only one microservice's data
  • Confusing keys or data structure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes