← Microsoft Interview Insights

Microsoft·Software Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

Microsoft Applied Scientist interview with a classic ML theory question on normalization. Pretty standard technical screen, one question but they really wanted you to go deep on the details rather than just name-drop the terms.

Questions Asked (1)

Q1

What is the difference between Layer Normalization and Batch Normalization? Walk through what dimensions each normalizes over, how they behave differently at train vs inference time, their dependence on batch size, and when you'd choose one over the other.

Technical Trade-offsSystem Design
Author's notes

I knew this one but still fumbled the train vs inference part for BatchNorm.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining both normalization techniques and explicitly stating the dimensions they normalize over. Then contrast their behavior at training and inference time, emphasizing batch size dependence, and finish with practical guidance on when to choose each.

Pro tip: Mention that LayerNorm is standard in Transformers and RNNs while BatchNorm is common in CNNs, and note that BatchNorm's running statistics can cause train-test discrepancy—this shows depth beyond textbook definitions.

1. Define and contrast normalization dimensions

Explain that BatchNorm normalizes over the batch dimension (N) for each feature/channel independently, while LayerNorm normalizes over the feature dimension (C, H, W) for each sample independently.

2. Describe train vs inference behavior

Detail that BatchNorm uses batch statistics during training and running averages during inference, whereas LayerNorm uses the same per-sample statistics at both times.

3. Discuss batch size dependence

Highlight that BatchNorm's performance degrades with small batch sizes and is unsuitable for online learning, while LayerNorm is batch-size independent and works well with any batch size.

4. Explain when to choose each

Recommend BatchNorm for CNNs with large batches, and LayerNorm for RNNs, Transformers, and scenarios with small or variable batch sizes.

Key Points to Mention

  • BatchNorm normalizes across the batch dimension; LayerNorm normalizes across the feature dimension.
  • BatchNorm uses batch statistics during training and running averages during inference; LayerNorm uses per-sample statistics consistently.
  • BatchNorm is sensitive to batch size; LayerNorm is not.
  • BatchNorm is common in CNNs; LayerNorm is standard in Transformers and RNNs.
  • BatchNorm can cause train-test discrepancy due to running statistics; LayerNorm avoids this.
  • LayerNorm is preferred for sequence models and when batch size is small or variable.

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