Senior interview questionAsked at PayPal · interview write-up
Set per-user spending limits with reinforcement learning: define the state, actions, transitions and reward, and explain how you'd train and evaluate the policy safely.
Model answer
State: the user's risk score, history, balance, recent spend and current limit. Actions: a few discrete moves, such as keep, raise or lower by a step. Transitions come from user behaviour. Reward: margin on enabled spend minus expected fraud and credit losses, which arrive late, minus a penalty for declining good spend.
Train offline from logged decisions with propensities, using a conservative method, and estimate the policy's value with off-policy estimators such as doubly robust before any live test. Then roll out to a small cohort, inside hard caps set by people.
Practise the rest
40 ML system design questions, 492 in all, each with a model answer. Free.
More from PayPal interview questions.
More ML system design interview questions
- You need to copy 500 GB of weights to 1,000 GPU workers over shared 10 Gbps links. What's the lower bound on time, and what would you build?
- Design an LLM coding assistant end to end: data, model and evaluation.
- Design a job scheduler for ML training and batch inference on a shared GPU cluster.
- Training a retrieval model over a catalogue of millions of items, you use sampled softmax. Why does it need a correction, and how do you choose the classification loss?
- Design an inference API that converts PDFs into Markdown using several models in stages.
- How can LLMs be incorporated into recommendation systems, from metadata enrichment and cold start to generative retrieval and semantic reranking?