Advanced Artificial Intelligence interview questions

125 questions with answers (AIE-301 to AIE-425). Try each one aloud before reading the answer.

Math & Statistics for ML

AIE-301 · An A/B test shows the new model lifts conversion from 4.0% to 4.3% with 20,000 users per arm. Is that significant?

Pooled p ≈ 4.15%, standard error ≈ √(0.0415 × 0.9585 × 2/20,000) ≈ 0.0020, so z ≈ 0.003/0.0020 ≈ 1.5 and two-sided p ≈ 0.13: not significant at 5%. Detecting a lift this small with 80% power needs about (2.8/1.5)² ≈ 3.5 times as many users per arm, with the sample size fixed before the test starts.

AIE-302 · Training loss oscillates wildly and diverges. How do you diagnose it mathematically?

Divergence usually means the step size exceeds what the loss curvature allows (η > 2/λmax for the largest Hessian eigenvalue in a quadratic model). Lower the learning rate, add warmup and gradient clipping, normalise inputs and check for bad data or numerical overflow.

AIE-303 · How would you estimate prediction uncertainty for a regression model?

Use quantile regression or prediction intervals from bootstrap ensembles, Bayesian methods (MC dropout, deep ensembles), or conformal prediction, which gives intervals with guaranteed coverage under exchangeability. Validate interval coverage on held-out data.

AIE-304 · How does conformal prediction provide coverage guarantees?

On a calibration set, compute nonconformity scores (e.g. absolute residuals), take the appropriate quantile, and form prediction sets or intervals for new points using it. If data are exchangeable, the sets contain the true value with the chosen probability (e.g. 90%), regardless of the model.

AIE-305 · Why can multiple-comparison problems mislead model selection, and how do you correct for them?

Testing many models or hyperparameters on the same validation set makes some look good by chance. Use a held-out test set touched once, nested CV, Bonferroni or false-discovery-rate corrections for statistical tests, and pre-registered evaluation plans.

AIE-306 · How do you choose between Bayesian optimisation and random search for hyperparameter tuning?

Random search is simple, parallel and good with many unimportant hyperparameters; Bayesian optimisation models the objective (e.g. Gaussian process or TPE) to choose promising points, using fewer evaluations when each training run is expensive. Hyperband adds early stopping of poor runs.

AIE-307 · How would you test whether a model's improvement is real when the test set is small?

Use paired comparisons on the same examples: bootstrap confidence intervals of the score difference or McNemar's test for classification. Report intervals rather than single point estimates.

AIE-308 · How does matrix factorisation work in recommender systems?

The user-item rating matrix R is approximated as UVᵀ with low-rank user and item factor matrices learned by minimising error on observed entries plus regularisation (via ALS or SGD). Predicted preferences are dot products of user and item vectors.

AIE-309 · How do you detect that a model's errors are not independent and identically distributed?

Check residuals for autocorrelation over time, clustering by groups (stores, users), and heteroscedasticity. Non-i.i.d. errors call for grouped or time-based validation and models that include those effects.

AIE-310 · How would you design a sample size for collecting labels to evaluate a classifier with ±2% precision?

For a proportion p, margin of error ≈ 1.96√(p(1 − p)/n). Using p = 0.5 for the worst case, n ≈ (1.96/0.02)² × 0.25 ≈ 2,400 labelled examples, adjusted for stratification and expected class balance.

AIE-311 · How do causal inference methods differ from predictive modelling?

Prediction finds correlations useful for forecasting; causal inference estimates effects of interventions, needing randomised experiments or methods such as propensity scores, difference-in-differences, instrumental variables and causal graphs to handle confounding.

Classical Machine Learning

AIE-312 · A gradient boosting model overfits a 5,000-row tabular dataset. What would you change?

Lower the learning rate and use early stopping, reduce tree depth and number of leaves, increase minimum samples per leaf, add L1/L2 regularisation, use row and column subsampling, and tune with cross-validation.

AIE-313 · How would you choose between logistic regression and gradient boosting for a credit scoring model?

