AI & Machine Learning Topic

AI and ML Interview Practice: Real Problems, Trade-offs and Reliable Systems

Practise the idea, then explain it in your own words. These are learning questions, not a prediction of every job interview. A clear small example is better than a list of terms you cannot explain.

How to use this guide

Give a short answer, add a practical example and mention a limitation. Be honest about work experience and lab experience. Ask a clarifying question when the task is unclear.

1. What is the curse of dimensionality?

With many features, data can become sparse and some distance measures less useful. Models may need more data or stronger constraints. Not every extra feature is harmful, so investigate the task.

Example to discuss: Try feature selection or reduction inside validation. Do not choose features using the final test set.

2. What does PCA do?

PCA creates orthogonal directions that retain as much variance as possible for a chosen dimension count. Scaling changes the result. High variance is not automatically high usefulness for the target task.

Example to discuss: A two-dimensional plot can hide important structure. Report how much variance it retains.

3. Why use an ensemble?

Combining models can improve results when their useful behaviours and errors complement each other. The gain depends on the method and data. Ensembles can still overfit or cost too much.

Example to discuss: Compare with a simple baseline and measure serving latency as well as predictive quality.

4. How do generative and discriminative models differ?

A discriminative model focuses on predicting a target from inputs or learning a decision boundary. A generative model describes how data, sometimes with labels, can be produced. Not every generative model has the same probability formulation.

Example to discuss: Logistic regression is discriminative. A language model can generate text; that does not make every statement factual.

5. How does K-means work?

It alternates assigning points to nearby centres and updating centres. You choose the number of clusters. Scale, outliers, initialisation and group shape affect the result.

Example to discuss: A smooth elbow plot is not proof of one correct number of real-world groups.

6. What are vanishing and exploding gradients?

Gradients can become too small or too large as they pass through a network. Training may become slow or unstable. Architecture, initialisation, activations and optimisation settings all matter.

Example to discuss: Gradient clipping can help with exploding gradients. It does not repair every cause of poor learning.

7. What is batch normalisation?

It normalises selected activations using batch statistics during training and learns scale and shift. Evaluation commonly uses stored running statistics. Exact behaviour depends on the layer and framework.

Example to discuss: Very small or changing batches can affect behaviour. Remember the correct training or evaluation mode.

8. What is backpropagation?

It efficiently calculates gradients through the computation using the chain rule. An optimiser then uses those gradients to update parameters. These are related but separate steps.

Example to discuss: In a custom loop, forgetting to clear accumulated gradients can change the update.

9. Why do convolutional layers help with images?

They use local connections and shared filters, reducing parameters compared with a fully connected mapping of all pixels. This uses spatial structure.

Example to discuss: A CNN can still fail when images differ in lighting, scale or source. Evaluate realistic changes.

10. What are the limits of recurrent networks?

They carry state across ordered steps but can struggle with long dependencies and training stability. LSTMs and GRUs add gates to help. They do not provide perfect unlimited memory.

Example to discuss: A bidirectional model can use future context, which may be unsuitable for a live forecast.

11. What are embeddings?

They represent items as vectors for a chosen learning objective. Similarity can support search or other tasks. It is not a universal probability of shared meaning.

Example to discuss: Use compatible encoders for documents and queries, and test retrieval on your own questions.

12. What does attention do?

It combines information using learned relevance weights between representations. Query, key and value projections are common parts of the calculation. Attention weights alone are not a complete explanation of a decision.

Example to discuss: Inspect whether an answer is supported by evidence instead of treating a bright attention plot as proof.

13. How do transformers differ from RNNs?

Transformers use attention and positional information rather than a simple recurrent state update. They can process training positions in parallel in many setups. Inference cost and long-context behaviour still need measurement.

Example to discuss: A longer context window does not guarantee that every relevant fact will be used correctly.

14. What is BERT?

BERT is an encoder model trained using masked-language modelling, with a next-sentence task in the original setup. It uses context on both sides. It differs from a standard causal next-token generator.

Example to discuss: It can be adapted to classification or extraction. Use the right model architecture for the task.

15. When would you use an A/B test?

Use a controlled experiment to compare variants on a real outcome when it is appropriate and safe. Define assignment, success metrics, guardrails and analysis in advance.

Example to discuss: Check sample size, related users and stopping rules. A small early difference is not enough to declare a winner.

16. What is model drift?

Data drift is a change in input distribution. Concept drift is a change in the relationship between inputs and targets. Predictive quality can change, but input drift alone does not prove it did.

Example to discuss: Monitor data quality and suitable outcome metrics. Do not automatically retrain from an alert without reviewing the cause.

17. Which responsible-AI questions matter?

Ask who may be harmed, whose data is used and who is responsible for decisions. Review privacy, security, relevant group performance and appeal or human-review paths.

Example to discuss: A high overall score can hide a poor result for a smaller group. One fairness metric does not resolve every trade-off.

18. How do you handle class imbalance?

Consider class weights, thresholds or resampling, and evaluate the right errors. Fit any resampling only inside training folds. Synthetic rows do not create independent test evidence.

Example to discuss: Compare precision and recall under the actual class prevalence and review available inspection capacity.

19. How would you build a recommendation system?

Define the useful outcome and what data you may use. Start with popularity or a simple content-based baseline, then compare more complex methods. Include new users and new items in evaluation.

Example to discuss: Offline ranking metrics help, but useful recommendations also need coverage, appropriate content and feedback checks.

20. How would you approach time-series forecasting?

Inspect time order, missing periods, seasonality and what is available at forecast time. Start with a naive forecast such as the previous comparable period. Use time-respecting evaluation.

Example to discuss: Build rolling features from past values only. Percentage errors can misbehave when actual values are zero or near zero.

21. What is MLOps?

MLOps covers repeatable training, versioning, testing, delivery, monitoring and recovery for ML systems. Data and model behaviour add needs beyond a normal code release.

Example to discuss: Record code, data version, feature rules, model artifact and evaluation. A saved model file alone is not a release process.

22. How do you explain an individual prediction?

Use a method that fits the model and question. Explain what the method describes and what it cannot prove. Feature attributions describe model behaviour, not automatically real-world causes.

Example to discuss: Connect the explanation to a concrete example and an action a person can review.

Prepare one project you understand

Work through the flower classifier, evaluation example and local API. Explain where the data comes from, how you split it, what failed and what you would improve before release. For modern AI applications, also review RAG and the agent lessons.

Official references

Reviewed on 25 October 2026. Use documentation for your installed versions.

All AI & Machine Learning tutorials

Comments (0)

No comments yet. Be the first to comment!

LecturreAI Assistant

Hello! I'm LecturreAI

What would you like to learn today?