
Ace your next technical interview (tool to upgrade your skills as software engineer and get your dream job).
Berlin
Joined August 2026
- Tweets657
- Following639
- Followers585
- Likes91
Taking action everyday, rehearsing what you already know or learning something new beats someone doing nothing. Keep learning, keep building. AI may write your codes, but you still need to know how it works under the hood.
The standard way to handle this is to make the handler idempotent using the event ID the provider sends. You store that ID in a table with a unique constraint, and in the same database transaction as the credit update you insert the ID, so a duplicate fails and gets skipped. The unique constraint matters more than a "check first, then insert" step, because two copies arriving at the same moment can both pass the check. Return a 200 for events you've already processed so the provider stops retrying, and test it by replaying the same event 10 times in parallel and confirming the balance only changes once.
4
Software Engineering Interview Question:
Let's say you're working on a billing service that receives webhooks from a payment provider, and you notice some customers are getting charged credits twice because the provider sometimes retries the same event. How would you make the handler safe to run more than once, and what would you watch out for when two copies of the same event arrive at almost the same time?
1
1
7
A solid approach is to assume the model can be tricked and limit what it can do when that happens. Treat anything pasted in or pulled from invoices as untrusted data, keep it clearly separate from your system instructions, and give the model only the narrow tools it needs (like "send reminder to this invoice's customer", not "send email to any address"). Enforce the rules in code outside the model: check that the recipient matches the invoice, rate limit sends, and ask the user to confirm before anything goes out. Then build a set of 30 to 50 known injection attempts into your test suite so you notice if a prompt or model change makes it easier to break.
4
AI Engineering Interview Question:
Let's say you're building an assistant for an invoicing app that can look up a customer's invoices and send reminder emails on their behalf. Users can paste in text from outside sources, and you're worried someone could hide instructions in an invoice note that make the model email the wrong people. How would you protect against that?
1
2
19
A solid approach is to separate the two steps and look at retrieval first. Take 30 to 50 real questions that got bad answers, and for each one check whether the right policy chunk actually showed up in the top 5 results. If it didn't, the model never had a chance, so you fix chunking, add metadata like document date so old versions get filtered out, or try hybrid search (keyword plus embeddings). If the right chunk was there and the answer was still wrong, then you tighten the prompt to only answer from the context and say "I don't know" otherwise. The common mistake is tweaking the prompt when the real problem is retrieval.
5
A solid approach is to start by logging tokens, latency and cost per request type, because usually a small number of calls cause most of the spend. Then you route by difficulty: a small, fast model handles simple things like autocomplete and short edits, and the big model only gets the hard multi-file requests. Trim the prompt too (send the relevant function and its imports instead of the whole file), cache repeated context with prompt caching, and stream the output so it feels faster. To check you didn't hurt quality, replay a few hundred real past requests through the new setup and compare acceptance rate and eval scores against the old one before rolling it out.
3
AI Engineering Interview Question:
Let's say you're working on an AI coding assistant inside an IDE, and the monthly LLM bill has doubled while users are also complaining that suggestions feel slow. How would you bring down both cost and latency without making the suggestions noticeably worse?
6
5
298
A solid approach is to separate the two steps and look at retrieval first. Take 30 to 50 real questions that got bad answers, and for each one check whether the right policy chunk actually showed up in the top 5 results. If it didn't, the model never had a chance, so you fix chunking, add metadata like document date so old versions get filtered out, or try hybrid search (keyword plus embeddings). If the right chunk was there and the answer was still wrong, then you tighten the prompt to only answer from the context and say "I don't know" otherwise. The common mistake is tweaking the prompt when the real problem is retrieval.
11
AI Engineering Interview Question:
Let's say you're building a chatbot that answers questions from a company's internal HR policy docs, and people keep complaining that it gives confident answers that are wrong or out of date. How would you figure out whether the problem is retrieval or the model, and what would you fix first?
If you send every call to a flagship model like Claude 3.5 Opus 5.5 or GPT6-Astra, you burn cash and add unnecessary latency. Most production AI features don't run on a single model. Instead, you route requests. You send simple, high-volume work like classification, entity extraction, or query rewriting to small, fast models like Haiku or GPT-4o-mini, and save your expensive reasoning heavyweights for thorny edge cases or deep synthesis.
1
51
The standard setup is building an automated pipeline around a golden test set of representative user inputs, then running the old and new versions side by side. You evaluate the results using deterministic checks for formatting and facts, paired with an LLM-as-a-judge using a clear rubric to score subjective quality. To handle non-determinism, you drop the temperature to zero or average scores across multiple runs, comparing aggregate pass rates and direct diffs against your baseline before shipping
14
AI Engineering Interview Question:
Let's say you're maintaining an LLM feature in production and you want to update the prompt or swap the underlying model: how would you build an evaluation pipeline to feel confident that quality actually improved and you haven't quietly caused regressions, especially given that the outputs are non-deterministic?
1
1
35
The work you put in when nothing seems to be happening is preparing you for everything that comes next
The standard way to handle this is to curate a fixed "golden dataset" of maybe 50 to 100 representative tickets that cover your typical edge cases and topics. Whenever you change a prompt, you run it across that whole test set and score the outputs against defined criteria (like factual accuracy and completeness) using an LLM-as-a-judge or rule-based checks. That gives you an aggregate benchmark to prove your new prompt actually improved overall quality before you ship it.
12
AI Engineer Interview Question:
Let's say you're working on an LLM feature, maybe something like summarizing customer support tickets, and you want to tweak the prompt to improve it. Because LLMs don't always give the exact same answer every time, how would you set up a way to test your changes and be confident that you didn't accidentally make things worse?
In practice, you typically put a lightweight router upfront (like a fast classifier, simple rules based on prompt length, or a tiny model) to decide whether the task needs the cheap or expensive LLM. From there, you wrap those API calls in a fallback pattern, so if the cheaper model times out or throws an error, your system catches it cleanly and retries the prompt with the backup model.
9
AI Engineer interview question:
Let's say you're designing a feature where you want to balance cost and reliability by sending easy prompts to a fast, cheap model, reserving a bigger, more capable model for tough tasks, and handling things gracefully if an API call fails: walk me through how you'd approach setting up that routing logic.
1
30
