Finish your first coding drill
This guide walks you through completing one coding drill from start to finish, so you understand the full loop: choose a track, read the problem, write a solution, run the hidden tests, and record your progress. It takes about five minutes.
Before you start
- Be signed in (Google sign-in — see Accounts & sign-in).
- Open interviewpai.aoneahsan.com.
Steps
- Open the tracks hub. Go to Learn → Tracks (
/learn/tracks). - Pick a track. Start with JavaScript if you're unsure — it has the most drills.
- Open a topic, then a drill. Each card shows difficulty and your progress.
- Read the problem and examples. Note the expected input → output pairs above the editor.
- Implement the starter code. Replace the
// TODOin the provided function signature. - Run. Your code executes locally in a Web Worker and is checked against the drill's tests.
- Iterate on failures. Read the actual vs expected output for each failing case and fix your logic.
- Use hints if stuck. Each drill has layered hints and a three-tier guide before the full solution.
- Reveal the solution. After your tests pass (or after a genuine attempt), open the reference solution, complexity analysis, and follow-ups.
- Done. Your completion is saved; your streak and per-track stats update on the dashboard.
Worked example
A classic first drill is "Two Sum": given an array and a target, return the indices of the two numbers that add up to the target.
function twoSum(nums, target) {
const seen = new Map();
for (let i = 0; i < nums.length; i++) {
const need = target - nums[i];
if (seen.has(need)) return [seen.get(need), i];
seen.set(nums[i], i);
}
return [-1, -1];
}
Run it and the hidden tests confirm it handles the examples plus edge cases (no match, duplicates). Then read the reference solution and its O(n) complexity note.
Tips
- Attempt before revealing. Retrieval beats recognition — the solution unlocks after a real try for a reason.
- Watch the edge cases. Empty arrays, negatives, and duplicates are where most attempts fail.
- Keep a streak. One drill a day compounds faster than occasional marathons.
Next
Try a mock interview to rehearse explaining a solution out loud.