1. Find the first non-repeating character in a string.
Why they ask: A warm-up that reveals whether you think about complexity before typing.
How to answer: State the hash-map approach and its O(n) time and O(1) space bound for a fixed alphabet before coding, then handle empty input.
2. Design a URL shortener.
Why they ask: The most common entry-level system design prompt.
How to answer: Clarify scale first, then cover ID generation, storage choice, read/write ratio, caching and redirect handling. Say your trade-offs aloud.
3. How do you decide between SQL and NoSQL?
Why they ask: Checks whether you pick by fashion or by access pattern.
How to answer: Anchor on access patterns, consistency needs and relationships — then give a real example from a project.
4. Tell me about the hardest bug you have fixed.
Why they ask: The strongest predictor of day-to-day capability.
How to answer: Describe the symptom, your hypotheses, how you eliminated them, the root cause, and what you changed so it cannot recur.
5. How do you keep your code maintainable for the next person?
Why they ask: Senior signal, asked even at junior level.
How to answer: Tests, naming, small functions, documented decisions. Give one instance where your own past code helped or hurt you later.