Model a business identity verification (KYC) workflow
I was asked this
No reports yet. Sign in to say where you were asked it.
An object-oriented design interview question asked in Stripe's technical phone screen, last asked Mar 2026. It tests object-oriented design, state machines and kyc.
Design the object model for verifying a business before it can accept payments (know-your-customer, KYC). A business applies with its identity details and supporting documents. A verification policy, chosen by the business's country and business type, decides which checks are required: for example business identity, representative identity, address and tax information. You design the classes, their interfaces and how they collaborate; you do not need to implement them.
Requirements
- Functional:
- Create an application for a business; the policy for its country and type sets the required checks.
- Attach evidence (a document or a data submission) to a check.
- Record a review result for a piece of evidence: verified or rejected.
- Read the current decision for the application.
- Rules:
- Every check starts
PENDINGand becomesVERIFIEDorREJECTEDafter its evidence is reviewed. - The application is
VERIFIEDonly when every required check is verified, andREJECTEDas soon as any required check is rejected; otherwise it isPENDING. - A rejected check can receive replacement evidence, which sends it back to
PENDING. - Every review result names the evidence it reviewed. A result for evidence that has since been replaced is stale and must not change the check.
- Every check starts
- Non-functional: one process, in memory. User interfaces, outside verification vendors, document bytes, networking and storing policies are out of scope.
Clarifying questions
- Can the policy change while an application is in progress? Does an application keep the policy it started with?
- Can one check have several pieces of evidence at once, or only the current one?
- Can a verified check be re-opened (for example, when a document expires)?
- Is a rejected application final, or can it become verified after fixes?
- Who calls
record_result, and do we need an audit trail of every result?
What a strong answer covers
- The main classes:
Application(business, policy, checks, decision),VerificationPolicy(selected by country and business type, listsCheckTypes),Check(type, status, current evidence),Evidence(id, check, submitted data or document reference, version),ReviewResult(evidence id, outcome, reason), and aPolicyRegistrythat looks up the policy. - The interfaces, for example
create_application(business) -> Application,attach_evidence(application_id, check_type, evidence) -> evidence_id,record_result(evidence_id, outcome) -> bool,decision(application_id) -> Status. - The state machine of a check and the rule that derives the application's decision from its checks (computed, not stored separately, or updated in one place).
- Stale results: compare the result's evidence id (or version) with the check's current evidence and ignore it if they differ.
- Where invariants live (inside
CheckandApplication, not in callers) and how the design stays open to new check types and countries. - Thread safety if results can arrive concurrently.
Follow-ups
- Add a check that needs two reviewers to agree.
- Some checks are optional in one country and required in another. How does the policy express that?
- Add a full audit history of every status change.
- An external vendor now does the reviews asynchronously. What changes in the model?
Where it's asked
- Stripe · Technical phone screen · Last asked Mar 202660 min · One realistic task in parts, in a project editor (CoderPad project mode or HackerRank Projects) with several files and tests
What it tests
object-oriented design · state machines · kyc
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
