The Ultimate Guide to Tech Interview Questions on Rest vs GraphQL
1. Introduction Why tech interviews matter. What companies test: coding, system design, problem‑solving, communication. 2. Technical / Conceptual Questions Example Q: Explain OOP principles. Answer: Encapsulation (data hiding), Abstraction (simplified interface), Inheritance (reuse), Polymorphism (different forms). 👉 Use a real‑world analogy : A car (encapsulation = engine hidden, abstraction = steering wheel, inheritance = electric vs petrol cars, polymorphism = different ways to “drive”). Example Q: REST vs GraphQL (see cheat sheet above). 3. Coding / Problem-Solving Example Q: Reverse a linked list. Answer (Python): python def reverse_list(head): prev = None while head: nxt = head.next head.next = prev prev = head head = nxt return prev 👉 Better Approach: Explain step‑by‑step: Keep track of previous node. Rewire pointers. Iterate until list ends. 4. System Design Example Q: Design a URL shortener. Answer: Use a hash...