- Input:
- Output:
- Example walkthrough
- Size/Range:
- Time/Space limits:
- Special conditions:
- Null/Empty cases?
- Input validation?
- Multiple solutions ok?
- Array/String/Matrix
- Hash/Set/Map
- Stack/Queue/Heap
- Tree/Graph/Trie
- LinkedList/Pointer
- Brute Force → Optimize
- Two Pointers/Sliding
- BFS/DFS/Backtrack
- Binary Search
- DP/Greedy
- Math/Bit Manipulation
- Time: O()
- Space: O()
- Empty/Single
- Simple small input
- Regular case
- Min/Max values
- Boundaries/Zeros
- Duplicates
- Overflow
- Negative/Special chars
- Unordered/Unsorted
- Cycles/Self-loops
- Better data structure?
- Remove redundancy?
- Cache results?
- Space optimization?
- Handle edge cases
- Clear variable names
- Add key comments
- Test final solution
- Think out loud consistently
- Explain your reasoning
- Ask clarifying questions early
- Signal when switching approaches
- Start with brute force
- Optimize gradually
- Test while coding
- Manage time wisely
- Draw diagrams when helpful
- Break down complex problems
- Write clean, readable code
- Use meaningful variable names
- Handle edge cases explicitly
- Leave time for testing
- Stay calm if stuck
- Keep moving forward