Performance Cost Optimization & Resource Efficiency Questions
Optimizing for the money and resources a given level of performance consumes, not just raw speed. Covers cost-per-request, training-cost and cost-per-inference reasoning, right-sizing and cost-driven autoscaling of compute, memory and storage, choosing between on-demand, reserved and spot capacity, storage tiering and egress-cost reduction, cloud-bill diagnosis and reduction plans, and cost allocation or chargeback across teams and tenants. A question belongs here when the primary deliverable is a cost or resource-consumption calculation, decision or reduction plan, not when cost is one line among several unrelated technical considerations. Distinct from defining or measuring latency, percentiles, SLOs and latency budgets on their own, from profiling and bottleneck diagnosis such as flame graphs, hotspots and query tuning, from production incident and on-call triage, from general multi-axis trade-off frameworks where cost is incidental to a decision about latency, freshness or complexity, from concurrency, batching and thread-safety mechanics, and from garbage-collection and memory-leak tuning: those are covered by dedicated sibling topics.
Given a small Transformer model where average token generation cost is 5ms on GPU versus 20ms on CPU, GPUs cost 5x per hour relative to CPUs, and expected inference workload is 200 tokens/sec, describe how you would decide to serve on GPU or CPU. Include calculations for cost-per-token, batching effects, latency SLO considerations, and how utilization affects the decision.
Case study: your baseline model takes 100 GPU-hours to reach target accuracy, and you're asked to cut that to 20 GPU-hours (a 5x reduction) while keeping at least 99% of baseline accuracy. Walk through the plan you would propose: what you would try first, what categories of change you would consider (algorithmic, model architecture, data, and tooling), and how you would estimate the expected compute savings and risk of each before committing engineering time to it.
Behavioral: Tell me about a time you had to reduce ML inference cost while preserving user experience. Use the STAR framework: explain the Situation, specific Task, Actions you took (measurement-driven like A/B tests or canaries), and the Results (metrics and business impact). Focus on trade-offs, stakeholder communication, and lessons learned.
Your product uses a large language model for customer support, and inference cost per request is high because contexts are long and the model generates many tokens per response. Walk through how you would bring that cost down: what levers you'd pull, how you'd prioritize them by likely ROI, and how you'd validate that each change actually saved money without hurting response quality.
Compare the cost trade-offs between training large models and serving them for inference. For a model used in production with periodic retraining, describe when compute should be invested in more training to reduce inference complexity (distillation), versus optimizing serving cost (quantization, batching). Include examples of amortization over requests.
Unlock Full Question Bank
Get access to all 10 Performance Cost Optimization & Resource Efficiency interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.