Logistic regression is interpretable, stable and easy to justify to regulators; gradient boosting usually gives higher accuracy on non-linear interactions. Compare performance, then use explainability tools, monotonic constraints and documentation if boosting is chosen.

AIE-314 · How do you build a recommender system for an e-commerce site with cold-start problems?

Combine collaborative filtering for users and items with history with content-based features (item attributes, text embeddings) and popularity or context-based recommendations for new users and items, then rerank with business rules.

AIE-315 · How would you detect fraud when labelled fraud cases are rare?

Combine supervised models trained with class weighting on known fraud, unsupervised anomaly detection (isolation forest, autoencoders) for new patterns, rule-based checks and human review feedback loops, measuring precision at the review capacity.

AIE-316 · How would you design a churn prediction model that the business can act on?

Define churn precisely and a prediction horizon, build features from usage, billing and support history available before the prediction date, train with time-based validation, and output calibrated probabilities. Pair predictions with uplift or reason codes so retention teams target customers who can be saved, not just those likely to leave.

AIE-317 · How do you handle a regression target with a heavy right tail, such as house prices or claim costs?

Model the log of the target (and correct the back-transformation bias), use losses robust to outliers (Huber, quantile loss), or Tweedie/gamma regression for costs with many zeros. Evaluate with metrics on the original scale that the business uses.

AIE-318 · How would you segment customers with unsupervised learning?

Choose behaviourally meaningful features, scale them, reduce dimensionality if needed, try k-means, Gaussian mixtures or hierarchical clustering, pick the number of segments with silhouette scores and business interpretability, and validate segments' stability over time.

AIE-319 · How do you make a tree ensemble respect known business rules, such as price always lowering demand?

Use monotonic constraints available in XGBoost and LightGBM so predictions can only move in one direction with a feature, and check with partial dependence plots.

AIE-320 · How would you build a model to rank search results?

Use learning-to-rank approaches (pairwise like LambdaMART or listwise) with query-document features and click or relevance labels, correct for position bias in clicks, and evaluate with NDCG or MRR.

AIE-321 · When would you choose a simple model over a complex one with slightly better accuracy?

When interpretability, latency, stability, maintenance cost, data size or regulatory requirements matter more than a small metric gain, or when the gain isn't statistically significant.

AIE-322 · How would you detect label noise in a training set?

Find examples where cross-validated models confidently disagree with the label (confident learning), check annotator agreement, review high-loss examples, and relabel or weight suspicious samples.

Model Evaluation & Validation

AIE-323 · A model scores 0.95 AUC offline but performs poorly in production. What would you investigate?

Look for leakage (features unavailable at prediction time), training-serving skew in feature computation, distribution shift between training data and live traffic, wrong evaluation splits (random instead of time-based), and differences in how predictions are used versus how they were evaluated.

AIE-324 · How do you choose an evaluation metric aligned with business value?

Map outcomes to costs and benefits (e.g. cost of a missed fraud vs. a false alarm), choose metrics or a cost-weighted function that reflects them, and set thresholds by optimising expected value at operational capacity.

AIE-325 · How would you evaluate a model on subgroups to find hidden failures?

Slice performance by demographics, regions, devices, data sources and rare classes, look for slices with significantly worse metrics, and add targeted data or modelling fixes for them.

AIE-326 · How do you evaluate a forecasting model fairly?

Use rolling-origin backtesting across multiple periods, compare against naive and seasonal-naive baselines, use scale-independent metrics (MASE, sMAPE) or business-weighted errors, and check prediction intervals' coverage.

AIE-327 · How do you validate a model when train and test distributions differ by design (e.g. a new country)?

Use domain-specific validation data, adversarial validation to measure shift, importance weighting, and evaluate on a small labelled sample from the new domain before launch.

AIE-328 · What is adversarial validation?

Train a classifier to distinguish training rows from test rows; if it succeeds, distributions differ, and the most important features show which variables shift. Use the result to fix features or choose a validation set that resembles the test.

AIE-329 · How do you evaluate a recommendation system offline and online?

Offline use ranking metrics (precision@k, recall@k, NDCG) on held-out interactions with time-based splits; online run A/B tests on engagement, conversion and long-term retention, because offline metrics don't fully predict user behaviour.

