0
0
Microservicessystem_design~20 mins

Backend for Frontend (BFF) pattern in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
BFF Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Purpose of Backend for Frontend (BFF) Pattern

What is the main purpose of using a Backend for Frontend (BFF) pattern in a microservices architecture?

ATo provide a dedicated backend tailored to the needs of each frontend client, improving performance and user experience
BTo create a single backend service that handles all frontend requests without customization
CTo replace all microservices with one monolithic backend for simplicity
DTo directly expose all microservices to the frontend without any intermediate layer
Attempts:
2 left
💡 Hint

Think about how different frontend clients might have different data needs and how BFF helps with that.

Architecture
intermediate
2:00remaining
Request Flow in BFF Pattern

In a system using the BFF pattern, which sequence correctly describes the flow of a user request from frontend to data retrieval?

AFrontend → Database → Microservices → BFF
BFrontend → Microservices → BFF → Database
CFrontend → BFF → Microservices → Database
DFrontend → Database → BFF → Microservices
Attempts:
2 left
💡 Hint

Remember that BFF acts as a middle layer between frontend and microservices.

scaling
advanced
2:30remaining
Scaling Challenges with Multiple BFFs

What is a common scaling challenge when implementing multiple BFFs for different frontend clients?

AAll BFFs share the same database connection pool, causing contention
BDuplicated logic across BFFs increases maintenance overhead and resource usage
CBFFs cannot cache data, leading to excessive database load
DBFFs force frontend clients to handle complex data aggregation
Attempts:
2 left
💡 Hint

Think about how having separate backends for each frontend might affect code reuse and maintenance.

tradeoff
advanced
2:30remaining
Tradeoff of Using BFF Pattern

Which of the following is a key tradeoff when adopting the BFF pattern?

ASimplifies frontend development but increases backend complexity and deployment overhead
BReduces backend complexity but requires frontend to handle all data aggregation
CEliminates the need for microservices by consolidating all logic in BFF
DRemoves the need for API gateways by exposing microservices directly
Attempts:
2 left
💡 Hint

Consider how adding a new backend layer affects system complexity and deployment.

estimation
expert
3:00remaining
Capacity Planning for BFF Layer

You have a mobile app with 1 million daily active users and a web app with 500,000 daily active users. Both use separate BFFs. If the average request rate per user is 10 requests per hour during peak 4 hours, estimate the total peak requests per second the BFF layer must handle combined.

AApproximately 20,833 requests per second
BApproximately 6,250 requests per second
CApproximately 10,417 requests per second
DApproximately 4,167 requests per second
Attempts:
2 left
💡 Hint

Calculate total requests during peak hours, then convert to requests per second.