Technical job interviews for AI Engineer, Machine Learning Specialist, and Senior Data Scientist roles evaluate deep theoretical comprehension, mathematical rigor, coding ability, and real-world production engineering judgment. This comprehensive reference compiles 120+ rigorously categorized interview questions and expert answers to help university graduates and professionals ace their technical interviews.
Answer: Uninformed (blind) search algorithms (like BFS, DFS, and Uniform Cost Search) have no information about how close an unexpanded state is to the goal; they only know how to generate successor states and test if a state is the goal. Informed (heuristic) search algorithms (like Greedy Best-First and A*) use domain-specific heuristic evaluation functions ( h(n) ) to estimate the remaining cost to the goal, prioritizing promising paths and dramatically pruning node expansions.
Answer: In Tree Search, A* is optimal if the heuristic ( h(n) ) is admissible (it never overestimates the true cost to the goal: ( 0 le h(n) le h^*(n) )). In Graph Search (where states can be reached via multiple redundant paths), A* is optimal if the heuristic is consistent (monotonic), satisfying the triangle inequality: ( h(n) le c(n, a, n') + h(n') ). Consistency guarantees that f-scores along any path never decrease and that the first time a node is expanded, its path cost is provably optimal.
Answer: Standard Minimax explores ( O(b^m) ) nodes, where ( b ) is the branching factor and ( m ) is maximum game depth. Alpha-Beta maintains two values: ( alpha ) (highest score MAX is guaranteed) and ( eta ) (lowest score MIN is guaranteed). When ( alpha ge eta ), remaining branches are mathematically guaranteed to have zero influence on the root decision and are pruned. With optimal move ordering, Alpha-Beta cuts the effective branching factor from ( b ) to ( sqrt{b} ), reducing complexity to ( O(b^{m/2}) ) and doubling the effective search depth in the same compute budget.
Answer: The expected generalization error of any supervised model decomposes into: ( ext{Error} = ext{Bias}^2 + ext{Variance} + sigma^2 ). Bias is error introduced by simplistic assumptions (underfitting; model fails to capture true data relationships). Variance is sensitivity to random fluctuations in training data (overfitting; model memorizes sample noise). ( sigma^2 ) is irreducible environmental noise. Increasing model complexity decreases bias but increases variance; optimal machine learning engineering seeks the sweet spot that minimizes total error.
Answer: Ridge adds a penalty proportional to the sum of squared weights: ( lambda sum w_j^2 ). It shrinks all weights toward zero, stabilizing multicollinearity, but never drives weights to exact zero. Lasso adds a penalty proportional to the sum of absolute values: ( lambda sum |w_j| ). Due to the sharp diamond-shaped geometry of the L1 ball intersecting loss contours at axes, Lasso drives non-essential weights to exact zero, performing automatic feature selection and producing sparse interpretable models.
Answer: Logistic regression models the log-odds (logit): ( lnleft(rac{p}{1-p} ight) = mathbf{w}^T mathbf{x} + b ). Setting the decision boundary threshold at ( p = 0.5 ) means ( rac{p}{1-p} = 1 ), which leads to ( ln(1) = 0 ), resulting in the equation: ( mathbf{w}^T mathbf{x} + b = 0 ). This is the equation of a straight line, flat plane, or linear hyperplane. The decision boundary separating the two classes is strictly linear in feature space.
Answer: During backpropagation, the chain rule multiplies derivatives from output to early layers: ( prod_{l} mathbf{W}^{(l)} sigma'(z^{(l)}) ). In networks using Sigmoid or Tanh activations, the derivative is small (( sigma' le 0.25 )). Multiplying fractions across 20 layers causes the gradient to shrink exponentially toward zero, preventing early layers from updating. It is solved in modern AI using: 1) Non-saturating activations like ReLU / GELU whose derivative is 1.0 for positive inputs, 2) Residual Skip Connections (ResNet) that provide clean additive identity highways, 3) Batch / Layer Normalization, and 4) Smart initializations (He / Xavier).
Answer: Adam (Adaptive Moment Estimation) tracks two exponential moving averages: 1) The First Moment ( m_t ) (mean of past gradients, like Momentum) to accelerate in consistent directions: ( m_t = eta_1 m_{t-1} + (1-eta_1)g_t ), and 2) The Second Moment ( v_t ) (uncentered variance of squared gradients, like RMSprop) to scale learning rates per parameter: ( v_t = eta_2 v_{t-1} + (1-eta_2)g_t^2 ). After applying bias-correction factors for initialization bias (( hat{m}_t = rac{m_t}{1-eta_1^t} ), ( hat{v}_t = rac{v_t}{1-eta_2^t} )), it updates weights as: ( heta_{t+1} = heta_t - rac{eta}{sqrt{hat{v}_t} + epsilon} hat{m}_t ).
Answer: The attention equation is ( ext{Attention}(Q, K, V) = ext{softmax}left(rac{QK^T}{sqrt{d_k}} ight)V ). For high dimensional vectors ( d_k ) (e.g., 64 or 128), assuming components of ( Q ) and ( K ) are independent random variables with zero mean and unit variance, their dot product ( Q cdot K = sum_{i=1}^{d_k} q_i k_i ) has a mean of 0 and a large variance of ( d_k ). For large values, dot products grow massive, pushing the softmax function into regions with near-zero gradients. Dividing by ( sqrt{d_k} ) normalizes the variance back to 1.0, preserving healthy gradient flow.
Answer: Full fine-tuning updates all ( N ) billion parameters in the model, requiring enormous GPU memory to store optimizer states and gradients for every weight. LoRA freezes all original model parameters ( W_0 ) and injects low-rank trainable decomposition matrices: ( W = W_0 + rac{alpha}{r}(B imes A) ), where rank ( r ll d ). LoRA trains 99% fewer parameters, slashes VRAM requirements by over 70%, mitigates catastrophic forgetting, and enables zero-latency adapter merging at inference time.
Broaden your foundational and advanced AI knowledge across our curriculum:
Academic and viva-voce questions tailored for university computer science exams.
Scenario-based troubleshooting interview questions for ML and AI engineers.
Formulas, time complexities, and core definitions for rapid interview review.
Acing technical AI job interviews, portfolio preparation, and freelance bids.