yoklainterview sim

ML Engineer Mid Interview Questions

503 verified ML Engineer Mid interview questions — solve with answers, learn from explanations, test yourself in a real simulation.

Try the real simulation →

Sample questions

Ml Data PreparationDifficulty 2
A dataset has one feature ranging roughly 0-1 and another ranging roughly 0-1,000,000. Left unaddressed before training a distance- or gradient-based model, what problem does this most likely cause?
  • aTraining fails due to missing values
  • bCategorical columns get encoded in the wrong order
  • cTest-set information leaks into training
  • dThe large-scale feature dominates the model
Explanation:When features live on very different numeric scales, the feature with the larger range tends to dominate distance calculations or gradient magnitudes, effectively drowning out the smaller-scale feature's signal. This is a core motivation for scaling features to comparable ranges before training such models.
Ml Data PreparationDifficulty 2
A dataset has a 'city' column with values like Istanbul, Ankara, Izmir. A junior engineer maps these to integers alphabetically (Ankara=0, Istanbul=1, Izmir=2) and feeds them directly into a model that treats numeric inputs as ordered/continuous. What is the main risk?
  • aThe model may infer a false order between cities
  • bThe model auto-detects that the encoding is unordered
  • cThe category count shrinks after mapping
  • dText columns can never be encoded for any model
Explanation:Assigning arbitrary ordered integers to unordered categories introduces a false sense of magnitude and order (e.g., implying Izmir is 'twice' Ankara), which can mislead models that treat the input as ordered/continuous. Encoding choices need to respect whether a categorical variable actually has an inherent order.
Ml Data PreparationDifficulty 2
A junior engineer computes the scaling parameters (e.g., min/max or mean/variance) for a feature using the entire dataset, then splits the data into train and test afterward. What is the problem with this order of operations?
  • aScaling parameters computed this way are always wrong
  • bTest-set statistics leak into the training scaling
  • cCategorical columns become impossible to encode
  • dThe training set always ends up smaller than intended
Explanation:Fitting any data-derived statistic (scaling parameters, imputation values, encodings) on the full dataset before splitting lets test-set information influence what the model sees during training — a classic form of data leakage. The fix is to fit such transformations only on the training split, then apply them to validation/test.
Ml Data PreparationDifficulty 3
A model predicting whether a loan will default includes a feature called 'days_since_last_payment_before_default', which is only populated (non-null) for loans that actually defaulted and is computed from records logged after the default event. What is the main issue with using this feature?
  • aIt has too many missing values to be useful
  • bIt is a categorical feature disguised as numeric
  • cIt needs to be scaled with the other features
  • dIt is target leakage — only known after the outcome
Explanation:A feature that is only populated because the target outcome already happened (and derived from post-outcome records) is a textbook case of target leakage: the model would learn to rely on information that does not exist at the moment a real prediction is needed, producing unrealistically strong offline metrics that collapse in production.
Ml Data PreparationDifficulty 2
A dataset is randomly split into train and test, but it turns out roughly 8% of rows are exact duplicates of other rows in the dataset, some of which ended up on both sides of the split. What is the main risk this creates?
  • aTraining becomes much faster because of duplicates
  • bThe test set becomes perfectly stratified automatically
  • cThe model gets evaluated on memorized rows
  • dDuplicated rows must be categorical, not numeric
Explanation:When duplicate (or near-duplicate) records exist on both sides of a split, the model can be evaluated on data it has essentially already seen, which inflates test metrics and gives a false sense of how well the model generalizes to genuinely new data. Deduplicating before splitting is a standard precaution.
Ml Data PreparationDifficulty 2
Which of the following best summarizes what 'data leakage' means in a machine learning workflow?
  • aUnavailable-at-prediction-time info skews training
  • bPredictions being served slower than expected
  • cA dataset exceeding its storage system's capacity
  • dA feature's distribution shifting slightly between runs
Explanation:Data leakage broadly covers any situation where information that would be unavailable at genuine prediction time (future data, target-derived signals, test-set statistics, duplicated records) leaks into training or evaluation, producing overly optimistic and unreliable metrics.

Test yourself against the 600-question ML Engineer bank.

Start interview