Interview Preparation
Data Structures & Algorithms (DSA)
DSA is the foundation of technical interviews. Master these key topics. The best place to practice is LeetCode's Top Interview Questions list.
- Arrays & Strings: Two Pointers, Sliding Window, String Manipulation.
- Linked Lists: Traversal, Reversal, Cycle Detection.
- Stacks & Queues: LIFO/FIFO principles, usage for parentheses validation, etc.
- Trees & Graphs: Traversals (BFS, DFS), basic properties of binary search trees.
- Sorting & Searching Algorithms: Big O complexity (Merge Sort, Quick Sort), Binary Search.
- Hashing: Using HashMaps (Objects/Dictionaries) for efficient lookups.
Must-Do DSA Questions:
- Two Sum (Arrays/Hashing)
- Valid Parentheses (Stacks)
- Reverse a Linked List (Linked Lists)
- Merge Two Sorted Lists (Linked Lists)
- Binary Tree Inorder Traversal (Trees)
JavaScript Deep Dive (Most Important)
For any web developer, JavaScript is the most critical topic. Be ready to explain these concepts.
- What is the difference between `==` and `===`?
Tip: `==` checks for value (with type coercion), `===` checks for both value AND type. Always use `===`. - Explain Hoisting in JavaScript.
Tip: `var` declarations are "hoisted" (moved to the top of their scope) and initialized with `undefined`. `let` and `const` are also hoisted but are in a "Temporal Dead Zone" and cannot be accessed before declaration. - What is a Closure? Give a practical example.
Tip: A function's ability to remember and access variables from its outer (lexical) scope, even after that outer function has finished running. (e.g., a function returning another function). - Explain the 'this' keyword. How does it work differently with arrow functions?
Tip: `this` refers to the object that is *calling* the function. Arrow functions (`=>`) do not have their own `this`; they inherit it from their parent's scope. - What is the Event Loop? Explain Call Stack, and Callback Queue.
Tip: This explains how JS handles asynchronous code. Call Stack (for function calls), Web API (for async tasks like `setTimeout`), Callback Queue (for completed tasks), Event Loop (moves tasks from queue to stack when stack is empty). - Explain `Promise`, `async/await`, and how they handle asynchronous code.
Tip: Promises are objects representing the eventual completion (or failure) of an async operation. `async/await` is modern "syntactic sugar" that makes promise-based code look synchronous and easier to read.
React & Frontend Questions
If you're applying for a MERN stack or frontend role, these are essential.
- What is the Virtual DOM (VDOM)?
Tip: It's a lightweight JavaScript copy of the real DOM. React makes changes to the VDOM first, then calculates the *minimum* necessary changes to update the real DOM (this process is called "reconciliation"). This is faster than updating the real DOM directly. - What is the difference between State and Props?
Tip: **Props** (properties) are passed *down* from a parent component (they are read-only). **State** is data managed *inside* a component (it can be changed using `useState`). - Explain React Hooks (e.g., `useState`, `useEffect`).
Tip: `useState` lets you add state to functional components. `useEffect` lets you perform "side effects" (like fetching data, timers, or manually changing the DOM) after the component renders. - What is the CSS Box Model?
Tip: The four parts of an element's space: Content, Padding, Border, Margin.
Node.js & Backend (MERN)
For backend or full-stack roles.
- What is Node.js and how is it different from JavaScript in the browser?
Tip: Node.js is a runtime that lets you run JS *outside* the browser (on a server). It has access to server-side features (like the file system, databases) but does *not* have browser-specific APIs (like the `document` or `window` objects). - What is middleware in Express.js?
Tip: Functions that have access to the `request` (req), `response` (res), and the `next` function in the request-response cycle. They are used for logging, authentication (JWT), error handling, etc. - What is the difference between SQL and NoSQL databases?
Tip: **SQL** (like MySQL) uses structured data (tables, rows) with predefined schemas. **NoSQL** (like MongoDB) uses unstructured data (collections, documents) with flexible schemas. MongoDB is great for MERN stack. - What is REST? Explain the common HTTP methods.
Tip: REST is an architectural style for APIs. Common methods: `GET` (read data), `POST` (create new data), `PUT`/`PATCH` (update data), `DELETE` (delete data).
The STAR Method for Behavioral Questions
For questions like "Tell me about a time you faced a challenge," use the STAR method.
- S (Situation): Briefly describe the context. (1-2 sentences)
- T (Task): What was your specific role or task? (1 sentence)
- A (Action): Describe the specific steps *you* took. Use "I" statements. (3-4 sentences)
- R (Result): What was the outcome? Quantify it if possible. (1-2 sentences)
Common HR Questions
Be prepared for these common non-technical questions.
- "Tell me about yourself."
Tip: Use a "Present-Past-Future" formula. - "What are your strengths and weaknesses?"
Tip: For weaknesses, choose a real weakness and show how you are improving it. - "Why do you want to work for this company?"
Tip: Do your research! Mention something specific about their products or culture.
Core CS Fundamentals (OOP, DBMS, OS)
For service-based companies and entry-level roles, be ready for these fundamental questions.
- Explain the 4 pillars of Object-Oriented Programming (OOP).
Answer: Encapsulation, Abstraction, Inheritance, and Polymorphism. Be ready to briefly explain each. - What is the difference between a `PRIMARY KEY` and a `UNIQUE KEY` in SQL?
Answer: A table can have only one Primary Key (cannot be NULL). A table can have multiple Unique Keys (can have one NULL). - What is a Process vs. a Thread?
Tip: A **Process** is a program in execution (e.g., opening Chrome). **Threads** are lightweight paths of execution *within* a process. A Chrome tab could be a thread. - What is a Deadlock in Operating Systems?
Tip: A situation where two or more processes are blocked forever, each waiting for a resource held by the other. - Explain your final year project.
Tip: Be passionate! Explain the problem it solves, the tech stack, your role, and the challenges you overcame.
Resume Building Tips
Your resume is your first impression. Make it count.
- Use a clean, single-page template.
- Highlight 2-3 of your best projects with clear, bullet-pointed descriptions.
- List your skills clearly (Languages, Frameworks, Databases, Tools).
- Include links to your GitHub, LinkedIn, and live project demos.
- Proofread multiple times to eliminate typos.