AIE-330 · How do you evaluate an LLM-based chatbot?

Combine automatic metrics on curated test sets (task success, factual accuracy, refusal correctness), LLM-as-judge with human calibration, red-teaming for safety, and online metrics such as resolution rate and user satisfaction.

AIE-331 · How would you estimate the business impact of a model before an A/B test?

Simulate decisions on historical data: apply the model's threshold policy, count outcomes (prevented fraud, extra conversions, review workload), value them with business costs, and compare with the current policy. Treat this as an estimate, since behaviour may change once the model acts.

AIE-332 · How do you test a model's robustness?

Evaluate on perturbed inputs (noise, typos, image corruptions), out-of-distribution samples, edge cases and stress scenarios, plus invariance tests (predictions shouldn't change with irrelevant features) and directional tests (they should change in expected ways).

AIE-333 · How do you decide when to retrain a production model?

Retrain on a schedule matched to how quickly data changes, or when monitoring shows drift beyond thresholds or performance drops, validating the new model against the current one before promotion.

Feature Engineering & Data Preparation

AIE-334 · How would you build features for a fraud model from transaction streams?

Create velocity features (transactions per card in the last minute, hour and day), deviation from the customer's usual amounts, merchants and locations, device and IP reuse across accounts, and graph features linking cards, devices and merchants. Compute them point-in-time to avoid leakage.

AIE-335 · How do you build point-in-time correct training data?

For each training example, compute features using only data available at that example's prediction timestamp (as-of joins), and record feature values as they were, not as later updated, so training matches serving.

AIE-336 · How would you handle a categorical feature with thousands of rare levels for a neural network?

Use learned embeddings sized roughly by cardinality, group rare levels into an "other" bucket below a frequency threshold, and use hashing for unseen values at inference.

AIE-337 · How do you engineer features for a geospatial problem such as delivery time prediction?

Use distances (haversine and road network), travel times from routing APIs, area-level aggregates (density, historical delays), geohash or H3 cells, time-of-day traffic patterns and weather.

AIE-338 · How do you clean noisy labels from crowdsourcing?

Collect multiple labels per item, aggregate with majority vote or probabilistic models (Dawid-Skene) that estimate annotator reliability, use gold-standard questions to filter poor annotators, and review disagreements.

AIE-339 · How would you prepare data for a model when 30% of a key feature is missing?

Analyse why it is missing (random or informative), add a missing indicator, impute using models trained on other features or use algorithms that handle missing values natively (gradient boosting), and check performance against dropping the feature.

AIE-340 · How do you design an active learning loop to reduce labelling cost?

Train on a small labelled set, score unlabelled data, select samples with high uncertainty or diversity for labelling, retrain and repeat, monitoring performance gains per labelled batch.

AIE-341 · How do you build a feature pipeline that works both in batch and real time?

Define features once (in a feature store or shared library), compute batch features for training and backfills, compute streaming features with the same logic for online serving, and test consistency between both paths.

AIE-342 · How do you detect and handle duplicate or near-duplicate records in training data?

Use exact hashing and near-duplicate detection (MinHash, embeddings), remove duplicates within the training set, and ensure duplicates don't straddle train and test splits, which inflates scores.

AIE-343 · How would you create synthetic tabular data while protecting privacy?

Use generative models (CTGAN, Gaussian copulas) or differential privacy mechanisms, then check utility (model performance trained on synthetic vs real) and privacy (membership inference tests, nearest-neighbour distance).

AIE-344 · How do you select features for a model with 10,000 candidate features and 5,000 rows?

Use strong regularisation (L1, elastic net), stability selection, tree-based importance with cross-validation, and domain knowledge, keeping selection inside the CV loop to avoid overfitting.

Deep Learning Fundamentals

AIE-345 · Training a deep network on a GPU runs out of memory. What can you do?

Reduce batch size with gradient accumulation, use mixed precision (FP16/BF16), gradient checkpointing, smaller models or sequence lengths, efficient attention kernels, and distributed training approaches such as model sharding (FSDP/ZeRO).

AIE-346 · A network's training loss doesn't decrease at all. How do you debug it?

First overfit a tiny batch (a few examples): if that fails, there's a bug. Check data and labels are aligned, the loss matches the output (logits vs probabilities), gradients are non-zero and finite, the learning rate is sensible, inputs are normalised and layers aren't frozen accidentally.

AIE-347 · How do you choose batch size and learning rate together?

Larger batches give smoother gradients and better hardware use; the learning rate is often scaled roughly linearly with batch size plus warmup. Very large batches can generalise worse, so tune both on validation performance and throughput.

AIE-348 · How does mixed-precision training speed up training without losing accuracy?

It computes most operations in FP16 or BF16 on tensor cores while keeping a master copy of weights in FP32; loss scaling (for FP16) prevents small gradients from underflowing. BF16 has FP32's range, so it usually needs no scaling.

AIE-349 · How would you train a model on data from multiple GPUs efficiently?

Use data parallelism (DDP) when the model fits on one GPU, synchronising gradients with all-reduce; use model, tensor or pipeline parallelism and sharded optimisers (FSDP, ZeRO) for very large models. Overlap communication with computation.

AIE-350 · How do you design a neural network for tabular data, and when is it worth it?

Use embeddings for categorical features, normalised numeric features, MLPs with dropout and batch norm, or architectures like TabNet or FT-Transformer. Gradient boosting usually wins on small to medium tabular data; neural nets help with very large data or mixed modalities.

AIE-351 · How do you handle gradient explosion in a deep network?

Use gradient clipping, appropriate initialisation, normalisation layers, lower learning rates or warmup, and residual connections; check for numerical instability like log of zero.

AIE-352 · How does label smoothing help classification?

Replacing one-hot targets with slightly softened distributions (e.g. 0.9 for the true class) prevents over-confident logits, improves calibration and often generalisation.

AIE-353 · How would you make a deep model reproducible across runs?

Fix seeds for all libraries, use deterministic algorithms where possible, log library and hardware versions, and accept that some GPU operations remain non-deterministic; compare results over multiple seeds.

AIE-354 · How do you choose the capacity of a network for a dataset?

Start with a known architecture for similar tasks, scale up until training loss is low, then regularise to control overfitting; use learning curves to see whether more data or capacity would help.

AIE-355 · How do you prune a neural network?

Remove weights or structures (channels, heads) with low importance by magnitude or sensitivity, then fine-tune to recover accuracy. Structured pruning gives real speed-ups on hardware.

CNNs & Computer Vision

AIE-356 · You have 2,000 labelled images of manufacturing defects. How would you build a classifier?

Use a pretrained backbone with transfer learning, strong but realistic augmentation, class weighting for rare defects, and stratified validation. Inspect errors and Grad-CAM maps to ensure it looks at defects, not background artefacts, and consider anomaly detection if defects are very rare.

AIE-357 · How do you improve detection of small objects?

Use higher input resolution, feature pyramid networks, smaller anchor sizes or anchor-free detectors, tiling large images, and augmentation that preserves small objects.

AIE-358 · How would you deploy a vision model on an edge camera with limited compute?

Choose an efficient architecture (MobileNet, EfficientNet-Lite, YOLO nano), quantise to INT8 with calibration, use hardware accelerators (NPU), reduce input resolution and measure latency and accuracy on the device.

AIE-359 · How do you handle domain shift when a vision model trained on daytime images fails at night?

Collect and label night images, use augmentation simulating lighting changes, domain adaptation techniques, and evaluate per-condition performance.

AIE-360 · How do you validate that a medical imaging model generalises across hospitals?

Test on external datasets from different hospitals, scanners and populations, report performance per site, and check calibration and subgroup performance.

AIE-361 · How would you build a visual search system ("find similar products")?

Train or fine-tune an embedding model with metric learning (contrastive or triplet loss, or use CLIP), embed the catalogue, index vectors with approximate nearest-neighbour search (FAISS, HNSW), and evaluate retrieval with recall@k on labelled similar pairs.

AIE-362 · How do you handle class imbalance in object detection?

Use focal loss to down-weight easy negatives, oversample images with rare classes, adjust per-class thresholds, and evaluate per-class AP rather than overall mAP alone.

AIE-363 · How would you label images efficiently for a segmentation project?

Use model-assisted labelling (pre-annotations from a pretrained model such as SAM corrected by annotators), clear guidelines, quality checks with overlap reviews, and active learning to prioritise informative images.

AIE-364 · How do you choose between a CNN and a Vision Transformer for a project?

CNNs have strong inductive biases and work well with smaller datasets and edge deployment; ViTs scale better with large data and pretraining and capture global context. Hybrid models and pretrained checkpoints often decide in practice.

AIE-365 · How would you detect if a vision model relies on spurious features?

Inspect saliency or Grad-CAM maps, test on counterfactual images (background swaps), evaluate on data where the spurious correlation is broken, and slice performance by context.

RNNs & Sequence Models

AIE-366 · How would you build a demand forecasting system for 10,000 products?

Use a global model (gradient boosting or a deep model like DeepAR or TFT) trained across all series with product, store, calendar, price and promotion features, rather than 10,000 separate models. Handle intermittent demand, backtest by period and produce probabilistic forecasts for inventory decisions.

AIE-367 · How do you choose between classical time-series models and deep learning?

ARIMA and exponential smoothing work well for few series with stable patterns and are interpretable; gradient boosting with lag features is strong for many series; deep models help with many related series, complex covariates and long histories.

AIE-368 · How would you build a speech recognition pipeline?

Convert audio to log-mel spectrograms, use a model trained with CTC or sequence-to-sequence attention (or a pretrained model like Whisper), add language models for decoding, and evaluate word error rate on the target accents and noise conditions.

AIE-369 · How do you detect anomalies in multivariate sensor data from machines?

Learn normal behaviour with autoencoders, forecasting models or isolation forests on windows of signals, set thresholds from validation data, and handle operating modes so normal changes aren't flagged.

AIE-370 · Why have transformers replaced RNNs in most NLP tasks?

Transformers process sequences in parallel (faster training on GPUs), capture long-range dependencies directly through attention, and scale with data and parameters; RNNs remain useful for streaming and low-resource settings.

AIE-371 · How would you build a named entity recognition model for a new domain?

Annotate domain data with clear entity guidelines, fine-tune a pretrained transformer for token classification, handle subword alignment of labels, and evaluate entity-level F1.

AIE-372 · How do you handle irregular sampling and missing timestamps in time-series data?

Resample to a regular grid where the process allows, interpolating short gaps and marking longer gaps rather than filling them, add time-since-last-observation and missing-indicator features, or use models built for irregular series (e.g. continuous-time or attention-based models). Never interpolate across the train/test boundary.

AIE-373 · How would you include holidays and promotions in a forecasting model?

Add event indicator features with lead and lag windows (demand often rises before and dips after), event type and intensity (discount depth), and interactions with product or store. Because each event is rare, pool information across series in a global model or use hierarchical models.

AIE-374 · How do you evaluate a probabilistic forecast rather than a single point forecast?

Use pinball (quantile) loss for each quantile, CRPS for the whole predictive distribution, and check interval coverage (does the 90% interval contain about 90% of outcomes?). Ultimately judge by the business cost of over- and under-stocking that the forecast drives.

AIE-375 · How would you serve a sequence model on a real-time data stream?

Maintain per-entity state (hidden states or rolling windows) in a fast store, update features incrementally as events arrive, run inference within a stream processor or low-latency service, and handle late or out-of-order events. Test that online features match the offline features used in training.

Transformers & NLP

AIE-376 · How would you build a document classification system for 50 categories with 20,000 labelled documents?

Start with a TF-IDF plus linear model baseline, then fine-tune a pretrained transformer (truncating or chunking long documents and pooling chunk predictions), handle class imbalance, and evaluate macro-F1 per category. Use the baseline to judge whether the transformer's cost is justified.

AIE-377 · How do you adapt a general language model to a specialised domain such as legal or medical text?

Continue pretraining on unlabelled domain text (domain-adaptive pretraining), then fine-tune on labelled tasks; extend the tokenizer if domain terms split badly, and evaluate on domain benchmarks against general models.

AIE-378 · How do you serve a transformer model with low latency at scale?

Use optimised runtimes (TensorRT, ONNX Runtime, vLLM for LLMs), quantisation, dynamic batching, KV caching, efficient attention kernels, and autoscaling on GPUs, while monitoring p95 latency and throughput.

AIE-379 · How would you build a multilingual NLP system with limited labelled data in some languages?

Use multilingual pretrained models (XLM-R, mT5), fine-tune on high-resource language data for zero-shot cross-lingual transfer, add translated or small native labelled sets, and evaluate per language.

AIE-380 · How do you extend a transformer's context length?

Use position schemes that extrapolate (RoPE scaling, ALiBi), continue training on longer sequences, efficient attention (FlashAttention, sparse attention), and evaluate long-context retrieval with needle-in-a-haystack style tests.

AIE-381 · How do you evaluate a summarisation model?

Use ROUGE and BERTScore as rough indicators, check factual consistency with entailment-based or QA-based metrics, and run human evaluation of faithfulness, coverage and readability.

AIE-382 · How would you build a question answering system over company documents?

Use RAG: chunk and embed documents, hybrid retrieval with reranking, an LLM prompted to answer only from retrieved passages with citations, access control on documents, and an evaluation set of real questions.

AIE-383 · How do you reduce the size of a transformer model for production?

Distil into a smaller student, quantise to INT8 or 4-bit, prune attention heads, and choose smaller architectures; compare accuracy versus latency trade-offs.

AIE-384 · How do you detect toxic or unsafe text?

Use classifiers fine-tuned on moderation datasets, LLM-based moderation with clear policies, multilingual coverage and human review for edge cases, measuring false positives and negatives by category.

AIE-385 · How would you build an information extraction pipeline from invoices?

Use OCR plus layout-aware models (LayoutLM, Donut) or LLMs with structured output, validate fields with rules (totals, dates), and route low-confidence cases to human review.

LLMs, Prompting, RAG & Agents

AIE-386 · A RAG chatbot gives wrong answers even though the right document exists. How do you debug it?

Check retrieval first: is the right chunk in the top-k results? If not, fix chunking, embeddings, hybrid search or reranking. If retrieval is right, check the prompt (instructions to use context), context length (relevant chunk buried among irrelevant ones) and the model's faithfulness.

AIE-387 · How would you design guardrails for an LLM customer-support assistant?

Restrict scope in the system prompt, use input and output filters for unsafe content and PII, ground answers in approved knowledge, require confirmation or human handoff for high-impact actions, log interactions and monitor for failures.

AIE-388 · How do you choose between a large API model and a smaller self-hosted model?

Compare task quality on your evaluation set, latency, cost per request at expected volume, data privacy and residency requirements, customisation needs and operational capacity; often a small fine-tuned model handles routine tasks and a large model handles hard cases.

AIE-389 · How would you build an agent that books meetings using calendar APIs?

Give the LLM well-defined tools with strict schemas (find free slots, create event), validate arguments, require user confirmation before creating events, handle errors and time zones, and limit permissions to the user's calendar.

AIE-390 · How do you fine-tune an LLM to follow a company's response style?

Collect a few hundred to thousands of high-quality example conversations, fine-tune with LoRA or full fine-tuning, evaluate against a held-out set and baseline prompting, and check that safety behaviour is preserved.

AIE-391 · How would you build an evaluation suite for an LLM application before each release?

Collect representative and edge-case prompts with expected behaviours, define automatic checks (exact match, schema validity, groundedness, refusal correctness) plus LLM-as-judge scores calibrated against human labels, track results per release, and block releases that regress on critical cases.

AIE-392 · How do you reduce the cost of an LLM feature that has become too expensive?

Shorten prompts and retrieved context, cache frequent responses and prompt prefixes, route easy requests to smaller models, batch requests, constrain output length and fine-tune a smaller model on outputs of the large one where quality allows.

AIE-393 · How would you handle personal data in prompts sent to a third-party LLM API?

Minimise and redact PII before sending, check the provider's data retention and training policies and contracts, use regional endpoints or self-hosted models for sensitive data, and log access in line with privacy regulations.

AIE-394 · How do you design a multi-agent workflow, and when is it worth it?

Split a complex task into roles (planner, researcher, coder, reviewer) with clear tool access and hand-offs, and add a supervisor or fixed workflow to control loops. It helps for long tasks with distinct skills, but adds cost, latency and failure points, so start with a single agent and add structure only when needed.

AIE-395 · How do you make LLM outputs reliably machine-readable?

Use structured output or JSON-schema modes, function calling, constrained decoding, validate the output against the schema and retry or repair on failure, and keep schemas simple.

Generative Models (GANs, VAEs, Diffusion)

AIE-396 · How would you fine-tune a diffusion model to generate images of a specific product?

Use DreamBooth or LoRA fine-tuning on a small set (often 10–30) of varied, high-quality product images with a unique identifier token, add prior-preservation images to avoid overfitting, and evaluate on prompts in new contexts.

AIE-397 · How do you evaluate whether a generative model memorises training data?

Search for near-duplicates of generated samples in training data (embedding similarity), run membership inference tests, and test prompts designed to extract training examples. Deduplicating training data reduces memorisation.

AIE-398 · How would you use a GAN or diffusion model for data augmentation in a medical imaging task?

Generate synthetic examples for rare classes, have experts review realism, train with a mix of real and synthetic data, and validate only on real held-out data to confirm improvement without introducing artefacts.

AIE-399 · How do you control the output of a text-to-image model?

Use prompt engineering, negative prompts, guidance scale, ControlNet conditioning on edges, poses or depth maps, inpainting and image-to-image with controlled strength.

AIE-400 · How do you detect AI-generated images?

Use trained classifiers, provenance standards such as C2PA content credentials, watermarking embedded at generation, and forensic analysis; no detector is fully reliable, especially after edits.

AIE-401 · How would you build an anomaly detector using a VAE?

Train the VAE on normal data, use reconstruction error or likelihood of new samples as an anomaly score, set thresholds on validation data, and monitor for drift in normal patterns.

AIE-402 · How do you reduce the inference cost of a diffusion model in production?

Use fewer sampling steps with better samplers, distilled models, lower resolution with upscaling, quantisation and batching, and cache common outputs.

AIE-403 · How do you address copyright and consent concerns in generative AI products?

Use licensed or permitted training data, honour opt-outs, filter outputs that replicate protected content, provide provenance and clear terms, and follow emerging regulations.

AIE-404 · How would you generate synthetic time series for testing?

Use statistical models, GANs (TimeGAN) or diffusion models trained on real series, and validate that synthetic data matches key statistics and downstream model performance.

AIE-405 · How do you evaluate a text generation model's diversity and quality together?

Measure quality with human ratings or reference metrics, and diversity with distinct-n, self-BLEU or embedding spread; balance with sampling parameters.

Reinforcement Learning

AIE-406 · An RL agent finds a way to score high reward without doing the intended task. What happened and how do you fix it?

This is reward hacking: the reward function didn't fully capture the goal, so the agent exploited a loophole. Redesign the reward (penalise the shortcut, add constraints), use demonstrations or preference-based rewards, and test policies on behavioural checks, not just reward.

AIE-407 · How would you apply RL to optimise warehouse robot routing?

Model the warehouse as a simulator with states (robot positions, orders), actions (moves, assignments) and rewards (throughput, delays, collisions), train in simulation with domain randomisation, compare against heuristic baselines, and deploy gradually with safety constraints.

AIE-408 · How do you evaluate an RL policy before deploying it to a real system?

Test in high-fidelity simulation across scenarios, use off-policy evaluation on logged data (importance sampling, doubly robust estimators), run shadow mode alongside the existing controller, and deploy with safety fallbacks and limits.

AIE-409 · What is offline RL and why is it hard?

Learning a policy only from a fixed dataset of past interactions, with no further exploration. Policies may choose actions poorly covered in the data, where value estimates are wrong; methods like CQL constrain the policy to stay near the data.

AIE-410 · How would you use bandits instead of full RL for a recommendation problem?

When actions don't affect future states much, contextual bandits (e.g. LinUCB, Thompson sampling) choose recommendations based on context, balancing exploration and exploitation with less complexity and data than full RL.

AIE-411 · How do you make RL training more stable?

Normalise observations and rewards, use stable algorithms (PPO, SAC), tune learning rates and entropy bonuses, use multiple seeds, and monitor value loss and policy entropy.

AIE-412 · How would you train a robot to grasp objects with RL?

Train in simulation with domain randomisation, use shaped or sparse rewards with hindsight experience replay, combine with demonstrations, and fine-tune on real hardware with safety limits.

AIE-413 · How does RLHF differ from standard RL?

The reward comes from a learned model of human preferences instead of the environment, and a KL penalty keeps the policy close to the original model to avoid reward hacking and loss of language quality.

AIE-414 · How do you handle safety constraints in RL?

Use constrained RL (Lagrangian methods), safe exploration, shielding with rule-based safety layers, and limit actions in deployment.

AIE-415 · How would you apply multi-agent RL in traffic signal control?

Model each intersection as an agent sharing information with neighbours, train cooperatively for overall traffic flow, and test in traffic simulators before deployment.

MLOps, Deployment & Responsible AI

AIE-416 · How would you design an ML platform for a team of 30 data scientists?

Provide shared data access with governance, managed notebooks and compute, experiment tracking, a feature store, CI/CD pipelines for training and deployment, a model registry, standardised serving infrastructure and monitoring, with templates to reduce duplicated work.

AIE-417 · A model's performance degrades gradually in production. How do you respond?

Confirm with monitoring which metrics and segments are affected, check for data pipeline changes, drift in features or labels and upstream system changes, retrain with recent data if drift is confirmed, and add alerts and automated retraining triggers.

AIE-418 · How would you set up CI/CD for ML models?

Automate data validation, unit tests for feature code, training, evaluation against baselines and fairness checks, packaging, staging deployment and canary rollout, with approvals and rollback.

AIE-419 · How do you comply with regulations like the EU AI Act for a high-risk AI system?

Classify the system's risk level, implement risk management, data governance, documentation, logging, transparency, human oversight, accuracy and robustness requirements, and conduct conformity assessment before deployment.

AIE-420 · How would you mitigate bias found in a hiring model?

Investigate data and features causing bias, remove proxies, rebalance or reweight training data, apply fairness constraints or post-processing, and validate with fairness metrics and legal review; consider whether automation is appropriate at all.

AIE-421 · How would you deploy a neural network inside a mobile app?

Convert the model to an on-device format (TensorFlow Lite, Core ML or ONNX), quantise it (INT8 or FP16) and use the phone's NPU or GPU delegates, then measure latency, memory, battery drain and accuracy on a range of real devices. Ship model updates separately from app updates where possible and keep a server fallback for unsupported phones.

AIE-422 · What would you put on a monitoring dashboard for production models?

Input data quality (missing values, schema errors), feature drift scores, prediction distribution and confidence, latency and error rates, throughput, business KPIs linked to the model, and true performance metrics once labels arrive, all broken down by key segments with alert thresholds.

AIE-423 · How do you manage model versions and roll back a bad release?

Register every model with its training data version, code commit, metrics and approval status; deploy through controlled traffic routing (canary or blue-green), keep the previous version warm, and roll back automatically or with one action when monitoring detects regressions.

AIE-424 · How do you defend a deployed ML model against adversarial inputs and data poisoning?

Validate and track provenance of training data, detect outliers and suspicious label patterns before training, use robust training (including adversarial training for high-risk vision systems), monitor inputs for anomalies, rate-limit and authenticate the prediction API, and avoid exposing confidence scores or internals unnecessarily.

AIE-425 · How do you estimate and reduce the carbon footprint of training a model?

Energy ≈ GPU count × hours × average power × data-centre PUE; emissions = energy × grid carbon intensity of the region. Reduce it with efficient architectures, mixed precision, fewer wasted hyperparameter runs, reuse of pretrained models, and training in low-carbon regions or hours.

Other levels: Basic · Intermediate · Tricky · All Artificial Intelligence questions