Scrivio Interview library
ScenarioAdvanced7 min read · updated 13 November 2026

Over four years the company built six BFFs (iOS, Android, web, partner portal, TV and smartwatch). Each reimplements pricing display and eligibility checks slightly differently, and a recent change to the loyalty service broke four of them in production.

How do you restore consistency and stability without losing the speed BFFs gave the client teams?

We move the duplicated business rules, such as pricing display and eligibility, out of the six BFFs into domain services or one shared experience service, so BFFs keep only composition and formatting. We merge BFFs whose screens are nearly the same, starting with iOS and Android, protect the rest with consumer-driven contract tests that run in the domain services' pipelines, consider a federated GraphQL layer only with governance, and give every BFF a clear owner, on-call rotation and SLOs.

Why this question is asked

BFFs, the backends built for one client each, usually start as a good idea: the client teams move fast and the screens load quickly. Four years later the same idea can leave six slightly different copies of the most important business rules and a web of untested dependencies, which is exactly what this scenario describes. Interviewers ask it to see whether we can fix the damage without throwing away the speed that justified BFFs in the first place. In this answer, we will look at how BFFs drift into this state, then go through the repair in order: extracting business rules, merging BFFs, adding contract tests, weighing a federated GraphQL layer, and fixing ownership.

1How Six BFFs Drift Apart

Each BFF was meant to compose data and shape it for one client. But when a client team needs a rule the domain services do not offer, the fastest path is to write it in their own BFF. The iOS team computes how a member discount is shown; the web team writes its own version a month later with a different rounding rule; the TV team copies the Android version. Each change is reasonable on the day, and the sum is six implementations of pricing display and eligibility, each slightly different.

The loyalty incident shows the second problem. Six BFFs depend on the loyalty service's response format, but nothing tells the loyalty team what each BFF relies on. When the loyalty team changed a field, four BFFs broke in production because nobody tested the change against how the BFFs actually used the API.

2Move Business Rules Out of the BFFs

The first job is an inventory. We list the logic in each BFF and mark every piece that makes a business decision rather than a presentation choice: is this user eligible, what price applies, which discount wins. Formatting a price as 12.50 USD is presentation; deciding the price is 12.50 is a business rule.

Business rules move into the domain service that owns them, or, where a rule combines several domains, into a shared experience service, a service that computes things like the final displayed price from catalog, promotions and loyalty data for every client. The BFFs then call it and only format the result. So instead of six pricing implementations, we have one, owned by a team that understands pricing.

Step throughTarget shape after the repair
  1. Client appsiOS, Android, web, partner portal, TV, watch
  2. Thin BFFscomposition, field selection, formatting only
  3. Experience servicedisplayed price, eligibility: one implementation
  4. Domain servicescatalog, promotions, loyalty, orders
  5. Contract testsrun in each domain service's pipeline

5 layers, from the top down. Step through them one at a time.

Business rules live in one place below the BFFs.

We do this one rule at a time, behind a comparison: the BFF calls the new service and its old code side by side, logs differences, and switches over only when they agree or the differences are understood. That keeps the migration safe, and the differences it finds are often real bugs in some of the six copies.

3Merge BFFs That Serve the Same Screens

Six BFFs is also six services to deploy, monitor and keep in line. Some of them exist for historical reasons rather than real differences. iOS and Android apps usually show the same screens with the same data, so one mobile BFF can serve both, with small differences handled by a client type parameter. The smartwatch may need so little that it can use the mobile BFF with a compact response.

We keep separate BFFs where the experience really differs. The partner portal serves businesses with different permissions and workflows, and the TV app has a very different navigation model. The test is simple: if two BFFs would change together for most features, they should be one.

4Contract Tests Against Breaking Changes

To stop a loyalty change from breaking BFFs again, we use consumer-driven contract tests. Each BFF, as a consumer, records what it needs from the loyalty API: which requests it sends and which fields it reads. Those expectations are published to a broker, and the loyalty service's build runs them against its own code before every release. Tools such as Pact or Spring Cloud Contract do this.

