Below are 25 basic (yet thorough) coding-focused questions that test fundamental PyTorch skills relevant to building and running LLMs. They range from creating and manipulating tensors, to implementing small transformer components, to applying sampling methods. Each question should prompt you to write working code (in a live environment or whiteboard style), ensuring you can demonstrate good coding practices in PyTorch for LLM use cases.


  1. Tensor Creation & Manipulation
  2. Embedding Lookup
  3. Forward Pass Through a Simple Network
  4. Positional Encoding
  5. Basic Autoregressive Decoding Loop (Greedy)
  6. Top-k Sampling Decoding
  7. Nucleus (Top-p) Sampling
  8. Mini “Attention” Mechanism
  9. Layer Normalization
  10. Masking in Attention
  1. KV Caching
  1. Dynamic Padding / Batching