How do you protect personal data when building a feature on a hosted LLM API?
What the interviewer wants to hear
- Send only the data the task needs (data minimisation)
- Redact or mask sensitive fields before sending
- Check provider data retention and training terms
- Control what gets stored in logs and traces
- Apply access controls so retrieval only returns permitted data
Model answer
I start with data minimisation: only send the fields the task actually needs. If the summary does not need card numbers or phone numbers, I redact or mask them before the call, often with a PII detection step. I check the provider terms for retention and whether data is used for training, and pick settings or regions that match our privacy rules and contracts. Logs and traces are an easy place to leak data, so I mask or limit what is stored and set retention periods. In RAG features I enforce access controls in retrieval, so a user can never get another person record into the prompt. Prompt instructions like "do not reveal" are not protection; real controls must sit in code.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy AI Engineer (LLM & Generative AI) questions
- Explain retrieval-augmented generation (RAG) to a new team member. Why do we use it?
- What are embeddings, and what can you build with them besides RAG?
- Why do LLMs hallucinate, and what simple steps reduce it in an application?
- How do tokens affect the cost and speed of an LLM application?
- What do temperature and top-p control, and how would you set them for different tasks?
- What is an LLM agent, and how is it different from a single LLM call?
- How does vector search work, and why is it useful for an AI application?
- Your app starts getting rate-limit errors from the LLM API. How do you handle them?
- What is the difference between zero-shot and few-shot prompting, and when would you use each?