Resumable Weighted Batch Data Loader
Asked at Microsoft · Coding Questions · Difficulty: Medium · Last asked Mar 18, 2026
Build a data loader that mixes several datasets into one stream of fixed-size training batches. Each dataset (a "source") has an integer weight, and over time the share of items taken from each source must match its weight. Every source is read in its own order, and the loader can save its progress and later resume exactly where it stopped, so a restarted training job sees the same batches.
Loading the problem…
More Microsoft interview questions
- LLM conceptual questions
- Roofline Analysis and Mixed-Precision Gradients for Matmul
- Tiny Next-Token Prediction Model (PyTorch Fill-In)
- Design Search Autocomplete / Typeahead
- Design a Chatbot Personalization / Memory System
- Design a Job Scheduler / ETL Pipeline