KatInterview

On-Device Face Unlock for a Mobile Banking App at Scale

Machine LearningModel answer
HardModel answerMachine Learningface-recognitionon-device-mlbiometrics

Last updated

Design a privacy-preserving, on-device face authentication system for a mobile app with tens of millions of users, covering models, evaluation, spoofing defenses, fairness, offline use and rollout.

You are asked to design a face-based authentication feature for a mobile banking app with 50 million monthly active users. Network access on user devices is unreliable, so the feature must keep working when the phone is offline.

Describe an end-to-end design that covers the following:

  1. Task framing. Should the system do 1:1 verification or 1:N identification? Justify the choice.
  2. Model and embedding. Pick a model family and embedding size suitable for mid-tier phones. Say which training objective you would use (for example, an angular-margin loss versus a triplet loss) and why. Describe the scale of training data and the augmentations.
  3. Evaluation. Define the protocol (ROC/DET, impostor selection, confidence intervals) and propose target operating points, for example FAR ≤ 0.001 at TPR ≥ 0.98 for routine unlock.
  4. Spoofing and robustness. Explain how you handle presentation attacks (2D, 3D, IR-assisted), replay and camera-injection attacks, and occlusions such as masks and glasses.
  5. Fairness. Explain how you check for and reduce performance gaps across demographic groups, including whether per-cohort thresholds are appropriate.
  6. Privacy and security. Cover template storage, template protection, user opt-out, and the role (if any) of differential privacy.
  7. Resource budget. Target p95 latency under 150 ms, memory under 50 MB, and a small per-authentication battery cost. Show how the pipeline fits.
  8. Deployment location and offline behavior. Decide between on-device and server inference, and say what happens when the device has no connectivity.
  9. Operations. Describe drift monitoring, periodic re-enrollment, and how you would safely A/B test changes (shadow mode, guardrails).

State your assumptions and call out the key trade-offs.

Hints

Hint 1

Ask who is claiming an identity. If the app already knows which account is logged in, consider what that implies for the matching problem, the error rates, and where biometric data needs to live.

Hint 2

Do a quick budget: split 150 ms across detection, quality check, liveness, embedding and matching, and note which stages can run on an NPU. Then think about why a smaller embedding can be acceptable after distillation.

Hint 3

Treat the face match as a local gate that unlocks a hardware-backed key, and let the server verify a signed, nonce-bound assertion instead of ever seeing a face. Then think about how you would roll out safely: shadow mode first, then a staged ramp with guardrails on false rejects, fallback rate, and per-cohort error.