The interview problem

Practice prompt

Improve an on-device next-word model without collecting users' raw typing centrally. Design federated training for devices that connect irregularly and have different language distributions.

Original practice, not a reported company interview. All scenarios and worked numbers are illustrative. Interview date: not applicable. Sources retrieved September 30, 2026.

1. Scope and assumptions

Federated learning changes where training happens; it does not automatically guarantee privacy. Assume explicit product authorization, bounded local training and a separate privacy/security review for the chosen aggregation mechanism.

2. Worked approach

signed round model
  → eligible local training
  → bounded versioned updates
  → aggregation
  → evaluation

Distribute a signed model and training configuration to eligible devices. Devices train on locally permitted examples under battery/network constraints and submit bounded updates tied to a round and model version. The server aggregates accepted updates, evaluates a candidate and stages deployment with rollback.

Set deadlines for incomplete rounds and avoid counting a late update against the wrong base model. Limit per-device contribution and account for malicious or corrupted updates. If using secure aggregation or differential privacy, specify their threat model, participation threshold and privacy accounting separately; absence of raw text on the server is not sufficient evidence of anonymity.

3. Calculate the example

In a scalar illustration, device A contributes an update of +0.2 from 100 examples and B contributes −0.1 from 300. Example-weighted averaging gives (100×0.2 + 300×−0.1)/400 = −0.025; equal-device averaging gives +0.05. The choice changes the optimization target. Uploading a 2 MB update from 10,000 devices costs 20 GB per round before protocol overhead and downloads.

4. Failure cases and trade-offs

Only charging devices on fast Wi-Fi may represent an unbalanced user population. Large local steps can diverge across non-IID data. Updates can leak information or carry poisoning even when raw examples stay local. A dropped cohort can weaken intended aggregation guarantees.

More local steps reduce communication rounds but increase client drift. Weighting by examples favors heavy typists; equal-device weighting serves a different objective. Smaller models lower device cost but may reduce rare-language quality.

5. Validate the result

Evaluate held-out on-device quality by language and participation cohort, update norms, round completion and battery cost. Test stale updates, adversarial magnitudes and deployment rollback. Report the actual privacy guarantee, not the word federated alone.

6. Interview follow-ups and self-review

How would opt-out remove future participation? What happens when too few devices finish a secure round?

Reward explicit aggregation arithmetic, non-IID awareness, round versioning and separation of locality from privacy.

Sources and related practice

Technical reference: arxiv.org — FedAvg primary paper; device policy, numbers and threat analysis are original.

Submitted February 17, 2016; revised January 26, 2023. Retrieved September 30, 2026. This reference supports the named technical concept; the proposed workflow and examples are original, not a documented vendor implementation or interview report.

Continue with Design a model rollout and rollback platform; Design training-data provenance and deletion.

Continue your preparation

Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.