← Meta Interview Insights

Meta·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

Meta SWE screen that was basically a rapid-fire ML concepts quiz. Five questions, all conceptual, no coding. Felt more like a written exam than a conversation.

Questions Asked (5)

Q1

For a binary classification problem, define TP, FP, TN, and FN, then write out the formulas for accuracy, precision, recall, and F1. Also explain in plain English what precision and recall actually measure.

Technical Trade-offsProduct Analytics & Metrics
Author's notes

I know this cold so I wasn't worried, but I always trip myself up on whether F1 is optional or expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining the confusion matrix terms (TP, FP, TN, FN) with a concrete example, then present the formulas in a logical order, and finally explain precision and recall in plain English using an analogy. Emphasize the trade-off between precision and recall and how F1 balances them.

Pro tip: Use a real-world example like spam detection to illustrate the concepts, and mention that the choice between precision and recall depends on the business problem (e.g., false positives vs. false negatives).

1. Define the confusion matrix

Explain TP, FP, TN, FN in the context of binary classification, using a clear example such as predicting whether an email is spam.

2. Write the formulas

State the formulas for accuracy, precision, recall, and F1 score, ensuring correct notation and explaining each component.

3. Explain precision and recall in plain English

Describe precision as 'of all predicted positives, how many are actually positive?' and recall as 'of all actual positives, how many did we catch?'

4. Discuss trade-offs and F1

Explain that precision and recall often have an inverse relationship, and F1 score is the harmonic mean that balances them.

Key Points to Mention

  • TP: correctly predicted positive; FP: incorrectly predicted positive; TN: correctly predicted negative; FN: incorrectly predicted negative.
  • Accuracy = (TP + TN) / (TP + TN + FP + FN).
  • Precision = TP / (TP + FP); Recall = TP / (TP + FN).
  • F1 = 2 * (Precision * Recall) / (Precision + Recall).
  • Precision measures exactness (low false positive rate), recall measures completeness (low false negative rate).
  • The choice between precision and recall depends on the cost of false positives vs. false negatives.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

What is ensemble learning, why does combining multiple models tend to improve performance, and what are the common ways to aggregate model outputs?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Pretty standard.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining ensemble learning as combining multiple models to improve predictive performance. Explain the theoretical reasons (bias-variance tradeoff, error decorrelation) and then describe common aggregation methods (voting, averaging, stacking). Tailor the answer to a software engineering role by emphasizing practical trade-offs like latency, complexity, and maintainability.

Pro tip: Connect ensemble learning to real-world systems you've built or used, highlighting how you balanced accuracy gains against increased inference cost and operational complexity—this shows engineering maturity beyond textbook knowledge.

1. Define ensemble learning

State that ensemble learning combines predictions from multiple models to produce a single, more robust prediction. Mention that it's a meta-approach applicable to classification, regression, and other tasks.

2. Explain why it works

Discuss how ensembles reduce variance (by averaging uncorrelated errors), reduce bias (by combining weak learners), and improve generalization. Reference the bias-variance decomposition and the concept of error decorrelation.

3. Describe aggregation methods

Cover common techniques: majority voting for classification, weighted averaging for regression, and stacking (meta-learning) where a meta-model learns to combine base model outputs. Mention bagging and boosting as ensemble training strategies.

4. Highlight trade-offs

Acknowledge that ensembles increase computational cost, memory usage, and inference latency. Discuss when they are worth it (e.g., high-stakes predictions) and alternatives like model distillation.

5. Relate to software engineering

Emphasize practical considerations: scalability, deployment complexity, monitoring, and maintenance. Give an example of how you might implement an ensemble in production (e.g., using a service that fans out to multiple models).

Key Points to Mention

  • Bias-variance tradeoff: ensembles reduce variance by averaging and can reduce bias by combining weak learners.
  • Error decorrelation: models should make diverse errors for the ensemble to be effective.
  • Common aggregation methods: majority voting, weighted voting, simple averaging, weighted averaging, and stacking.
  • Bagging (e.g., Random Forests) and boosting (e.g., AdaBoost, Gradient Boosting) as ensemble training paradigms.
  • Trade-offs: increased computational cost, latency, and complexity versus improved accuracy and robustness.
  • Real-world example: Netflix Prize winning solution used ensemble of many models; or use in fraud detection where false negatives are costly.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Compare bagging and boosting: how each builds its training sets, whether each reduces bias or variance, the tradeoffs involved, and name a concrete algorithm for each.

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This is where I fumbled a little.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer by contrasting bagging and boosting across the four requested dimensions: training set construction, bias-variance impact, tradeoffs, and example algorithms. Use a clear compare-and-contrast format, and tie each concept to practical implications for model performance and engineering decisions.

Pro tip: Mention that bagging is easily parallelizable while boosting is inherently sequential, and note that boosting can overfit noisy data—this shows you understand real-world tradeoffs beyond textbook definitions.

1. Define training set construction

Explain that bagging trains models on bootstrap samples (random subsets with replacement) in parallel, while boosting trains models sequentially, with each new model focusing on the errors of the previous ensemble.

2. Explain bias-variance impact

State that bagging primarily reduces variance by averaging high-variance models, while boosting primarily reduces bias by combining weak learners into a strong learner, though it can also reduce variance if regularized.

3. Discuss tradeoffs

Highlight that bagging is robust to overfitting and parallelizable but may not improve bias, while boosting often achieves higher accuracy but is sensitive to noisy data and outliers, and is harder to parallelize.

