Skip to content
Tech Interview Prep
Technical interview guide

Self-Service Infrastructure

Letting teams provision what they need through an API or portal, with policy enforced automatically instead of manually.

Read
40 min
Practice MCQs
25
Interview Q&A
25
Edition
v3
Editorial status
Reviewed
Relevant for
Platform Engineer

Scope: AWS and Microsoft platform engineering guidance and HashiCorp Terraform/HCP Terraform documentation current 2026-08-31; confirm product-tier and version-specific policy features for the target deployment.

Curated: · Written: · Reviewed:

25 questions

MCQ-3A team edits the `ami` argument of `aws_instance.web`, adds an `aws_eip.web`, and deletes `aws_instance.old` from the configuration. `terraform plan` prints a body containing `-/+ aws_instance.web`, `+ aws_eip.web`, and `- aws_instance.old`, with no other resource lines. What summary line does the plan end with?
MCQ-7A team keeps Terraform state only as a local file on one engineer's laptop. The disk fails and the file is unrecoverable. The team runs `terraform plan` from a clean checkout with no state. The configuration declares 60 EC2 instances, 12 RDS databases and 4 load balancers, all of which are running in AWS. What does the plan show?
MCQ-6A team manages three EC2 instances from one block: ```hcl resource "aws_instance" "app" { count = length(var.names) ami = "ami-0123456789abcdef0" instance_type = "t3.micro" tags = { Name = var.names[count.index] } } ``` with `var.names = ["a", "b", "c"]`. They edit the variable to `["a", "c"]` and run `terraform plan` (Terraform 1.6, AWS provider 5.x) against the existing state. What does the plan report?
MCQ-10A policy runs in CI against `terraform show -json tfplan` and blocks any plan that destroys a resource. Its rule flags a resource when `change.actions` equals `["delete"]`. A PR renames `aws_db_instance.orders`, which forces replacement; the plan records that resource with `actions: ["delete","create"]`. The policy passes, the PR merges, and the production database is destroyed. Which rule change makes the policy flag this replacement?
MCQ-18A team stores Terraform state in S3. The state file records `aws_instance.web` with `instance_type = "m5.large"`. On Monday an engineer edits the config to `instance_type = "m5.xlarge"` and merges the change without running apply. On Tuesday another engineer resizes the running instance in the AWS console to `m5.2xlarge`. On Wednesday CI runs `terraform plan` with default refresh behaviour. What does the plan report?
MCQ-9A CI job running `terraform apply` against a local backend was killed by the runner's 10-minute timeout 40 minutes ago. The next `terraform plan` fails with: `Error acquiring the state lock: Lock Info: ID: 7f3c9a2e, Operation: apply, Who: ci-runner-7, Created: 40 minutes ago`. No other Terraform process is running on any machine that can access this state. What should the engineer do next?
MCQ-8Two engineers share an S3 backend with DynamoDB state locking. A CI runner is terminated mid-apply when its spot instance is reclaimed at 09:14. At 12:30 a developer runs `terraform apply` and it fails in under a second: ``` Error: Error acquiring the state lock Lock Info: ID: 7c9e1a2b-4d3f-... Path: terraform.tfstate Operation: OperationTypeApply Who: ci-runner-7@10.0.3.14 Created: 2024-06-11 09:14:02 ``` No apply is running now. What is the correct action?
MCQ-19During a 02:00 incident, an on-call engineer created an S3 bucket named `acme-logs-2024` by hand to capture debug logs, because the Terraform-managed log bucket was in a failing region. The module (Terraform 1.7, S3 backend) manages buckets with `for_each = toset(var.team_names)`, and `var.team_names` currently contains `["payments", "search"]`. The engineer wants the bucket under Terraform management without losing the logs already in it. What should they do?
MCQ-20A build service runs untrusted pull-request code under a service account that can write to every artifact bucket in the project. The job reads the target bucket name from the PR's own config file and uploads the artifact there. Which statement describes the confused-deputy risk in this setup?
MCQ-5Your orchestrator runs tenant build steps in containers on shared workers; each step pushes artifacts straight to that tenant's object-store bucket. Users can belong to several tenants. A review requires that a container environment leaked by one tenant cannot be used against any other tenant's bucket, and that it stops working once that tenant's run ends. The longest build is 25 minutes. Which credential should the orchestrator inject into the container?
MCQ-4A Terraform Cloud workspace authenticates to AWS with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY stored as ordinary environment variables, so both plan and apply runs receive them. The IAM user behind those keys has s3:* and rds:*. Any contributor's pull request triggers a speculative plan, and plan runs execute the configuration's `data "external"` blocks. Security wants a malicious PR to be unable to delete production data. Which change achieves that?
MCQ-1A platform team's portal handles environment requests. Last quarter, 1,180 of 1,200 requests passed the policy engine in under a minute and the pipeline built them in a median of 4 minutes. The other 20 were rejected by policy; those developers filed a ticket and an operator provisioned each by hand, about 30 minutes apiece. Environments are removed by hand too: a developer files a ticket and an operator runs the destroy, about 15 minutes each, for roughly 300 environments a quarter. The team has one engineer-quarter to spend and wants the portal to be genuinely self-service. Which change removes the most manual work from the lifecycle?
MCQ-2A platform team's provisioning module takes a request object with five fields. Four have defaults computed from the target account or environment tier: `region` (the account's default region), `instance_class` (from the tier), `log_retention_days` (from the tier), and `backup_window` (from the region). The fifth, `data_classification`, defaults to `internal`. In March a payments team provisioned a service through the module without setting `data_classification`; the module applied the `internal` profile (30-day log retention, an AWS-managed KMS key, no cross-region backup) and 90 days of cardholder data sat in a bucket under an AWS-managed key until an audit found it. The portal's abandonment rate triples once a request has more than two required fields, so the team will add at most one. Which change prevents this class of incident?
MCQ-17A self-service portal provisions several resource classes for each environment request. A nightly reaper deletes any resource whose `expires_at` tag has passed. Last quarter it deleted 41 resources teams still needed and left 900 abandoned ones running. Which resource class should the portal stamp with `expires_at` and hand to the reaper?
MCQ-15A 12-node cluster with autoscaling off has 96 allocatable vCPU, shared by 30 product teams that each get namespaces from a self-service portal. The portal's only control is a cap of five namespaces per team; nothing limits CPU. At 02:00 one team's batch fan-out scheduled pods requesting 60 vCPU, and for 22 minutes nine other teams' services breached their 500 ms p99 SLO. Cluster capacity is fixed for the next two quarters. Which change to the portal most directly prevents one team's fan-out from starving the other 29 again?
MCQ-21A platform team's tagging pipeline works like this: the provisioning service creates the resource, calls the tag API with `team`, `env` and `cost-center` from the request record, and writes the resource ID to the CMDB only if that call succeeds. A nightly job lists every resource in the CMDB and re-applies the three tags from the request record. The policy has been enforced since January. On 3 March the tag API returned 503 for every call between 14:10 and 14:50. The March bill shows 612 compute resources unallocated, all created in that window; the reconciler has run every night since and they are still unallocated, though their request records still carry all three tags. The other 1,438 compute resources on the bill are allocated correctly. What is the most likely explanation?
MCQ-23A platform team replaced ticket-based provisioning with a self-service portal. Before: 400 requests per quarter, mean time from request to a working namespace 3.5 days. After: 520 requests; 78% completed through the portal with a mean of 6 minutes; the other 22% still went through tickets with a mean of 4.2 days; portal sessions per developer per week rose from 2 to 9. The review deck leads with 'self-service adoption up 4.5x'. Which statement do the numbers support?
MCQ-24A platform team's quarterly review leads with 'resources provisioned: 5,000, up 38% year over year' as evidence that developer self-service is growing. The same dashboard shows 3,100 of those 5,000 resources were deleted within 24 hours by the same service account that created them, and the median resource lifetime fell from 21 days to 6 days. Which reading of the 38% does the dashboard support?
MCQ-11A Kubernetes admission controller rejects any Deployment without the `owner` label. Its current denial is HTTP 403 with body `{"error":"forbidden"}`. In two weeks, 38 tickets ask which label to add, and median time to fix is 52 minutes. The policy exists because Deployments need an owner for on-call routing. The platform team wants the denial itself to let developers self-serve without weakening the policy. Which response body best achieves that?
MCQ-12A platform team enforces policy-as-code through an admission webhook. Break-glass overrides are stored as `{policy, namespace, expires_at}` rows in a database. The webhook loads the whole override table into memory at startup and reloads it on a fixed 300 s schedule (10:00:00, 10:05:00, 10:10:00) and never re-reads the database between reloads. An override for namespace `payments` is granted at 10:00:10 with `expires_at` 10:10:10. Four deploys to `payments` reach the webhook at 10:00:30, 10:02:00, 10:06:00 and 10:12:00. Which deploys are admitted?
MCQ-14A checkout handler calls `chargeCard(ctx, order)` against a payment provider (p99 200 ms) and then inserts the order row. The provider's SDK aborts the HTTP request when `ctx` fires, and the provider deduplicates on the order's idempotency key. A client disconnects 50 ms into `chargeCard`, cancelling `ctx`; the handler returns without inserting the row. The reconciliation job holds the order's idempotency key, and the provider exposes `GET /charges?idempotency_key=`. What must the job do for this order?
MCQ-13A payments API accepts POST /transfers and processes them asynchronously: the enqueue path assigns a fresh server-generated UUID to each accepted request, and a worker executes whatever it dequeues. The gateway retries any request that has not returned within 30 s, and the mobile client retries after 60 s. During a provider slowdown, one user tap produced three executed transfers. Which change stops the duplicates?
MCQ-25A platform's self-service deletion marks the tenant `deleted` in the control plane as soon as the API returns 200, then runs an async worker that revokes the tenant's IAM role and deletes the tenant's S3 objects. A nightly reconciliation compares the control plane against provider state. Last night it reported: 12 tenants marked `deleted` with live S3 objects; 7 tenants marked `deleted` with an active IAM role; 3 tenants appear in both lists. How many tenants are marked `deleted` but have not reached the intended outcome?
MCQ-22A Kubernetes cluster's control plane (API server, scheduler, controller manager) is unreachable for 45 minutes. During the outage, 3,000 pods are already running on 150 nodes, and 12 Deployments created just before the outage have no running pods yet. The kubelets on all 150 nodes cannot renew their node leases. What is the state of the running pods and the 12 Deployments during the outage?
MCQ-16A checkout service runs 20 instances behind a CPU-based autoscaler, has a monthly budget of $18,000 with an alert at 90% of budget, and an SLO of 99.9% of requests succeeding. On Tuesday a downstream payment API starts returning 503s in 20 ms instead of its usual 180 ms. By 14:00 the cost dashboard shows the month tracking 35% under budget and the autoscaler has removed 6 instances. What does the under-budget figure indicate?