1. Data Structures & Algorithms
01. Difference between an Array and a Linked List?
Arrays have O(1) access time but O(n) insertion/deletion. Linked Lists have O(n) access but O(1) insertion/deletion (if position is known). Arrays are contiguous in memory.
02. What is a Hash Map and how does it handle collisions?
A data structure that maps keys to values using a hash function. Collisions are handled via Chaining (linked lists in buckets) or Open Addressing (probing).
03. Explain Big O Notation.
It describes the upper bound of an algorithm's complexity in terms of time or space as the input size grows. Common: O(1), O(log n), O(n), O(n log n), O(n²).
04. What is the difference between BFS and DFS?
BFS (Breadth-First Search) uses a queue and explores layer by layer. DFS (Depth-First Search) uses a stack (or recursion) and explores as deep as possible before backtracking.
05. How does QuickSort work?
A divide-and-conquer algorithm that picks a pivot element and partitions the array such that elements smaller than the pivot are on the left and larger on the right.
06. What is a Binary Search Tree (BST)?
A tree where each node has at most two children. The left child is smaller than the parent, and the right child is larger. Search is O(log n) on average.
07. Explain Recursion and its base case.
A function calling itself. The base case is the condition that stops the recursion to prevent a stack overflow.
08. What is a Priority Queue?
A queue where each element has a priority. Elements with higher priority are dequeued before lower ones. Typically implemented with a Heap.
09. What is Dynamic Programming?
An optimization technique for recursion where you store results of subproblems (Memoization) to avoid redundant calculations. Example: Fibonacci sequence.
10. Difference between Stack and Queue?
Stack is LIFO (Last-In-First-Out). Queue is FIFO (First-In-First-Out).
2. System Design
11. What is Load Balancing?
Distributing incoming network traffic across multiple servers to ensure no single server is overwhelmed, improving availability and reliability.
12. Explain Vertical vs Horizontal Scaling.
Vertical scaling means adding more power (CPU, RAM) to an existing server. Horizontal scaling means adding more servers to your pool.
13. What is Caching?
Storing frequently accessed data in a fast storage layer (like Redis or Memcached) to reduce the latency of future requests.
14. Explain Microservices vs Monolith.
Monolith is a single unified unit. Microservices break the app into small independent services that communicate over a network (e.g., via APIs).
15. What is the CAP Theorem?
Consistency, Availability, and Partition Tolerance. A distributed system can only guarantee two out of the three simultaneously.
16. What is Database Sharding?
Breaking a large database into smaller, faster, more manageable parts called shards, distributed across multiple servers.
17. Explain REST vs GraphQL.
REST has fixed endpoints and structures. GraphQL allows clients to request exactly the data they need, reducing over-fetching and under-fetching.
18. What is a Message Queue?
An asynchronous communication protocol (like RabbitMQ or Kafka) where a sender puts a message on a queue, and a receiver processes it when ready.
19. What is CDN?
Content Delivery Network. A system of distributed servers that deliver web content to users based on their geographic location to reduce latency.
20. Explain Database Replication.
Copying data from one database server (Master) to another (Slave) to improve read performance and provide data redundancy.
3. OOPs & Clean Code
21. What are the 4 pillars of OOP?
Encapsulation, Abstraction, Inheritance, and Polymorphism.
22. Difference between Interface and Abstract Class?
An interface only defines methods (what to do). An abstract class can have both method signatures and full implementations (how to do).
23. What are SOLID principles?
Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.
24. What is Dependency Injection?
A design pattern where an object receives its dependencies from the outside rather than creating them itself, improving testability and decoupling.
25. Explain Method Overloading vs Overriding.
Overloading is having multiple methods with the same name but different parameters in the same class. Overriding is a subclass providing a specific implementation of a method defined in its parent class.
26. What is a Singleton Pattern?
A design pattern that restricts a class to only one instance throughout the application.
27. What is the difference between Composition and Inheritance?
Inheritance is an "is-a" relationship. Composition is a "has-a" relationship. Composition is generally preferred for flexibility.
28. Explain the Factory Pattern.
A pattern used to create objects without specifying the exact class of the object that will be created.
29. What is Dry Principle?
Don't Repeat Yourself. Every piece of knowledge must have a single, unambiguous representation within a system.
30. What is YAGNI?
You Ain't Gonna Need It. A principle that programmers should not add functionality until deemed necessary.
4. Modern Dev & Tools
31. What is Git and how does it work?
A distributed version control system that tracks changes in source code. It uses snapshots and allows branching/merging.
32. Explain the difference between Git Merge and Rebase.
Merge creates a new commit that combines both branches. Rebase moves the base of a branch to a new starting point, resulting in a cleaner, linear history.
33. What is Docker?
A platform for developing, shipping, and running applications in lightweight, isolated containers that package all dependencies.
34. What is CI/CD?
Continuous Integration and Continuous Deployment. Automated processes to build, test, and deploy code changes to production frequently.
35. Explain the difference between Unit, Integration, and E2E Testing.
Unit tests a single component. Integration tests how components work together. E2E (End-to-End) tests the entire user flow.
36. What is TDD?
Test-Driven Development. Writing the test before writing the code itself.
37. What is Serverless Computing?
A cloud model (like AWS Lambda) where the provider manages the server infrastructure, and you only write the code (functions) that run in response to events.
38. Explain SQL vs NoSQL.
SQL databases are relational and structured. NoSQL databases are non-relational, flexible, and often document-oriented (e.g., MongoDB).
39. What is an API Gateway?
A server that acts as an entry point for APIs, handling routing, security, rate limiting, and other cross-cutting concerns.
40. What is OAuth 2.0?
A standard protocol for authorization that allows third-party applications to grant limited access to user accounts on another service.
5. Professional Growth
41. How do you debug a production issue?
Check logs, monitoring dashboards, reproduce the issue in a staging environment, and apply a hotfix after testing.
42. How do you handle technical debt?
Document it, prioritize it based on impact, and allocate time in each sprint to refactor and pay it down.
43. What is the most important skill for a Software Engineer?
Problem-solving ability, adaptability, and clear communication.
44. How do you approach a new project with an unfamiliar tech stack?
Read documentation, build a small PoC, and learn as I go while leveraging existing engineering fundamentals.
45. Describe a time you had a conflict with a teammate.
Focus on how you communicated, listened to their perspective, and reached a technical compromise for the project's benefit.
46. What is your take on AI in Software Engineering?
A powerful tool for productivity (coding assistants, debugging) but requires human oversight for architecture, ethics, and security.
47. How do you conduct a code review?
Look for logic errors, clean code compliance, security vulnerabilities, and provide constructive, kind feedback.
48. What is your favorite programming language and why?
Choose one and explain its strengths (e.g., Python for its simplicity and libraries, or Java for its robust enterprise features).
49. How do you manage your time during a busy sprint?
Using tools like Jira, focusing on high-priority tickets, and avoiding context switching.
50. Why should we hire you?
Highlight your technical skills, culture fit, and your passion for solving their company's specific problems.