Skip to content

Cookies on Jobverse

We use cookies that are needed to sign you in and keep the site working. With your permission we’d also use an analytics cookie to count job views, and Google advertising cookies to show ads. The site works the same whatever you choose. Read the Cookie Policy.

Jobverse
Sign in

AI Engineer Top 100 Interview Questions

100 AI engineer interview questions with structured answers, comparison tables, flow diagrams, worked calculations and runnable code. Covers machine learning fundamentals, evaluation, deep learning, language models, retrieval, agents, deployment and responsible AI, from the basics to system design.

100 questions

Questions 81-100 of 100

  1. Q81.How would you build an offline evaluation set for a language-model application?

    I would define measurable task success and collect cases that represent real use, including difficult failures. The set should guide decisions without becoming another training dataset.

    1. Define outputs, required evidence, acceptable uncertainty behavior, and evaluation rules before collecting examples, involving people who understand the actual user task.
    2. Sample common requests and important edge cases, preserving relevant language, document, and user-group coverage without unnecessary sensitive information.
    3. Create reliable labels or rubrics and review disagreements. Include cases where missing or conflicting evidence makes abstention the correct outcome.
    4. Keep a held-out portion independent of iteration, version the set, and report quality alongside latency and cost under the same evaluation conditions.
    flowchart TD
      A["Define task rubric"]
      B["Collect representative cases"]
      C{"Judgments consistent?"}
      D["Clarify rubric and labels"]
      E["Reserve held-out cases"]
      F["Compare candidate systems"]
      A --> B
      B --> C
      C -->|no| D
      D --> C
      C -->|yes| E
      E --> F

    Trade-offs:

    • Common cases estimate average performance, while rare severe failures need deliberate coverage even when they are uncommon in traffic.
    • Repeatedly optimizing against one set can hide weaknesses, so preserve independent checks and refresh coverage as usage changes.

    Example

    Consider extracting facts from incoming documents.

    1. Include clear, incomplete, contradictory, and unusually formatted documents.
    2. Label each required field and whether it is supported.
    3. Measure unsupported values separately from missing values.
    4. Reserve independent documents to assess the final selected prompt and model.
  2. Q82.How do deterministic checks, model-based judges, and human review complement each other?

    The methods provide different kinds of evidence about quality. Combine them based on what can be checked objectively and where interpretation or domain expertise is required.

    Deterministic checksModel-based judgesHuman review
    Strength: repeatable exact rulesStrength: scalable rubric applicationStrength: contextual and domain judgment
    Limit: little semantic coverageLimit: possible bias and inconsistencyLimit: cost and reviewer variation

    When to use which:

    • Use deterministic checks for schema validity, exact calculations, required fields, and observable final-state requirements that have clear pass-or-fail definitions.
    • Use model-based judges for scalable assessments only after comparing their decisions with trusted labels, checking position bias and sensitivity to irrelevant wording.
    • Use human review for ambiguous or consequential cases, calibrating reviewers with examples and measuring disagreement rather than assuming all reviewers are interchangeable.

    A model should not be the sole authority for verifying its own unsupported claims when stronger external evidence is available.

  3. Q83.When should predictions run online, in batches, or in an event stream?

    The serving pattern should match how quickly results are needed and how inputs arrive. Freshness, throughput, and predictable response time matter more than a preferred architecture.

    OnlineBatchEvent stream
    Triggered by an interactive requestTriggered on a scheduleTriggered by continuous incoming events
    Priority: response latencyPriority: throughput and efficiencyPriority: freshness and continuous processing

    When to use which:

    • Use online inference when a user or service needs an immediate prediction, including deadlines, capacity limits, and graceful handling of overload.
    • Use batch inference when a delay is acceptable and many records can be processed efficiently together, with restartable jobs and completion tracking.
    • Use event processing when new observations should continuously update results, explicitly defining event ordering, late arrivals, and duplicate-handling behavior.

    Streaming generated tokens to a user is a response-delivery technique and does not by itself imply a continuous event-processing architecture.

  4. Q84.What is training–serving skew, and why does it damage model quality?

    Training–serving skew occurs when live inputs or transformations differ from those used during development. The model then receives a meaningfully different representation from the one it learned.

    • Definitions: identical field names can hide different units, time windows, missing-value conventions, or eligibility rules between offline and online systems.
    • Timing: historical feature construction must use information available at the prediction time, including real availability delays rather than only event timestamps.
    • Consistency: version preprocessing and feature contracts, share implementations where practical, and compare offline and live outputs on the same representative records.
    • Diagnosis: retain sufficient versioned evidence to reproduce failures while avoiding unnecessary exposure of sensitive raw inputs in logs.

    Retraining does not fix a persistent representation mismatch unless the data and serving definitions are corrected as well.

  5. Q85.What must be recorded to reproduce an AI experiment?

    Reproduction requires the full path from data to measured results, not only a saved model. Record the versions and settings that can change behavior.

    • Data: preserve dataset snapshots, labeling rules, partition assignments, preprocessing, and any filters that determine which examples enter the experiment.
    • Model and execution: record starting weights, architecture, training settings, random seeds, dependency versions, and relevant hardware or numerical settings.
    • Application context: version prompts, retrieval collections, tool schemas, and output settings when evaluating a system that includes language-model components.
    • Measurement: retain the evaluation rubric, scorer, outputs, and resource measurements so that a claimed improvement can be checked rather than merely repeated from memory.

    A fixed seed alone does not guarantee identical results across nondeterministic operations, distributed execution, or changing hosted dependencies.

  6. Q86.How would you release a new model without exposing all users to a regression?

    I would release gradually behind explicit quality and operational gates. The deployment plan must include a tested way to restore a compatible previous system.

    1. Validate the complete artifact, including preprocessing, input contracts, resource requirements, and dependent indexes or prompts, using representative offline tests.
    2. Observe candidate behavior on copied traffic where appropriate, ensuring that shadow processing cannot execute unintended real-world side effects.
    3. Expose a controlled portion of live traffic and compare outcome quality, errors, tail latency, and cost against agreed expansion or rollback thresholds.
    4. Expand only when evidence supports it, retaining compatible previous artifacts and monitoring delayed outcomes that may not appear during the initial release window.
    flowchart TD
      A["Validate release package"]
      B["Observe limited traffic"]
      C{"Release gates pass?"}
      D["Expand traffic gradually"]
      E["Rollback and investigate"]
      F["Monitor delayed outcomes"]
      A --> B
      B --> C
      C -->|yes| D
      C -->|no| E
      D --> F

    Trade-offs:

    • Small releases reduce exposure but may need longer observation to reveal rare failures or statistically meaningful outcome changes.
    • Rollback becomes harder when models, schemas, and indexes change together, so plan compatibility before deployment rather than during an incident.

    Example

    Consider replacing a routing model.

    1. Compare its predictions on copied requests without changing destinations.
    2. Route a small eligible traffic share through it.
    3. Watch incorrect routing and tail latency.
    4. Restore the previous compatible package if either release gate fails, then investigate the recorded cases.
  7. Q87.What is the difference between data drift and concept drift?

    Data drift changes the distribution of inputs. Concept drift changes the relationship between inputs and outcomes, so familiar observations may no longer support the same predictions.

    Data driftConcept drift
    The input distribution changesThe relationship to the outcome changes
    Signal: changed feature statisticsSignal: changed error or outcome pattern
    Does not prove quality loss on its ownNeeds outcome-based assessment

    When to use which:

    • Monitor data drift to detect new populations, collection problems, or changed usage patterns, then investigate whether those changes affect important predictions.
    • Monitor outcome quality and subgroup errors to identify changed relationships, accounting for label delays and changes in how outcomes are measured.
    • Use retraining only after diagnosing the cause and validating a candidate replacement, because automatic updates can amplify corrupted inputs or unstable labels.

    A distribution alert is a reason to investigate rather than evidence that the deployed model has necessarily become inaccurate.

  8. Q88.How would you reduce latency in a language-model application?

    I would profile the full request path before changing the model or architecture. Optimize the dominant delay while preserving required quality and acceptable behavior under load.

    1. Separate queue time, retrieval, reranking, input processing, first-token delay, and output generation, measuring tail latency as well as averages.
    2. Remove unnecessary sequential work and parallelize independent operations within concurrency limits. Avoid increasing load beyond dependency capacity.
    3. Reduce unnecessary context or output length, evaluate smaller adequate models, and use compatible batching or caching where their freshness and isolation rules hold.
    4. Load-test the revised system with representative request lengths and concurrency, checking quality, failure rates, and cost before accepting the optimization.
    flowchart TD
      A["Profile request stages"]
      B{"Retrieval dominates?"}
      C["Optimize search path"]
      D["Optimize model path"]
      E["Load-test candidate"]
      F{"Quality retained?"}
      G["Accept optimization"]
      H["Revise approach"]
      A --> B
      B -->|yes| C
      B -->|no| D
      C --> E
      D --> E
      E --> F
      F -->|yes| G
      F -->|no| H

    Trade-offs:

    • Batching can increase throughput while adding queue delay, so choose based on the service’s response-time requirements.
    • Token streaming improves perceived responsiveness but does not automatically reduce total computation or the time to a complete answer.

    Example

    A request spends most of its time reranking an unnecessarily large candidate set.

    1. Compare smaller candidate counts on retrieval and final-answer quality.
    2. Keep a count that preserves required evidence coverage.
    3. Measure tail latency under realistic traffic.
    4. Avoid changing output length as the first fix for this upstream delay.
  9. Q89.How would you handle rate limits, timeouts, and dependency failures?

    I would distinguish temporary failures from permanent request problems and apply bounded recovery. Every retry must fit the request deadline and respect side-effect safety.

    1. Set per-dependency timeouts and an overall deadline, with clear error categories for overload, unavailable services, invalid input, and unauthorized requests.
    2. Retry appropriate transient failures with bounded backoff and jitter, respecting server guidance and using concurrency limits to prevent a retry storm.
    3. For operations that change state, use duplicate-safe execution or check completion status after ambiguous failures before repeating the action.
    4. Provide a validated fallback or explicit failure response when the budget is exhausted, and monitor errors, queues, and recovery success over time.
    flowchart TD
      A["Observe dependency failure"]
      B{"Transient and retry safe?"}
      C["Wait within retry budget"]
      D["Retry operation"]
      E{"Deadline remaining?"}
      F["Fallback or report failure"]
      A --> B
      B -->|no| F
      B -->|yes| E
      E -->|yes| C
      C --> D
      D -->|failure| A
      E -->|no| F

    Trade-offs:

    • Retries improve availability for temporary faults but can worsen overload and duplicate changes if recovery is not carefully controlled.
    • Fallbacks preserve service only when they still meet the request’s privacy, freshness, and minimum quality requirements.

    Example

    A state-changing request times out after submission.

    1. Treat completion as uncertain rather than automatically failed.
    2. Query the operation status or resulting state.
    3. Retry only through a duplicate-safe mechanism if needed.
    4. Report an unresolved state explicitly when the system cannot confirm the outcome.
  10. Q90.How would you diagnose an out-of-memory failure during training or inference?

    I would identify which memory category grows before choosing a remedy. Model weights, activations, gradients, optimizer state, and attention caches require different interventions.

    1. Reproduce the failure with measured batch size, sequence length, concurrency, precision, and lifecycle stage, checking for accidentally retained tensors or graphs.
    2. During training, examine activation and optimizer-state costs. Compare smaller microbatches, accumulation, recomputation, or reduced trainable state where appropriate.
    3. During inference, disable unnecessary gradient recording, control request and context sizes, and inspect cache usage under concurrent long requests.
    4. Evaluate supported precision reduction, offloading, or state partitioning when needed, then benchmark quality, latency, and throughput after the change.
    flowchart TD
      A["Measure memory growth"]
      B{"Training failure?"}
      C["Inspect activations and training state"]
      D["Inspect weights and request caches"]
      E["Apply targeted reduction"]
      F["Verify capacity and quality"]
      A --> B
      B -->|yes| C
      B -->|no| D
      C --> E
      D --> E
      E --> F

    Trade-offs:

    • Recomputation saves activation memory but increases processing work, while offloading can introduce transfer-related latency.
    • Lower precision and smaller contexts may improve capacity but must be evaluated for numerical or information-loss regressions.

    Example

    An inference service succeeds for one short request but fails with many long conversations.

    1. Measure cache growth with concurrency and context length.
    2. Limit simultaneous long requests or adjust cache management.
    3. Preserve necessary evidence rather than truncating blindly.
    4. Load-test the revised limits and document the supported workload.
  11. Q91.How do you estimate raw embedding storage for a document collection?

    Multiply the number of stored vectors by their dimension and bytes per component. This gives raw vector storage before index structures, text, metadata, and operational overhead.

    • Vector count: vector_count = document_count * average_chunks_per_document when every chunk produces one stored vector; measure the actual distribution when it varies.
    • Storage formula: raw_bytes = vector_count * dimensions * bytes_per_component, with a consistent numerical representation across the counted vectors.
    • Additional costs: include indexing structures, identifiers, permissions, source text, replicas, and temporary capacity needed during updates or migrations.
    • Use: estimate scale before implementation, then measure real storage and search performance because raw vector size alone cannot predict total infrastructure requirements.

    Example

    This calculation uses 100,000 documents, three chunks each, 768 dimensions, and four bytes per component.

    1. vector_count = 100,000 * 3 = 300,000.
    2. Each vector needs 768 * 4 = 3,072 bytes.
    3. Raw storage is 300,000 * 3,072 = 921,600,000 bytes.
    4. That is about 0.922 decimal GB, before metadata, indexes, and replicas.
  12. Q92.How do you estimate token-based inference cost for a workload?

    Calculate input and output charges separately, then aggregate across expected requests. Use the actual billing rules for the deployment and clearly label any planning assumptions.

    • Per-request formula: cost = input_tokens * input_rate / unit_size + output_tokens * output_rate / unit_size, where the unit size matches each quoted rate.
    • Volume: multiply by representative request counts, accounting for different task types rather than assuming all requests have identical lengths.
    • Hidden workload: retries, tool loops, evaluation calls, and intermediate generation can increase total token use beyond the final user-visible answer.
    • Uncertainty: use observed distributions and scenario ranges, including caching or other charging rules only when the deployment actually supports and applies them.

    Example

    This calculation uses hypothetical rates of 2 billing units per million input tokens and 8 per million output tokens.

    1. A request uses 1,000 input and 250 output tokens.
    2. Input cost: 1,000 * 2 / 1,000,000 = 0.002.
    3. Output cost: 250 * 8 / 1,000,000 = 0.002.
    4. Total cost is 0.004 per request, or 40 for 10,000 identical requests, excluding other charges.
  13. Q93.Given normalized attention weights, how do you calculate the resulting value vector?

    Multiply each value vector by its corresponding attention weight, then add the weighted vectors component by component. The result preserves the dimensionality of the values.

    • Formula: output_j = sum(weight_i * value_i_j), where i identifies an attended position and j identifies a value-vector component.
    • Preconditions: each position must have a compatible value dimension, and the weights should represent the normalized attention distribution for the query.
    • Interpretation: larger weights contribute more of their associated values, but value directions and magnitudes also affect the resulting representation.
    • Limits: this calculation covers one attention-weighted combination; output projections, multiple heads, residual paths, and later layers add further transformations in a complete network.

    Example

    This calculation combines weights [0.2, 0.3, 0.5] with value vectors [2, 0], [0, 2], and [4, 4].

    1. Confirm that weights sum to 0.2 + 0.3 + 0.5 = 1.
    2. First component: 0.2 * 2 + 0.3 * 0 + 0.5 * 4 = 2.4.
    3. Second component: 0.2 * 0 + 0.3 * 2 + 0.5 * 4 = 2.6.
    4. The output vector is [2.4, 2.6].
  14. Q94.How would you merge ranked search lists using reciprocal rank fusion?

    I would give each item a contribution based on its rank in each list, add those contributions, and order items by the resulting score.

    • Formula: score(item) = sum(1 / (offset + rank)) over lists containing the item, using one-based rank and a positive smoothing offset.
    • Motivation: ranking positions can be combined without assuming that different retrieval methods produce raw scores on compatible numerical scales.
    • Correctness: count an item at most once per list, preserve stable identifiers, and define deterministic tie-breaking for reproducible output.
    • Evaluation: the offset changes the balance between top positions and agreement across lists, so choose settings using relevance judgments and compare with individual retrieval methods.

    Example

    This code fuses two ranked lists and places the item supported by both lists first.

    def fuse(rankings, offset=60):
        if offset <= 0:
            raise ValueError("offset must be positive")
        scores = {}
        for ranking in rankings:
            seen = set()
            for rank, identifier in enumerate(ranking, 1):
                if identifier in seen:
                    continue
                seen.add(identifier)
                scores[identifier] = scores.get(identifier, 0.0) + 1 / (offset + rank)
        return sorted(scores, key=lambda identifier: (-scores[identifier], identifier))
    
    print(fuse([["a", "b"], ["b", "c"]]))
    # Expected output: ['b', 'a', 'c']
  15. Q95.How do you identify unfair performance across groups of users?

    Evaluate outcomes and errors across meaningful groups and intersections, with attention to sample size and context. One overall quality score can hide large differences in who benefits.

    • Data coverage: inspect whether training and evaluation adequately represent the populations, input styles, and operating conditions the application will encounter.
    • Labels and proxies: examine how historical decisions and correlated features can encode bias, even when an explicit sensitive attribute is excluded.
    • Metrics: compare relevant error rates, coverage, and calibration, recognizing that fairness criteria can conflict and must reflect the decision’s actual consequences.
    • Response: investigate root causes and validate changes to data, modeling, or decision policy, then monitor real outcomes rather than declaring fairness from one offline test.
  16. Q96.What can feature-attribution explanations tell you, and what can they not prove?

    Feature attribution describes how input features relate to a model’s prediction under a particular explanation method. It does not automatically establish causation or justify the decision.

    • Scope: distinguish explanations of one prediction from summaries of overall model behavior, because local and global questions require different evidence.
    • Assumptions: results can depend on the reference population, treatment of missing features, and assumptions about how correlated inputs vary together.
    • Stability: correlated features may share or redistribute importance, so compare explanations across relevant samples and avoid overinterpreting a single ranking.
    • Verification: combine attribution with error analysis, domain knowledge, and targeted tests; use appropriate causal methods when the question concerns what an intervention would change.

    A persuasive explanation can accompany an incorrect prediction, so explanation quality and predictive correctness must be evaluated separately.

  17. Q97.What privacy controls are important across an AI application’s data lifecycle?

    Privacy controls should cover collection, processing, storage, transmission, logging, and deletion. Protecting only the original dataset leaves derived artifacts and operational copies exposed.

    • Minimization: collect and retain only information required for the task, separating direct identifiers when the application can operate without them.
    • Access: apply authentication, authorization, encryption, and secure secret handling to raw records, derived representations, model inputs, and stored outputs.
    • External processing: verify the actual handling of submitted content, retention, and permitted use for the chosen deployment rather than assuming every service behaves identically.
    • Operations: avoid unnecessary sensitive data in telemetry, define retention and deletion procedures, and check that access changes propagate into caches, indexes, and backups as applicable.
  18. Q98.How would you design an internal document assistant from end to end?

    I would start with user tasks, authoritative sources, permissions, and measurable service requirements. The design should connect evidence quality to controlled serving and ongoing evaluation.

    1. Define expected questions, source formats, freshness requirements, access boundaries, traffic, and acceptable errors, establishing a simple baseline and evaluation set.
    2. Build versioned ingestion that preserves structure, source locations, and permissions, with monitored indexing and reliable propagation of changes and deletions.
    3. Authenticate requests, retrieve eligible evidence, and generate answers only when sufficient support exists, preserving traceable support for important claims.
    4. Add verification, explicit uncertainty behavior, observability, load testing, and gradual releases, with clear ownership for failures and source-maintenance responsibilities.
    flowchart TD
      A["Authenticate request"]
      B{"Access permitted?"}
      C["Retrieve current evidence"]
      D{"Evidence sufficient?"}
      E["Generate supported answer"]
      F["Verify claims"]
      G["Return result"]
      H["Deny access"]
      I["Clarify or abstain"]
      A --> B
      B -->|no| H
      B -->|yes| C
      C --> D
      D -->|no| I
      D -->|yes| E
      E --> F
      F --> G

    Trade-offs:

    • More retrieval and verification stages can improve reliability while increasing latency and the number of dependencies requiring monitoring.
    • Freshness and strict access controls must remain correct across ingestion, retrieval, memory, and caching rather than existing only at the interface.

    Example

    Consider an assistant answering internal policy questions.

    1. Index approved policy versions with department permissions.
    2. Retrieve only documents the employee may access.
    3. Preserve exceptions and source locations in the response.
    4. Escalate conflicting policies and monitor whether newly published changes become searchable within the agreed delay.
  19. Q99.How should you explain an AI project you personally worked on?

    Explain the user problem, your own responsibilities, and the evidence behind your decisions. A strong project discussion connects implementation choices to measurable outcomes and remaining limitations.

    1. Describe the task and constraints, including what success meant and why the chosen use of AI was appropriate for that problem.
    2. Explain the data, baseline, and architecture, clearly separating components you implemented from work owned by other people.
    3. Discuss one meaningful trade-off and the evaluation used to decide, including important failure cases rather than only the best aggregate result.
    4. Describe deployment, monitoring, and a problem you diagnosed after testing or release, using measurements you can substantiate.
    5. Close with the outcome and the next improvement you would prioritize, acknowledging uncertainty where evidence is incomplete.

    What the interviewer is listening for: clear ownership, sound technical judgment, credible measurement, and understanding of the complete system.

  20. Q100.How should you discuss a failed experiment or a disagreement about an AI design?

    Use a real situation to show how you reasoned, tested assumptions, and responded to evidence. The useful lesson matters more than presenting every decision as a success.

    1. State the context and the hypothesis or disagreement, explaining the practical constraint that made the decision important to the team or users.
    2. Describe your responsibility and the alternatives fairly, including what evidence was available and what remained uncertain at the time.
    3. Explain the experiment, error analysis, or stakeholder discussion you used to resolve uncertainty, with a clear criterion for deciding what to do.
    4. Describe the outcome honestly, including an unsuccessful result if relevant, and explain how it changed your subsequent approach.
    5. Identify the transferable lesson without blaming others or claiming improvements that were never measured.

    What the interviewer is listening for: intellectual honesty, constructive collaboration, disciplined experimentation, and willingness to revise an approach.