Java
// In the mobile BFF: what it relies on from loyalty (Pact, JUnit 5)
@Pact(consumer = "mobile-bff", provider = "loyalty")
RequestResponsePact balance(PactDslWithProvider b) {
return b.given("member 42 has 1200 points")
.uponReceiving("a balance request").path("/members/42/balance").method("GET")
.willRespondWith().status(200)
.body(new PactDslJsonBody().integerType("points", 1200).stringType("tier", "GOLD"))
.toPact();
}
// In loyalty's pipeline: renaming "tier" fails this contract before release

Notice the direction. The test runs in the provider's pipeline, so the team making the change finds out before release, not the BFF team after an incident. Fields that no consumer reads can change freely, which actually gives the loyalty team more freedom than before.

5Should a Federated GraphQL Layer Replace the BFFs?

A federated GraphQL layer is one graph made of subgraphs, each owned by a domain team, with a router that joins them. Clients ask for exactly the fields they need, so several BFFs can disappear. It is a real option here, especially for the clients whose BFFs are pure composition.

But it moves the problem rather than removing it. Someone must own the schema rules: naming, how types are shared between subgraphs, deprecation, and query cost limits so one client cannot write a query that calls 40 services. Business rules can leak into resolvers just as they leaked into BFFs. So we would try it only after the business rules are extracted, and only with a team that owns the graph's governance.

6Make Ownership Clear

Finally, every remaining BFF gets one owning team, an on-call rotation and SLOs, such as p99 latency and error rate per screen. Domain teams publish change notices, for example a deprecation header and a note in a shared channel, to the BFF owners before they remove or change fields, and contract tests enforce what the notices promise.

This keeps the speed the client teams valued. They still own their BFFs and ship screen changes on their own schedule. What changes is that business decisions and API compatibility are no longer left to chance.

7Follow-up questions

Which BFF would you merge first, and how would you measure success?

I would merge iOS and Android first, because they usually share most screens and data, so the overlap and the duplicated logic are largest and the user experience risk is smallest. Success means fewer places to change: the number of business rules implemented in BFFs going towards zero, incidents caused by upstream API changes going down, lead time for a feature that touches both apps going down, and screen latency and error rates staying the same or better after the merge.

What if the client teams resist losing their BFFs?

We listen for the real reason, which is usually speed. If the merged BFF has shared ownership and quick reviews, and the rules they need are available from a service, they lose little. We also show them the incident cost of the current setup, since four broken apps in one release hurt the client teams most.

Is an experience service just another BFF?

No. A BFF is built for one client. An experience service holds rules that every client shows the same way, such as the final displayed price. It is closer to a domain service with a cross-domain view, and it should be owned by a product team responsible for that rule.

8Conclusion

In this answer, we saw how six BFFs drifted into six copies of pricing and eligibility rules with untested dependencies. We repaired it by moving business rules into domain or experience services, merging BFFs that serve the same screens, adding consumer-driven contract tests in the domain services' pipelines, treating federated GraphQL as an option that needs governance, and giving every BFF an owner, on-call and SLOs.

What to say in the interviewAbout 90 seconds aloud

Open with

I would treat this as two separate problems: duplicated business rules and unprotected dependencies. For the first, I would inventory the logic in all six BFFs and separate presentation from business decisions.

Then, if they want more

Pricing and eligibility are business decisions, so they move into the owning domain services, or into one shared experience service that computes the displayed price for every client. I would migrate rule by rule, running the old and new code side by side and comparing results before switching.

Then I would look at merging BFFs whose screens are nearly the same; iOS and Android are usually the first candidates, while the partner portal and TV probably stay separate.

For the dependency problem, I would add consumer-driven contract tests, with Pact or Spring Cloud Contract, where each BFF publishes what it relies on and the loyalty service's pipeline runs those contracts before release, so a breaking change fails a build instead of four apps.

A federated GraphQL layer could replace some BFFs, but only after the rules are extracted and with someone owning schema governance and query cost limits. Finally, every BFF gets an owning team, on-call and SLOs, and domain teams send change notices to BFF owners. The client teams keep their speed, but rules and compatibility stop being left to chance.

About this answer

Last updated
13 November 2026
Versions it names
JUnit 5
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "How do you restore consistency and stability without losing the speed BFFs gave the...": https://scrivio-interview-library.netlify.app/architecture/api-design-at-scale/8caed86860/