Skip to main content

Posts

Showing posts from March, 2025

MySQL interview for 10+ years of experience

For a MySQL interview for 10+ years of experience, we can expect questions on performance optimization, indexing, query tuning, replication, sharding, transactions, security, and architecture. Here are some key regularly asked questions with answers: 1. MySQL Performance Optimization Question 1. How do you optimize a slow query in MySQL? First, let's Check the execution Plan. We can use EXPLAIN to analyze query execution. EXPLAIN SELECT * FROM orders WHERE status = 'pending'; Indexes: Ensure proper indexes on frequently searched columns. Fetching Columns: Fetch only necessary columns, do not use select *. Optimize Joins: Use indexed columns for joins for fast fetching. Use Query Caching: Enable MySQL query cache. Partition Large Tables: Use partitioning for high-volume data. Denormalization: Reduce joins by adding redundant data when necessary. Optimize WHERE Conditions: Avoid LIKE '%term%' as it prevents index usage. 2. Indexing & Query Execution Question 2. Wh...

React Basics- Interview Questions

  1. React Basics Q1: What is the Virtual DOM, and how does it work? A: The Virtual DOM is a lightweight JavaScript representation of the actual DOM. React uses it to optimize UI rendering. When the state of a component changes: A new Virtual DOM tree is created. React compares it with the previous Virtual DOM (diffing). React updates only the changed parts in the real DOM (reconciliation). This process improves performance because direct DOM manipulations are slow. Q2: What is the difference between functional and class components? A: Feature Functional Component Class Component Syntax Uses functions                               Uses ES6 classes State Uses useState , useReducer Uses this.state Lifecycle Uses hooks ( useEffect ) Uses lifecycle methods ( componentDidMount ) Performance More optimized Slightly heavier This keyword Not required Requires this Functional components w...

React js interview questions for 3 year experience - Concepts

 For a React.js interview at a 3-year experience level, you should focus on the following topics: 1. Core React Concepts React Component Lifecycle (class & functional components) React Hooks (useState, useEffect, useContext, useMemo, useCallback, useRef, etc.) JSX, Virtual DOM, and Reconciliation Props vs. State Controlled vs. Uncontrolled Components Error Boundaries 2. Advanced React Higher-Order Components (HOCs) Render Props Pattern Context API vs. Redux (when to use what) React Suspense & Lazy Loading Custom Hooks React Portals 3. State Management Local State (useState, useReducer) Global State Management (Redux Toolkit, Context API) Apollo Client for GraphQL State Management 4. Performance Optimization React.memo, useMemo, useCallback Code Splitting & Lazy Loading Avoiding unnecessary re-renders Profiling React Apps 5. React with TypeScript (if applicable) Props & State Types Function Components with TypeScript Utility Types in React ...

OAuth vs. JWT: Differences & Using Them Together

  OAuth vs JWT: Authentication and Authorization Explained What are OAuth and JWT? OAuth and JWT are both technologies used in web authentication and authorization, but they serve different purposes and work in different ways. Let's break them down for beginners. OAuth (Open Authorization) OAuth is an authorization framework that allows third-party applications to access user data without exposing passwords. Think of it like a special access pass. Real-World Analogy Imagine you want to let a delivery service access your apartment building. Instead of giving them your personal key (password), you give them a temporary, limited-access pass that only works for specific purposes. Key Characteristics: Allows secure authorization without sharing login credentials Enables third-party apps to access user data Supports delegated access with specific permissions Commonly used by services like "Login with Google" or "Login with Facebook" Example Scenario Whe...