Interview preparation
AI-200 and Azure fundamentals interview questions
121 questions from 28 topics, each with a model answer. Many include the follow-up an interviewer is likely to ask next. Use the mock interview to practise thinking on your feet.
Mock interview
Nimbus plays the interviewer. Answer out loud, then compare with the model answer.
Containers for AI Apps: App Service, Container Apps or AKS?
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner Why put an AI back end in a container at all?
Model answer
Because the same image runs the same way on my laptop, in test and in production. Python version, packages and system libraries are all inside it, so "works on my machine" stops being an excuse. It also lets me move between App Service, Container Apps and AKS without rebuilding the app.
Interviewer follows up
Where do you keep the images?
You
In a private Azure Container Registry, tagged with a version, so every host pulls exactly the build I tested.
Intermediate When would you choose Container Apps over App Service for a containerised API?
Model answer
When I have several services or background workers, want scale to zero, need event-driven scaling from a queue, or want to split traffic between revisions for a canary release. For one steady web API, App Service is simpler and has deployment slots.
Architecture & design A team wants AKS for a single Python API. How would you advise them?
Model answer
I'd ask what they need from Kubernetes directly. If the answer is nothing specific, Container Apps gives them the same container model with revisions and KEDA, minus node pools, upgrades and cluster security to own. AKS makes sense once they need custom operators, GPU node pools, service meshes or direct access to the Kubernetes API.
Scenario Your summarisation worker sits idle most of the night and gets hundreds of jobs every morning. Which host fits?
Model answer
Azure Container Apps with a KEDA Service Bus scale rule and min replicas set to zero. It costs almost nothing overnight and scales out as the queue fills.
Azure Container Registry: Store, Tag and Manage Images
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's the difference between a tag and a digest?
Model answer
A tag is a name I choose, like 1.4.0 or latest, and it can be pointed at a new image later. A digest is the sha256 of the manifest, so it always means the exact same bytes. If I need to be certain what runs in production, I deploy by digest or by a tag nobody reuses.
Interviewer follows up
So why not always use latest?
You
Because latest moves. Two nodes can pull at different times and run different code, and rolling back is guesswork.
Intermediate How do you stop a released image from being overwritten?
Model answer
I lock it with az acr repository update and --write-enabled false. Pushing the same tag again then fails, and I can also set --delete-enabled false so nobody deletes it by mistake.
Experienced developer How should App Service, Container Apps and AKS authenticate to ACR?
Model answer
With Microsoft Entra ID, not the admin account. I give the host a managed identity and assign AcrPull on the registry. For AKS that's az aks update --attach-acr, which assigns AcrPull to the kubelet identity.
Scenario Your builds depend on python:3.12-slim from Docker Hub and you keep hitting pull rate limits. What do you do?
Model answer
Import the base image into our own registry with az acr import and point the Dockerfile at myreg.azurecr.io/python:3.12-slim. Builds pull from ACR, and we control when that base image changes.
Build and Run Images with ACR Tasks
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What does az acr build do that docker build doesn't?
Model answer
It runs the build in Azure instead of on my machine. The CLI uploads my build context, ACR builds it on its own compute and pushes the image straight into the registry. I don't even need Docker installed, which helps on locked-down laptops and in Cloud Shell.
Intermediate How do you rebuild an image automatically when someone pushes to main?
Model answer
I create a task with az acr task create, pass the GitHub repo as --context with #main, the Dockerfile as --file and a personal access token with --git-access-token. The commit trigger is on by default, so ACR adds a webhook and builds on every push to that branch.
Interviewer follows up
And tagging?
You
I use {{.Run.ID}} in the image name so every build gets a unique tag, and sometimes push latest as well for dev.
Experienced developer Why does the base image update trigger matter for security?
Model answer
Because most CVEs in our images live in the base OS layers, not our code. When python:3.12-slim gets patched upstream, the trigger rebuilds our app image on top of it without anyone remembering to do it. Paired with importing the base into our own ACR, we also control when that happens.
Scenario You need to build an API image, run its unit tests in a container and push only if the tests pass. How?
Model answer
A multi-step task. In acr-task.yaml I build the image, add a cmd step that runs pytest inside it, then a push step. Steps run in order, so a failing test stops the run before anything is pushed.
Run a Container on App Service with Settings and Secrets
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner How does your Python code inside the container read an App Service app setting?
Model answer
As a normal environment variable. If I add MODEL_DEPLOYMENT in the portal or with az webapp config appsettings set, my code reads os.environ["MODEL_DEPLOYMENT"]. App Service injects it when it starts the container.
Intermediate Your container listens on 8000 and App Service keeps reporting that it didn't respond to pings. What's wrong?
Model answer
App Service doesn't know the port. I'd set the WEBSITES_PORT app setting to 8000. The container also has to bind to 0.0.0.0, not localhost.
Experienced developer How do you get a Key Vault secret into the container without putting it in the app setting?
Model answer
I turn on the web app's managed identity, give it the Key Vault Secrets User role on the vault, and set the app setting value to @Microsoft.KeyVault(SecretUri=https://kv-rag.vault.azure.net/secrets/search-key/). The container still sees a normal environment variable with the real value, but the setting only holds the reference.
Interviewer follows up
What happens when you rotate the secret?
You
If the reference has no version, App Service picks up the new version within 24 hours, or straight away if I change any app setting, which restarts the app.
Scenario The web app can't pull its image from ACR after someone disabled the admin account. How do you fix it properly?
Model answer
Switch the pull to the managed identity. Assign AcrPull on the registry to the app's identity and set acrUseManagedIdentityCreds to true in the site config. No registry password is stored anywhere after that.
Azure Container Apps: Environments and Revisions
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's a revision in Container Apps?
Model answer
A read-only snapshot of the app's template: image, environment variables, resources and scale rules. Every time I change one of those, Container Apps makes a new revision. I can't edit an old revision, only activate, deactivate or send traffic to it.
Intermediate Which changes create a new revision and which don't?
Model answer
Revision-scope changes do: anything under properties.template, like a new image, env vars, CPU and memory, or scale rules. Application-scope changes don't: ingress, secrets, registry credentials, revision mode and Dapr settings apply to all revisions.
Interviewer follows up
So if you change a secret, does the app see it?
You
Not automatically. Existing revisions keep the old value until I restart them or create a new revision.
Experienced developer How would you do a canary release of a new model version?
Model answer
Set the revision mode to multiple, deploy the new image with a revision suffix so I know its name, then run az containerapp ingress traffic set with 90 on the old revision and 10 on the new one. I watch errors and latency, raise the weight, and when I'm happy send 100 to the new revision and deactivate the old one.
Scenario A worker app must be reachable by the API app but never from the internet. How do you configure it?
Model answer
Put both in the same environment and give the worker internal ingress. The API calls it by app name, like http://worker, and nothing outside the environment can reach it.
Event-Driven Scaling with KEDA in Container Apps
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What does KEDA add that CPU-based autoscaling doesn't?
Model answer
It scales on the work waiting, not on how busy the current replicas look. A Service Bus rule sees 500 messages queued and adds replicas before CPU even rises. And because it watches the queue, it can scale all the way to zero and wake up when a message arrives.
Intermediate How do you scale a container app on a Service Bus queue?
Model answer
I add a custom scale rule with --scale-rule-type azure-servicebus, metadata queueName, namespace and messageCount, and auth for the scaler, either a connection-string secret through --scale-rule-auth or a managed identity. Then I set min replicas to 0 and a sensible max.
Interviewer follows up
If messageCount is 5 and 100 messages arrive, how many replicas?
You
KEDA targets about 100 divided by 5, so 20, capped by max replicas. If max is 10, I get 10.
Experienced developer Why might a CPU scale rule be wrong for a queue worker that should scale to zero?
Model answer
CPU and memory rules can't scale to zero, because there has to be a replica running to measure. For an idle-most-of-the-day worker I want an event source like the queue length, which KEDA can check with no replicas running.
Scenario Your worker scaled to zero, but the first message each morning takes a while to process. What can you do?
Model answer
That's the cold start of the first replica. If it matters, set min replicas to 1 so one replica stays warm. It costs a little more but removes the wait.
Deploy to AKS with Manifest Files
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's the difference between a Deployment and a Service?
Model answer
The Deployment runs the pods: image, replica count, resources. The Service is the front door: one stable address that forwards to whichever pods match its label selector. Pods come and go, the Service address stays.
Intermediate How does AKS get permission to pull images from your ACR?
Model answer
I run az aks create or az aks update with --attach-acr myreg. That assigns AcrPull on the registry to the cluster's kubelet managed identity, so no imagePullSecrets are needed.
Experienced developer How do you roll out a new image and roll back if it's bad?
Model answer
I change the image tag in the manifest and kubectl apply it, or use kubectl set image. The Deployment does a rolling update, replacing pods gradually and only counting new pods once their readiness probe passes. kubectl rollout status shows progress and kubectl rollout undo goes back to the previous ReplicaSet.
Interviewer follows up
Why do probes matter there?
You
Without a readiness probe, Kubernetes sends traffic to a pod as soon as the container starts, even if the model client isn't ready, and a broken version can roll out completely.
Scenario The model endpoint key must reach the pods. Where do you put it?
Model answer
Not in the manifest or the image. A Kubernetes Secret at minimum, referenced with secretKeyRef. Better, the Secrets Store CSI Driver with the Azure Key Vault provider and workload identity, so the value stays in Key Vault.
Troubleshoot AKS and Container Apps: Logs, Events, Connectivity
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner A pod shows CrashLoopBackOff. What's your first command?
Model answer
kubectl logs on that pod with --previous, because the current container may have only just started and have nothing useful yet. The previous container's output usually shows the stack trace, like a missing environment variable.
Intermediate What's the difference between logs and events?
Model answer
Logs are what my application printed. Events are what Kubernetes did: scheduled the pod, pulled the image, killed it for failing a liveness probe, couldn't find room on a node. If the app never started, there are no logs, so events are where I look.
Experienced developer A Container Apps revision is stuck in a failed provisioning state. How do you find out why?
Model answer
az containerapp logs show with --type system shows the platform side: image pull errors, probe failures, the container exiting. I'd also check az containerapp revision list for the health state and, for history, query ContainerAppSystemLogs_CL in Log Analytics filtered by RevisionName_s.
Interviewer follows up
And if the system logs look fine?
You
Then the app itself is failing, so I read --type console, or ContainerAppConsoleLogs_CL, for its own output.
Scenario Pods are Running and Ready but the Service returns nothing. What do you check?
Model answer
kubectl get endpoints for the Service. If it's empty, the selector doesn't match the pod labels. If it has IPs, I check targetPort against the containerPort, then test from inside the cluster with a temporary pod and curl the Service name.
Embeddings and Vector Search for Developers
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What is an embedding, in plain words?
Model answer
It's a list of numbers that captures what a piece of text means. An embedding model reads "How do I get my money back?" and returns, say, 1,536 numbers. A sentence about refunds gets numbers close to it, even if it shares no words, so I can search by meaning instead of by keyword.
Interviewer follows up
Why can't you just use keyword search?
You
Keyword search misses synonyms. A customer types "money back" and the policy says "refund". Vector search finds it because the meanings are close.
Intermediate You embedded your documents with text-embedding-3-small. Which model do you use for the user's question?
Model answer
The same one, with the same dimensions. Vectors from different models live in different spaces, so comparing them gives meaningless distances. If I change the model, I re-embed every document.
Experienced developer What's the difference between exact and approximate vector search, and when would you pick each?
Model answer
Exact kNN compares the query with every vector, so recall is 100% but cost grows with the data. Approximate search uses an index like DiskANN or HNSW and checks only a small part of the graph, so it's far faster and cheaper with a small loss in recall. For a few thousand vectors, or when a filter narrows the set a lot, exact is fine. For hundreds of thousands or millions, I use an ANN index and tune it for the recall I need.
Scenario Search results got noticeably worse after a teammate re-ran the ingestion pipeline. What would you check first?
Model answer
Whether the pipeline used a different embedding model or a different dimensions setting from the one the query code uses. Then whether the chunking changed, for example whole PDFs embedded as one vector instead of paragraphs. Mixed models or giant chunks both blur the results.
Architecture & design How do you decide between Cosmos DB, PostgreSQL and Redis for vectors?
Model answer
I keep vectors next to the data that already lives somewhere. Product catalogue in Cosmos DB, I use its built-in vector index. Relational data with joins and SQL filters, PostgreSQL with pgvector. If I need sub-millisecond lookups or a semantic cache of answers, Azure Managed Redis. Avoiding a second copy of the data usually matters more than small speed differences.
Cosmos DB for NoSQL: Connect with the SDK and Query
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's the cheapest way to read one item from Cosmos DB?
Model answer
A point read. I call read_item with the item's id and its partition key value. For a 1 KB item that's about 1 RU, which is cheaper and faster than running a SELECT that returns the same item.
Interviewer follows up
Why does it need the partition key as well as the id?
You
The id is only unique inside a logical partition, and the partition key tells Cosmos DB exactly which partition to go to. Without it, the service would have to look everywhere.
Intermediate Why should queries use parameters instead of building the SQL string yourself?
Model answer
Parameters stop injection, because user input is never treated as query text. They also keep the query text the same each time, which makes it easier to read and to reuse. In Python I pass a list like [{"name": "@cat", "value": category}].
Experienced developer How do you find out how many RUs an operation cost from the Python SDK?
Model answer
Every response carries an x-ms-request-charge header. After the call I read container.client_connection.last_response_headers["x-ms-request-charge"]. I log it during development so an expensive query shows up before it reaches production.
Scenario Your app connects with DefaultAzureCredential but every data call fails with 403 Forbidden, even though you're an Owner on the account. Why?
Model answer
Cosmos DB data access with Microsoft Entra ID uses its own data plane role assignments, not Azure IAM roles like Owner. I'd assign the Cosmos DB Built-in Data Contributor role (or Reader) to my identity on the account with az cosmosdb sql role assignment create.
Architecture & design How do you pick a partition key for a product catalogue that an AI assistant queries?
Model answer
I look at the queries first. If most lookups filter by category, /category spreads writes well and keeps those queries in one partition. It needs plenty of distinct values and no single value that grows past the 20 GB logical partition limit. If one tenant or category could get huge, I'd look at a hierarchical partition key such as tenantId then category.
Cosmos DB: RUs, Indexing Policies and Consistency Levels
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What is a Request Unit?
Model answer
It's Cosmos DB's single currency for work. Instead of sizing CPU and disks, I pay for RUs per second. A point read of a 1 KB item is about 1 RU, a write is several, and a query depends on how much it has to scan. If I go over my RU/s, I get 429 responses.
Interviewer follows up
What does the SDK do with a 429?
You
It waits for the retry-after time the service sends and retries a few times automatically. If 429s keep coming, I need more throughput, autoscale, or cheaper operations.
Intermediate Your container stores a 1,536-number embedding in every item. Writes are expensive. What do you change?
Model answer
I exclude the embedding path from the range index by adding /embedding/* to excludedPaths, and give it a vector index instead if I search it. Indexing 1,536 numbers per item for range queries I'll never run just burns RUs on every write.
Experienced developer Which consistency level would you pick for a chat app's conversation history, and why?
Model answer
Session, which is the default. The user who just sent a message must see it on the next read, and Session guarantees read-your-own-writes inside that client's session. Other users don't need to see it instantly. Strong would double the read RU cost and add latency for no benefit here.
Interviewer follows up
Can a client ask for a stronger level than the account default?
You
No. A client or request can only relax the level, for example from Session to Eventual. To go stronger you change the account default.
Scenario A query with ORDER BY c.category, c.price fails. What's missing?
Model answer
A composite index on (/category ascending, /price ascending). ORDER BY on more than one property needs a matching composite index in the indexing policy.
Architecture & design How would you lower the RU bill of a read-heavy AI catalogue without hurting correctness?
Model answer
Point reads instead of queries wherever I know the id and partition key, a lean indexing policy that excludes large unfiltered paths, Session consistency rather than Strong, and a Redis cache in front for the hottest items. Then autoscale so I'm not paying for peak RU/s all night.
Vector Search in Cosmos DB for NoSQL
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What two things must you set on a Cosmos DB container before vector search works well?
Model answer
A vector embedding policy, which tells Cosmos DB where the vector is, how many dimensions it has, its data type and the distance function. And a vector index in the indexing policy, so searches don't have to compare against every item.
Intermediate Your embeddings have 1,536 dimensions. Can you use a flat index?
Model answer
No. The flat index is capped at 505 dimensions. For 1,536 I'd use quantizedFlat if the search scope is small, say under about 50,000 vectors after filters, or diskANN for anything larger.
Experienced developer Why does Microsoft recommend putting the vector path in excludedPaths?
Model answer
Without it, the normal range index also indexes every element of the array, which makes inserts cost more RUs and take longer. The vector index is a separate index, so excluding the path from the range index loses nothing for vector search.
Interviewer follows up
And why always use TOP N?
You
Without TOP the query tries to return many more results than you need, so it costs more RUs and takes longer.
Scenario Your vector query returns slightly different results each run on an unchanged container. Is something broken?
Model answer
Not necessarily. diskANN is approximate, and each replica builds its own index, so small differences in the order or the tail of the results are expected. If I need exact results I'd use a flat index where the dimensions allow, or raise searchListSizeMultiplier to trade RUs for recall.
Architecture & design How do you keep a multi-tenant RAG app from returning another customer's documents?
Model answer
I add a WHERE filter on tenantId to every vector query, and ideally make tenantId the partition key so the search stays in that tenant's partition. Vector search combines with normal filters, so the filter and the ORDER BY VectorDistance live in the same query.
Cosmos DB Change Feed Processor
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What is the Cosmos DB change feed used for?
Model answer
Reacting to data as it changes. Each time an item is created or updated it appears in the change feed, so another process can do follow-up work: generate an embedding, update a search index, send a notification or copy the data somewhere else.
Intermediate What does the lease container do?
Model answer
It's the processor's memory. It holds one lease per partition key range, recording the last point that was processed and which instance owns that range. If an instance crashes, another picks up its leases and carries on from the last checkpoint.
Interviewer follows up
How do you run several instances of the same processor?
You
Same processor name, same lease container, different instance name on each. The processor spreads the leases across them.
Experienced developer Your processor never sees deleted products. Why, and how would you fix it?
Model answer
The default latest version mode doesn't record deletes. I can switch to all versions and deletes mode, which needs continuous backup on the account, or use a soft delete: set a deleted flag, which shows up as an update, and give the item a TTL so it's removed later.
Scenario Your delegate writes the new embedding back into the same item, and now the function runs forever. What's going on?
Model answer
Writing the embedding is itself an update, so it lands in the change feed and triggers the delegate again. I'd store a hash of the source text with the embedding and skip items where the hash hasn't changed, or write the vectors to a separate container.
Architecture & design When would you host the change feed processor yourself instead of using an Azure Functions trigger?
Model answer
If I need full control over hosting, lifecycle notifications, all versions and deletes mode in .NET, or the work already runs in a long-lived service such as a container app. For most event-style work, like embedding new items, the Functions trigger is less to run and scales with the load.
Connect to and Query Azure Database for PostgreSQL
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What do you need to connect a Python app to Azure Database for PostgreSQL?
Model answer
The server host name (something like myserver.postgres.database.azure.com), the database name, a user, a password or token, port 5432 and TLS. In Python I use psycopg 3. For the password I prefer a Microsoft Entra token from DefaultAzureCredential, so there's no secret in my config.
Interviewer follows up
What is the user name when you sign in with a managed identity?
You
It's the name of the Entra principal that was mapped to a database role, for example the managed identity's name. An Entra admin creates that role first.
Intermediate Why do you pass values with %s instead of building the SQL string with an f-string?
Model answer
Because an f-string mixes data into the SQL text. If a user types something like a quote and a DROP TABLE, it becomes part of the query. With %s, psycopg sends the values separately from the SQL, so input is always treated as data. It's the fix for SQL injection.
Experienced developer Entra tokens expire. How do you stop a long-running app from failing an hour after it starts?
Model answer
The token only matters when a connection is opened, so I fetch a fresh token every time a new connection is made. With psycopg_pool I give the pool a small connection class whose connect method asks DefaultAzureCredential for a token, and I keep max_lifetime under the token lifetime. Open connections stay valid; new ones get new tokens.
Scenario Your app connects fine from your laptop but times out from a new App Service. What would you check first?
Model answer
Networking. With public access I'd check the server firewall rules allow the App Service outbound IPs or Azure services. With private access I'd check the App Service has VNet integration into a subnet that can reach the server and that private DNS resolves the host name. A timeout usually means network, while a wrong token gives an authentication error.
PostgreSQL Schemas, Data Types and Indexes
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What steps do you take to use pgvector on Azure Database for PostgreSQL flexible server?
Model answer
Two steps. First I add vector to the azure.extensions server parameter, which is the allow-list. Then I connect to the database and run CREATE EXTENSION vector. After that I can create a column like embedding vector(1536).
Interviewer follows up
Why vector and not pgvector?
You
The project is called pgvector, but the extension's actual name is vector. Both the allow-list and CREATE EXTENSION use vector.
Intermediate Why put metadata in jsonb instead of adding a column for everything?
Model answer
For fields that change often or differ per document, like source system tags, jsonb saves me schema changes. A GIN index makes queries like metadata @> '{"lang":"en"}' fast. But anything I filter on in almost every query, like tenant_id, gets its own typed column and a B-tree index, because that's faster and clearer.
Experienced developer How would you reduce the compute and storage overhead of embeddings in PostgreSQL?
Model answer
Use fewer dimensions if the model allows it, since text-embedding-3 models accept a dimensions parameter. Store as halfvec instead of vector when the small precision loss is acceptable, which roughly halves the size. Index only the rows I search, using a partial index if one segment dominates. And check with EXPLAIN ANALYZE that the planner actually uses the index.
Scenario A query that filters by tenant and orders by created_at is slow. EXPLAIN ANALYZE shows a Seq Scan. What do you do?
Model answer
Create a composite B-tree index on (tenant_id, created_at DESC), run ANALYZE so the statistics are fresh, and check the plan again. I'd expect an Index Scan and a big drop in actual time.
pgvector Similarity Search and RAG with Metadata Filters
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner Walk me through a RAG request that uses PostgreSQL.
Model answer
The user asks a question. I turn it into an embedding with the same model I used for the documents. I run a SQL query that filters by tenant and orders by embedding <=> the question vector, limit 5. I put those 5 chunks into the prompt as context and ask the model to answer only from them, citing the chunk ids. Then I return the answer.
Interviewer follows up
Why must the question use the same embedding model as the documents?
You
Different models put meaning in different places. A vector from one model compared with vectors from another gives nonsense distances, even if the dimensions match.
Intermediate Why do you put the tenant filter in SQL instead of filtering the results in Python?
Model answer
Two reasons. Security: if I fetch the top 5 across all tenants and filter afterwards, another customer's text is already in my app's memory and could leak through a bug. And quality: if 4 of the 5 nearest chunks belong to other tenants, I'm left with one useful chunk. Filtering in SQL means all 5 are from the right tenant.
Experienced developer With an HNSW index and a selective filter, your query sometimes returns 2 rows instead of 5. Why, and how do you fix it?
Model answer
HNSW finds ef_search candidates first and the filter is applied afterwards. If the filter is selective, most candidates get thrown away. I can raise hnsw.ef_search, use a partial index or partitions per tenant, add a B-tree index on the filter column so the planner can choose it for very selective filters, or on pgvector 0.8 and later turn on hnsw.iterative_scan so the index keeps scanning until it finds enough matches.
Architecture & design When would you choose pgvector for RAG over a dedicated search service?
Model answer
When the source data already lives in PostgreSQL and I want joins, transactions and filters on business columns in the same query, with one less service to run. If I need hybrid keyword plus vector ranking, semantic reranking and built-in document cracking, Azure AI Search is usually the better fit.
Size and Tune PostgreSQL for Vector Workloads
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner Why isn't Burstable a good choice for a production vector search workload?
Model answer
Burstable runs on CPU credits. Vector search and index builds keep the CPU busy for long stretches, so credits run out and the server slows right down. It's also short on memory, and HNSW wants its index in RAM. Burstable is fine for a dev box; production goes on General Purpose or Memory Optimized.
Interviewer follows up
Does Burstable support the built-in PgBouncer?
You
No. PgBouncer is supported on General Purpose and Memory Optimized only.
Intermediate How do you speed up building an HNSW index on 5 million rows?
Model answer
Load the data first, then build. Raise maintenance_work_mem for the session so the graph fits in memory, and raise max_parallel_maintenance_workers so the build runs in parallel. I watch progress in pg_stat_progress_create_index. If I need it even faster, I can lower ef_construction a bit, accepting slightly lower recall.
Experienced developer Your API opens a new PostgreSQL connection per request and latency is poor at peak. What do you change?
Model answer
I add psycopg_pool in the app so each worker reuses open connections, with a fresh Entra token for each new one. If there are many app instances, I also point them at PgBouncer on port 6432 with transaction pooling, so thousands of client connections share a small number of server connections. With transaction pooling I either keep PgBouncer's prepared statement tracking on or set prepare_threshold to None in psycopg.
Architecture & design How do you decide between more vCores, more memory and more IOPS?
Model answer
I look at the metrics. If CPU is pinned during searches, I add vCores. If the HNSW index is bigger than shared buffers and reads hit disk, memory is the fix, so I move to Memory Optimized. If disk queue depth or IOPS are at the limit during loads, I raise IOPS on Premium SSD v2 without changing size. Connection errors point to pooling, not hardware.
Azure Managed Redis: Caching, Expiration and Invalidation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What is cache-aside?
Model answer
The app asks Redis first. If the key is there, that's a hit and we return it straight away. If not, that's a miss, so we read from the database, store the result in Redis with a TTL, and return it. The cache only fills with what people actually ask for.
Interviewer follows up
Why always set a TTL?
You
So nothing stays stale forever if an invalidation is missed, and so memory gets freed for keys nobody reads any more.
Intermediate How do you connect redis-py to Azure Managed Redis without an access key?
Model answer
I install redis-entraid, create a credential provider with create_from_default_azure_credential for the scope https://redis.azure.com/.default, and pass it to redis.Redis with the host, port 10000 and ssl=True. The identity has to be added as a Redis user on the cache first. The provider refreshes the token before it expires.
Experienced developer A product price changed in the database but customers still see the old one for five minutes. How do you fix it?
Model answer
That's the TTL doing its job without invalidation. In the code path that writes the new price, I commit the database change and then delete the cache key for that product. The next read is a miss and loads the new price. I keep the TTL as a safety net. If several services write prices, I'd publish an event on each change and have one subscriber do the deletes.
Scenario Your cache is full and new SET commands fail with an out of memory error. What happened?
Model answer
The eviction policy is probably noeviction, or it's a volatile policy and most keys have no TTL, so Redis has nothing it's allowed to remove. I'd set TTLs on cached keys and pick a policy like volatile-lru or allkeys-lru, or scale the cache up if the data really needs that memory.
Vector Search with Azure Managed Redis
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What do you need to do vector search in Azure Managed Redis?
Model answer
A cache with the RediSearch module, which on Redis 7.4 you pick on the Advanced tab when creating it, and the Enterprise or Non-clustered clustering policy. Then I store each document's embedding as bytes in a hash, create an index with FT.CREATE that declares a VECTOR field, and query with FT.SEARCH using KNN.
Interviewer follows up
Can you add RediSearch to an existing cache later?
You
Not with Redis 7.4. Modules are chosen at creation and can't be added afterwards, so you'd create a new cache. Redis 8.2 (preview) includes the modules on the in-memory tiers.
Intermediate Why does your KNN query fail with a syntax error even though the index exists?
Model answer
Usually because DIALECT 2 is missing. Vector KNN syntax with $parameters needs query dialect 2. The other common one is sending the vector as a JSON string instead of raw FLOAT32 bytes.
Experienced developer How does a semantic cache decide whether to reuse an answer?
Model answer
It embeds the new prompt, runs a KNN 1 search over cached prompts, and compares the returned cosine distance with a threshold, say 0.1. Below the threshold it returns the stored response; above it, it calls the model and stores the new prompt, embedding and response with a TTL. I also filter by tenant, model and prompt version so one customer never gets another's answer and old prompts don't leak into a new release.
Architecture & design When would you use Redis for vectors rather than PostgreSQL with pgvector?
Model answer
Redis when I need very low latency and the data is a working set that fits in memory, like a semantic cache or a session-level memory for an agent. pgvector when the vectors belong with relational business data, need joins and transactions, or are too big to keep in RAM affordably.
Azure Service Bus Queues: Send, Receive and Settle Messages
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner Why would an AI web API put work on a Service Bus queue instead of doing it straight away?
Model answer
Because some AI work is slow. Summarising a long PDF can take a minute, and an HTTP request shouldn't hang that long. The API drops a message on the queue, replies "accepted" right away, and a worker processes the job at its own pace. If the worker is down, the messages wait in the queue instead of being lost.
Interviewer follows up
What happens if the worker crashes halfway through a message?
You
In peek-lock mode nothing is lost. The lock expires after the lock duration and the message becomes visible again, so another worker picks it up. Its delivery count goes up by one.
Intermediate What's the difference between peek-lock and receive-and-delete?
Model answer
Peek-lock locks the message and waits for me to settle it: complete, abandon, dead-letter or defer. Receive-and-delete removes it the moment it's handed over. It's a bit faster, but if my code crashes after receiving, that message is gone. For anything that matters, like a paid summarisation job, I use peek-lock.
Experienced developer How would you authenticate a Python worker to Service Bus without a connection string?
Model answer
I'd create the ServiceBusClient with fully_qualified_namespace set to mynamespace.servicebus.windows.net and DefaultAzureCredential. In Azure the worker's managed identity gets the Azure Service Bus Data Receiver role on the queue, and the API that sends gets Azure Service Bus Data Sender. Locally the same code uses my az login.
Scenario Your worker takes about three minutes per document and you keep seeing the same document processed twice. What's going on?
Model answer
The lock is expiring before the worker finishes. The default lock duration is one minute, so the message becomes visible again and a second worker grabs it. I'd raise the lock duration (up to five minutes), renew the lock while processing with AutoLockRenewer, and make the handler idempotent so a repeat does no harm.
Service Bus Topics, Subscriptions and Dead-Letter Queues
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner When would you choose a topic over a queue?
Model answer
When more than one system needs the same message. A "document uploaded" message might need to go to the indexer, the billing service and the audit log. With a queue, only one of them would get it. With a topic, each one has its own subscription and its own copy.
Intermediate What's the difference between a SQL filter and a correlation filter?
Model answer
A SQL filter is a condition, so it can use comparisons, AND, OR, LIKE and so on, like pages > 20 AND tier = 'premium'. A correlation filter only checks that properties equal set values, such as subject equals "invoice" and tier equals "premium". Correlation filters are cheaper for the broker, so I use them when equality is enough.
Interviewer follows up
Why does a new subscription receive everything?
You
Because it starts with the $Default rule, which is a true filter. If I add my own filter, I remove $Default or the subscription keeps receiving every message.
Experienced developer How do messages end up in a dead-letter queue?
Model answer
The common reasons are the delivery count going over the max delivery count (MaxDeliveryCountExceeded), a message expiring when dead-lettering on expiration is turned on, an error evaluating a subscription filter, or my code calling dead_letter_message with its own reason. Service Bus stamps DeadLetterReason and DeadLetterErrorDescription on the message so I can see why.
Scenario Overnight, 300 messages piled up in a subscription's dead-letter queue. What would you do in the morning?
Model answer
Peek a few to read the dead-letter reason. If it's MaxDeliveryCountExceeded, I'd check the worker logs for the bug, fix and deploy it, then read the DLQ with sub_queue set to DEAD_LETTER, send a fresh copy of each message back to the topic and complete the dead-lettered one. Nothing moves out of a DLQ by itself, so if no one reads it, it just grows.
Azure Event Grid: Custom Events, Filters and Retries
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's the difference between an event and a message?
Model answer
An event is a notification that something happened, like "invoice-42.pdf was uploaded". The publisher doesn't care who reacts or what they do. A message is usually a command or a piece of work, like "summarise invoice-42", and the sender expects someone to process it. Event Grid is built for events, Service Bus for messages.
Intermediate How would you make sure only PDF uploads in the contracts folder trigger your function?
Model answer
On the event subscription I'd filter the event type to Microsoft.Storage.BlobCreated, set subject begins with /blobServices/default/containers/contracts/ and subject ends with .pdf. Then the function never even sees a .tmp file or an upload to another container.
Experienced developer What does Event Grid do when your handler is down?
Model answer
It retries with exponential backoff. By default it tries up to 30 times within 24 hours, and you can lower either value on the subscription. Some errors, like 400 Bad Request or 413, aren't retried. When it gives up, the event is dropped unless I've set a dead-letter destination, which is a blob container in a storage account.
Scenario You created a webhook subscription and it's stuck failing with a validation error. What would you check?
Model answer
The webhook has to answer Event Grid's validation handshake. With the Event Grid schema it must echo the validationCode back as validationResponse, or someone has to open the validationUrl. With CloudEvents it must reply to the OPTIONS request with the WebHook-Allowed-Origin header. If I point the subscription at an Azure Function with the Event Grid trigger instead, the handshake is handled for me.
Azure Functions: Serverless APIs with Triggers and Bindings
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's the difference between a trigger and a binding?
Model answer
The trigger is why the function runs: an HTTP call, a message, a timer. A function has exactly one. Bindings are optional extra connections for data in or out, like writing to a queue or reading a blob, and a function can have several. The trigger is itself a kind of input binding.
Intermediate How do you write a Service Bus message from an HTTP function in Python without the Service Bus SDK?
Model answer
I add @app.service_bus_queue_output with arg_name, queue_name and connection, then add a parameter of type func.Out[str] with that name. Inside the function I call msg.set(json_text). The Functions host sends it to the queue when the function finishes.
Experienced developer What happens to a Service Bus message if your queue-triggered function throws an exception?
Model answer
The trigger uses peek-lock. If the function succeeds, the host completes the message. If it throws, the host abandons it, so it's delivered again. After the queue's max delivery count, 10 by default, Service Bus dead-letters it. So my function should be idempotent and only throw for errors worth retrying.
Scenario You need a public endpoint for a partner to request summaries, but only partners with a key should get in. How would you set up the function?
Model answer
An HTTP trigger with auth_level FUNCTION, so callers pass a function key in the x-functions-key header or the code query string. I'd give the partner their own key so I can revoke it alone. For real user identity I'd add App Service authentication with Microsoft Entra ID or put API Management in front.
Configure and Deploy Function Apps
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner Your function works locally but fails in Azure with "setting not found". Why?
Model answer
Because local.settings.json only exists on my laptop. Core Tools reads it, but it's never published. In Azure every setting has to be added as an app setting on the function app, through the portal, az functionapp config appsettings set or infrastructure code.
Intermediate How do you connect a Service Bus trigger to the namespace without a connection string?
Model answer
Turn on a managed identity for the function app, give it Azure Service Bus Data Receiver on the queue (or Data Owner if it also sends), and replace the ServiceBusConnection setting with ServiceBusConnection__fullyQualifiedNamespace set to mynamespace.servicebus.windows.net. The decorator still says connection="ServiceBusConnection"; the runtime sees the suffix and uses the identity.
Experienced developer Which hosting plan would you choose for a queue-driven AI worker that needs a VNet and fast cold starts?
Model answer
Flex Consumption. It supports virtual network integration, scales per function based on queue length, scales to zero when idle and lets me set one or two always-ready instances for the trigger that matters. I'd pick Premium only if I needed something Flex doesn't offer, like deployment slots or Windows, and Dedicated if I already pay for an App Service plan with spare room.
Scenario Users complain the first summary request each morning takes several seconds longer. What would you change?
Model answer
That's a cold start after scaling to zero overnight. On Flex Consumption I'd set always-ready instances for the http group, for example az functionapp scale config always-ready set with http=1. I pay for that warm instance, so I'd keep the number small and watch the cost.
Azure Key Vault: Retrieve and Rotate Secrets
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner Why would you move a connection string from app settings into Key Vault?
Model answer
Because app settings get copied around: into screenshots, pipeline logs and other people's laptops. In Key Vault the value sits in one place, every read is authorised by Microsoft Entra ID and logged, and I can rotate it without touching the app.
Interviewer follows up
And how does the app authenticate to Key Vault without a password?
You
With a managed identity. The app uses DefaultAzureCredential, which picks up the identity in Azure and my az login locally. I give that identity the Key Vault Secrets User role on the vault.
Intermediate What's the difference between Key Vault Secrets User and Key Vault Secrets Officer?
Model answer
Secrets User can read secret values, which is all a running app needs. Secrets Officer can also create, update, delete and recover secrets, so it fits a rotation function or an admin, not the web app.
Experienced developer How would you rotate a database password stored as a Key Vault secret without downtime?
Model answer
I'd set an expiry date on the secret and subscribe a function to the SecretNearExpiry event through Event Grid. The function generates a new password on the database, writes it with set_secret, which creates a new version, and then the old credential is retired after apps have refreshed. A common pattern keeps two credentials and alternates them so there's never a moment with no valid password.
Interviewer follows up
How do the apps notice the new version?
You
They ask for the secret without a version, so they always get the latest. I cache the value in memory and refresh it on a timer, or when a call fails with an authentication error.
Scenario A developer deleted a production secret by mistake. What can you do?
Model answer
Soft delete is always on, so the secret is in a deleted state, not gone. Someone with recover permission (Secrets Officer covers it) can call begin_recover_deleted_secret. If purge protection is on, nobody could have purged it early either.
Architecture & design When would you choose a user-assigned managed identity over a system-assigned one?
Model answer
When several resources need the same access, or when I want the role assignment to exist before the resource is created, for example in a blue-green deployment. A user-assigned identity is its own resource, so it survives when the app is deleted. In code I pass its client ID to DefaultAzureCredential.
Azure App Configuration: Settings and Feature Flags
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner Why use App Configuration when App Service already has app settings?
Model answer
App settings belong to one app. When six services share the same model deployment name and endpoint, I'd rather change it once. App Configuration gives me one store with labels for each environment, feature flags and a change history, and apps can refresh without restarting.
Intermediate Should you store an API key in App Configuration?
Model answer
No. I store the key in Key Vault and add a Key Vault reference in App Configuration. The reference holds only the secret's URI. The app's provider reads the URI and fetches the secret from Key Vault using its own identity, so App Configuration never sees the value.
Interviewer follows up
What permissions does the app need then?
You
App Configuration Data Reader on the store, and Key Vault Secrets User on the vault, because the app itself reads the secret.
Experienced developer How do you make a Python app pick up a changed setting without a restart?
Model answer
I pass refresh_on with a WatchKey for a sentinel key and a refresh_interval to load(), then call config.refresh() regularly, for example once per request or in a background loop. When the interval has passed, the provider checks the sentinel. If it changed, it reloads every selected key.
Scenario You want to try a new model with internal users first, then everyone. How?
Model answer
A feature flag in App Configuration, say use-gpt-5, with a targeting filter for the internal group. The code checks feature_manager.is_enabled("use-gpt-5") and picks the deployment. When I'm happy, I widen the audience or switch the flag on for everyone. No redeploy either way.
Architecture & design How would you make a release's configuration repeatable and easy to roll back?
Model answer
I'd create a snapshot of the release's key-values, for example release-2026-11, and have production load that snapshot by name. A snapshot can't change, so production sees exactly what was tested. Rolling back means pointing at the previous snapshot.
Distributed Tracing with OpenTelemetry
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's the difference between a trace and a span?
Model answer
A span is one step, like "call Cosmos DB" or "POST /ask", with a start time and a duration. A trace is the whole request: all the spans that share one trace ID, arranged as a tree of parents and children.
Intermediate How does the trace ID get from the web API to the worker?
Model answer
Through context propagation. For HTTP, OpenTelemetry adds the W3C traceparent header to the outgoing call, and the instrumentation on the receiving side reads it and continues the same trace. For messaging, the Azure SDK instrumentation puts the context in the message properties.
Interviewer follows up
What's in the traceparent header?
You
A version, the 32-character trace ID, the 16-character parent span ID and trace flags, such as 00-4bf92f35...-00f067aa...-01. The last part says whether the trace was sampled.
Experienced developer What does configure_azure_monitor() give you out of the box in Python?
Model answer
It wires up the OpenTelemetry SDK with the Azure Monitor exporter for traces, metrics and logs, and turns on the bundled instrumentations: Django, FastAPI, Flask, requests, urllib and urllib3, psycopg2 and Azure SDK tracing. I add custom spans only for the business steps I care about, like retrieval and the model call.
Scenario Every service appears as the same node on the application map. Why?
Model answer
They're not setting a service name, so the cloud role name is a default for all of them. I'd set OTEL_SERVICE_NAME, or service.name in OTEL_RESOURCE_ATTRIBUTES, to a different value per service, like chat-api and summary-worker.
Architecture & design Tracing costs are climbing. What would you change?
Model answer
Turn on sampling, for example sampling_ratio=0.2 in configure_azure_monitor, so about one trace in five is kept but each kept trace stays whole across services. I'd also drop noisy spans and big attributes, and keep alerts on metrics, which aren't affected by trace sampling in the same way.
KQL Queries for Logs and Metrics
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner How do you read a KQL query?
Model answer
Top to bottom. It starts with a table, and each pipe passes the rows to the next operator. So requests | where success == false | count means "take requests, keep the failed ones, count them".
Intermediate How would you find the slowest operations in the last hour?
Model answer
requests | where timestamp > ago(1h) | summarize p95 = percentile(duration, 95), calls = count() by name | top 10 by p95 desc. I use the 95th percentile rather than the average because a few very slow calls hide inside an average.
Experienced developer Why does the same query fail when you run it in the Log Analytics workspace instead of Application Insights?
Model answer
Workspace-based Application Insights stores data in tables with different names and columns. In Application Insights Logs I can use requests with timestamp, success and duration. In the workspace the table is AppRequests with TimeGenerated, Success and DurationMs. Same data, different schema.
Scenario A container app is crash-looping. Where do you look with KQL?
Model answer
ContainerAppConsoleLogs_CL for what the app wrote to stdout and stderr, filtered by ContainerAppName_s and sorted by time, and ContainerAppSystemLogs_CL for platform events like failed probes. For AKS I'd query ContainerLogV2 by PodName and ContainerName.
Architecture & design When would you pick a log search alert over a metric alert?
Model answer
A metric alert when there's a metric that already says it, like CPU, request count or Service Bus queue length. It's evaluated about every minute and is cheaper. A log search alert when the condition needs a query, like "more than 5% of /ask calls failed for tenant X" or "this exception text appeared". It runs on a schedule, so it's a bit slower to fire.