Q1. What is your framework for solving unseen coding questions quickly?
I classify the problem into known patterns (two pointers, sliding window, BFS/DFS, DP), write a brute-force baseline, and then improve complexity intentionally. This keeps momentum while making optimization decisions transparent.
Q2. How do you avoid getting stuck on dynamic programming problems?
I define state, transitions, and base cases using a tiny example before writing code. If top-down recursion is clearer, I start there with memoization and convert to bottom-up only when space or stack constraints require it.
Q3. How do you balance writing perfect code versus finishing in time?
I optimize for correctness and readability first, then improve edge-case handling and micro-optimizations if time remains. In interviews, a complete and well-explained solution usually scores better than an unfinished optimal one.