Model and Inference EngineeringMultimodal evidence and voiceStaff
How should typed monetary values produce matching screen and spoken confirmations?
By Amit Kumar2 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
An action stores 150 US cents and the screen shows 1.50 dollars, but voice preprocessing strips punctuation and sends 150 dollars to speech synthesis. Trace the exact boundary, design shared typed-value rendering and approval identity and verify generated versus heard amounts without treating speech recognition as an authoritative money parser.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
I would compare the display text with the exact input sent to speech synthesis. In this scenario, the action record correctly stores 150 cents and the UI formats it as $1.50. A separate voice-preparation function strips punctuation from an amount string and passes 150 dollars to text-to-speech (TTS) synthesis. The speech engine says "one hundred fifty dollars." Nothing was wrong with the action amount or the original UI. We lost the decimal while crossing an output-format boundary.
Text-to-speech systems can interpret a numeric string in several ways. Amazon Polly's say-as documentation explains controls for how numbers and other special text are spoken. That documentation supports the need for explicit interpretation, not a claim that a specific provider turns $1.50 into $150 on its own. In this case the damaging transformation is in our preprocessing. Avoid making the assistant's free-form text the canonical source of a payment amount.
Carry typed money through the action and confirmation path: currency code and integer minor units, with a deliberate rendering rule for screen and speech. Generate the spoken phrase from that typed value, such as "one dollar and fifty cents," rather than stripping symbols from a UI string. For a high-value action, bind both display and speech confirmation to the same action ID and amount. A dry-run test can compare action payload, UI text and TTS input exactly. Listening or speech-recognition checks on produced audio can catch pronunciation errors, but automated ASR is not an authoritative monetary parser either.
The interviewer might ask whether the user hearing the wrong amount should cancel the action. Yes, the system should stop and correct the confirmation before treating it as consent. A later audit needs to distinguish what the screen showed, what audio was actually delivered and what transaction was submitted. The caller said fifteen. Why did the voice agent send fifty? is about inbound speech being misheard before an action. This is outbound confirmation diverging from a correct typed amount after the action was prepared.
Related questions
Keep practising model and inference engineering
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux