Layer Normalization
Asked at TikTok · ML Fundamentals & Algorithms · Difficulty: Medium · Last asked Dec 3, 2025
Layer Normalization normalizes each sample independently across its feature dimension, so it does not depend on batch statistics and behaves the same in training and inference. It is the standard normalization layer in Transformers. In this problem you implement its forward and backward passes by hand with NumPy, as you would when writing a small neural-network library without autograd.
Loading the problem…
More TikTok interview questions
- Designing a Harmful Content Detection System
- Multi-Head Self-Attention in NumPy (Batched)
- Count Non-Attacking Queen Placements
- Classifier Analysis
- Clean Noisy Human Labels by Scoring Annotator Reliability
- Applied Stats: Distributed Averaging Under Noisy Communication