π‘ What it is: Breaking down the problem into fundamental truths and reasoning up from there. π― Use it for: Deep insights, root cause analysis, and conceptual clarity.
π How to prompt:
"Explain this code using First Principles Thinking (FPT)βbreak it down to its most fundamental concepts, avoid analogies, and reconstruct it logically."
β Example: πΉ Given an algorithm, break it down into core operations (loops, conditions, data structures) and analyze its behavior at the most atomic level.
π‘ What it is: Simulating how the code executes line by line with sample input. π― Use it for: Debugging, visualization, and understanding loops/conditions.
π How to prompt:
"Walk through this code step by step with an example input and show how the variables change at each step."
β Example: πΉ Given an array-processing algorithm, show how each iteration updates variables in a table format.
π‘ What it is: Relating the code to common problem-solving patterns or real-world analogies. π― Use it for: Recognizing repeated problem structures, high-level intuition.
π How to prompt:
"Compare this code to a real-world analogy and explain how it follows common patterns like DP, Sliding Window, etc."
β Example: πΉ Explaining binary search using a dictionary lookup analogy or explaining recursion using Russian dolls.
π‘ What it is: Understanding how the code scales and if thereβs a better approach. π― Use it for: Performance tuning, algorithmic efficiency.
π How to prompt:
"Break down the time and space complexity of this code, identify the bottlenecks, and suggest optimizations."
β Example: πΉ Given an O(nΒ²) brute-force algorithm, check if sorting or data structures can reduce it to O(n log n) or O(n).
π‘ **What it is:**Breaking down complex code into simple, beginner-friendly chunks. π― **Use it for:**Grasping new topics, intuitive learning, and quick understanding.
π How to prompt:
"Explain this code like Iβm 5 (ELI5) using simple terms, metaphors, and clear logic."
β Example: πΉ Explaining recursion as a chef following a recipe and calling another chef when stuck.
π‘ What it is: Stress-testing the code with edge cases to understand where it breaks. π― Use it for: Finding weaknesses, debugging.
π How to prompt:
"What are the edge cases for this code? How does it behave in worst-case scenarios?"
β Example: πΉ Checking if an array-sorting algorithm handles duplicates, empty inputs, or large numbers.
π‘ What it is: Comparing multiple ways to solve the same problem and choosing the best. π― Use it for: Evaluating different approaches.
π How to prompt:
"Explain this approach vs. [brute force / DP / greedy / two pointers] and compare their strengths/weaknesses."
β Example: πΉ Comparing brute force vs. DP for Fibonacci, showing how memoization reduces redundant computations.
Whenever you request an explanation, combine multiple frameworks for maximum clarity.
π Example Prompt for an Elite Explanation:
"Explain this code using:
- FPT to break it into fundamentals,
- Step-by-step execution with an example,
- Pattern recognition to relate it to common problems,
- Complexity analysis to check performance,
- Alternative approaches for comparison."