Tower of Hanoi (recursion)
Asked at Apple · Coding Questions · Difficulty: Medium
Given an integer `n` (`1 ≤ n ≤ 20`), representing the number of disks. All disks are stacked on peg `A` from smallest to largest.
Loading the problem…
More Apple interview questions
- LLM conceptual questions
- Implement a Two-Hidden-Layer MLP with Backpropagation in NumPy
- Compare PPO, DPO, and GRPO
- Implement a Vision Transformer (ViT) from Scratch
- Sample from a Gaussian Distribution Using Only Uniform Sampling
- ML Fundamentals and Model Debugging Rapid-Fire