All jobs / AI engineer / Document AI
AI engineer interview question · 5+ years
A customer’s legal team asked your contract assistant whether a 300-page agreement had an auto-renewal clause. It answered “no”. There was one on page 212. You own the post-mortem.
What went wrong, and what do you change?
The strongest answer
Retrieval showed the model a few chunks, so “no” meant “not in what I read”. Absence and list-everything questions need a pass over every section or a clause index built at ingestion, and answers must state their coverage
Why it works
Exactly — top-k retrieval cannot prove a negative. Route exhaustive questions to a full pass, say what was checked, and put absence questions in the evals.
What a good answer covers
- Top-k retrieval cannot prove absence.
- Route exhaustive questions to a full pass.
- State coverage in every such answer.
- Add absence questions to the evals.
Answers that fall short
- Close, but not the strongest: Retrieval missed the chunk; raise the number of retrieved chunks and add a reranker so that page 212 would be found
Better retrieval lowers the odds but keeps the flaw: the system still claims “none” after reading a fraction. This question type needs a different path. - Weak: The model hallucinated; move to a stronger model and add “answer only from the document” to the prompt
The model answered faithfully from what it was shown. The error was treating a partial view as the whole document. - Red flag: The terms say answers must be verified, so this is the customer’s mistake; I would note that and close the incident
Pointing at the terms of service in your own post-mortem fixes nothing, and tells the interviewer how you would handle the next one.
Who gets asked this
More Document AI questions
- Your service extracts supplier, totals and bank details from invoices in hundreds of layouts. Finance wants…
- Two PDFs look identical on screen, but your parser gets clean text from one and nothing from the other. Why…
- Why is “just extract the text from the PDF” harder than it sounds?
- Your document Q&A is good on prose but wrong on figures that come from tables. In the extracted text, a table…
- How do you chunk a long contract or manual that has headings, numbered clauses, tables and figures?
- A legal team will only use your contract assistant if every answer points to a real page and clause. How do…
- In your equipment manuals the wiring diagrams and annotated screenshots carry the key information. The…