4. Name concrete algorithms

Provide Random Forest as a bagging example and AdaBoost or Gradient Boosting (e.g., XGBoost) as boosting examples, briefly noting how they embody the respective principles.

5. Summarize with practical implications

Conclude by stating when to choose each: bagging for high-variance models and noisy data, boosting for high-bias models and cleaner datasets, considering computational constraints.

Key Points to Mention

  • Bagging uses bootstrap sampling with replacement; boosting uses the full dataset with reweighted instances.
  • Bagging reduces variance; boosting reduces bias (and sometimes variance).
  • Bagging is parallelizable; boosting is sequential and thus slower to train.
  • Boosting is more prone to overfitting on noisy data; bagging is more robust.
  • Random Forest is a bagging algorithm; AdaBoost, Gradient Boosting, XGBoost are boosting algorithms.
  • Boosting often achieves higher accuracy but requires careful tuning of learning rate and number of estimators.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Write the objective functions for L1 and L2 regularization, explain how each affects the learned weights differently, and discuss when you'd choose one over the other.

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Sparsity vs shrinkage is the core of this and I hit it fine.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by writing the objective functions for L1 and L2 regularization, clearly defining each term. Then explain the geometric and mathematical reasons for their different effects on weights (sparsity vs. shrinkage). Finally, discuss practical scenarios for choosing one over the other, linking to model interpretability, feature selection, and performance.

Pro tip: Mention that L1 regularization can be solved efficiently using coordinate descent or LARS, while L2 has a closed-form solution in linear regression (ridge). This shows depth beyond basic definitions.

1. Write the objective functions

For L1: J(w) = Loss(w) + λ * ||w||_1. For L2: J(w) = Loss(w) + λ * ||w||_2^2. Define Loss(w) as the unregularized loss (e.g., MSE for regression, cross-entropy for classification).

2. Explain the effect on weights

L1 encourages sparsity by driving some weights exactly to zero, effectively performing feature selection. L2 shrinks weights towards zero but rarely makes them exactly zero, distributing importance across features.

3. Discuss geometric intuition

L1 constraint region is a diamond (or hypercube) with corners on axes, so the loss contour often intersects at corners, leading to zero weights. L2 constraint is a circle (or hypersphere), so intersection points are typically not on axes, leading to small but non-zero weights.

4. When to choose L1 vs L2

Choose L1 when you need a sparse model and automatic feature selection, or when interpretability is key. Choose L2 when you have many small/medium effects, want to avoid overfitting without eliminating features, or when features are correlated (L2 handles multicollinearity better).

5. Mention Elastic Net and practical considerations

Elastic Net combines L1 and L2, useful when there are correlated features or when you want a balance. Also note that L1 can be unstable with correlated features, while L2 is more stable but less interpretable.

Key Points to Mention

  • Objective function formulas: L1 adds λ * sum(|w_i|), L2 adds λ * sum(w_i^2).
  • L1 produces sparse solutions (some weights exactly zero), L2 produces dense solutions (weights small but non-zero).
  • Geometric interpretation: L1 diamond vs L2 circle constraint regions.
  • L1 is robust to outliers and can be used for feature selection; L2 is sensitive to outliers but handles multicollinearity well.
  • Computational aspects: L1 is non-differentiable at zero, requiring subgradient methods; L2 is differentiable and has closed-form solutions in some models.
  • Elastic Net as a combination, and when to use it (e.g., correlated features).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

For a two-layer feedforward neural network, write the mathematical expressions for the hidden layer activations and the final output, then describe how you'd actually compute the output numerically given specific values.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Wrote h = g(W1*x + b1) and y = f(W2*h + b2) without much trouble.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining the notation and writing the general equations for the hidden layer pre-activations, hidden activations, and output layer. Then, for the numerical part, walk through a concrete example with small matrices, showing step-by-step matrix multiplication and activation application, while explaining the computational considerations.

Pro tip: Mention that in practice, you'd use optimized libraries (e.g., BLAS) and vectorize operations, but also be prepared to do a small example by hand to demonstrate understanding. Also, clarify activation function choices (e.g., ReLU for hidden, sigmoid/softmax for output) and their impact.

1. Define notation and architecture

Specify the number of input features, hidden units, and output units. Define weight matrices W1 (hidden) and W2 (output), bias vectors b1 and b2, and activation functions f and g.

2. Write hidden layer equations

Express the hidden pre-activation as Z1 = X W1 + b1 (with X as input matrix) and hidden activation as A1 = f(Z1).

3. Write output layer equations

Express the output pre-activation as Z2 = A1 W2 + b2 and final output as Y = g(Z2).

4. Numerical computation walkthrough

Plug in specific values for X, W1, b1, W2, b2, compute Z1, apply f to get A1, then compute Z2 and apply g to get Y. Show matrix multiplications and element-wise operations.

5. Discuss computational considerations

Mention efficiency: use vectorized operations, batch processing, and libraries like NumPy or BLAS. Also note activation function choices and their effect on gradients.

Key Points to Mention

  • Matrix dimensions and compatibility for multiplication
  • Choice of activation functions (e.g., ReLU, sigmoid, tanh) and their properties
  • Bias terms and their role in shifting activation
  • Vectorization and batch processing for efficiency
  • Numerical stability (e.g., avoiding overflow in sigmoid/softmax)
  • Forward propagation as a sequence of linear and nonlinear transformations

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.