Day 74 of 133
Prompt engineering + CoT + ReAct + DSA Greedy
Few-shot vs zero-shot; CoT; jailbreak defense.
DSA · NeetCode Greedy
- Hand OF StraightsDSA · Greedy
Interview questions to prep
- Prove the greedy choice — why is the locally-optimal pick safe globally? (Exchange argument or staying-ahead.)
- When does greedy fail on a similar-looking problem, and what would you reach for instead (DP, BFS)?
- Walk through edge cases that often break naive greedy: ties, negatives, single element.
- Merge Triplets TO Form Target TripletDSA · Greedy
Interview questions to prep
- Prove the greedy choice — why is the locally-optimal pick safe globally? (Exchange argument or staying-ahead.)
- When does greedy fail on a similar-looking problem, and what would you reach for instead (DP, BFS)?
- Walk through edge cases that often break naive greedy: ties, negatives, single element.
GenAI · Prompt engineering
Interview questions to prep
- When does few-shot help vs hurt?
- How do you design a system prompt for a customer-support agent?
- A prompt works in testing but fails randomly in production. How would you debug prompt drift?
- How do prompt templates, delimiters, schemas, and locked sampling settings improve reproducibility?
- What would a prompt regression test suite look like before deploying a new assistant prompt?
Interview questions to prep
- Walk through how chain-of-thought prompting changes performance on reasoning tasks.
- When does CoT hurt accuracy?
- Why can chain-of-thought improve complex reasoning but also amplify early mistakes?
- How would you prevent error compounding with stepwise verification, modular reasoning, or external checks?
- When would you use CoT, ReAct, ToT, self-consistency, or no explicit reasoning at all?
Interview questions to prep
- How would you defend a customer-facing LLM against prompt injection from user-supplied content?
- Why is 'just tell the model to ignore injection' insufficient — what's the actual defense-in-depth?
References & further reading
- Anthropic — Prompt Engineering Guide ↗Anthropic
- DeepLearning.AI — short courses on GenAI / LLMs ↗DeepLearning.AI