๐ป ๐๐ฅ๐๐ ๐๐
๐ฐ๐ฒ๐น ๐ ๐ฎ๐๐๐ฒ๐ฟ๐ฐ๐น๐ฎ๐๐ โ ๐๐ฒ๐๐ผ๐ป๐ฑ ๐๐ผ๐น๐น๐ฒ๐ด๐ฒ ๐๐ฎ๐๐ถ๐ฐ๐
Still using Excel only for simple tables?
Learn how professionals use Excel for data analysis, insights & reporting.
โ Real business use cases
โ Must-know Excel formulas
โ Data cleaning & analysis
โ Career guidance
๐ 13 March | โฐ 6 PM
๐ฅ๐ฒ๐ด๐ถ๐๐๐ฒ๐ฟ ๐๐ผ๐ฟ ๐๐ฅ๐๐๐ :-
https://pdlink.in/4bEDmIw
๐ Upgrade your Excel skills today!
Still using Excel only for simple tables?
Learn how professionals use Excel for data analysis, insights & reporting.
โ Real business use cases
โ Must-know Excel formulas
โ Data cleaning & analysis
โ Career guidance
๐ 13 March | โฐ 6 PM
๐ฅ๐ฒ๐ด๐ถ๐๐๐ฒ๐ฟ ๐๐ผ๐ฟ ๐๐ฅ๐๐๐ :-
https://pdlink.in/4bEDmIw
๐ Upgrade your Excel skills today!
How to send follow up email to a recruiter ๐๐
(Tap to copy)
Dear [Recruiterโs Name],
I hope this email finds you doing well. I wanted to take a moment to express my sincere gratitude for the time and consideration you have given me throughout the recruitment process for the [position] role at [company].
I understand that you must be extremely busy and receive countless applications, so I wanted to reach out and follow up on the status of my application. If itโs not too much trouble, could you kindly provide me with any updates or feedback you may have?
I want to assure you that I remain genuinely interested in the opportunity to join the team at [company] and I would be honored to discuss my qualifications further. If there are any additional materials or information you require from me, please donโt hesitate to let me know.
Thank you for your time and consideration. I appreciate the effort you put into recruiting and look forward to hearing from you soon.Warmest regards,(Tap to copy)
๐ค ๐๐ + ๐๐ฎ๐๐ฎ = ๐ง๐ต๐ฒ ๐๐๐๐๐ฟ๐ฒ ๐ผ๐ณ ๐๐ผ๐ฏ๐
Start your journey in Data Analytics & Data Science with AI Certification and gain skills companies are actively hiring for.
๐ Data Analysis
๐ Python Programming
๐ค Machine Learning
๐ AI-Driven Insights
๐ฅ Perfect for College Students ,Freshers & Professionals
1๏ธโฃ๐ฃ๐๐๐ต๐ผ๐ป :- https://pdlink.in/3OD9jI1
2๏ธโฃ๐๐ฎ๐๐ฎ ๐ฆ๐ฐ๐ถ๐ฒ๐ป๐ฐ๐ฒ :- https://pdlink.in/4kucM7E
3๏ธโฃ๐๐ฎ๐๐ฎ ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐ :- https://pdlink.in/4ay4wPG
4๏ธโฃ๐๐๐๐ถ๐ป๐ฒ๐๐ ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐ :- https://pdlink.in/3ZtIZm9
5๏ธโฃ๐๐ & ๐ ๐ฎ๐ฐ๐ต๐ถ๐ป๐ฒ ๐๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด :- https://pdlink.in/4rMivIA
Don't Miss This Opportunity . Get Placement Assistance With 5000+ Companies
Start your journey in Data Analytics & Data Science with AI Certification and gain skills companies are actively hiring for.
๐ Data Analysis
๐ Python Programming
๐ค Machine Learning
๐ AI-Driven Insights
๐ฅ Perfect for College Students ,Freshers & Professionals
1๏ธโฃ๐ฃ๐๐๐ต๐ผ๐ป :- https://pdlink.in/3OD9jI1
2๏ธโฃ๐๐ฎ๐๐ฎ ๐ฆ๐ฐ๐ถ๐ฒ๐ป๐ฐ๐ฒ :- https://pdlink.in/4kucM7E
3๏ธโฃ๐๐ฎ๐๐ฎ ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐ :- https://pdlink.in/4ay4wPG
4๏ธโฃ๐๐๐๐ถ๐ป๐ฒ๐๐ ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐ :- https://pdlink.in/3ZtIZm9
5๏ธโฃ๐๐ & ๐ ๐ฎ๐ฐ๐ต๐ถ๐ป๐ฒ ๐๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด :- https://pdlink.in/4rMivIA
Don't Miss This Opportunity . Get Placement Assistance With 5000+ Companies
โค2
โ
Web Development Mock Interview Questions with Answers ๐ป๐ฏ
1๏ธโฃ Q: What is the difference between HTML and HTML5?
A: HTML5 is the latest version and supports new elements like <audio>, <video>, <canvas>, and improved semantic tags. It also supports local storage and offline capabilities.
2๏ธโฃ Q: What is the difference between == and === in JavaScript?
A: == compares values after type conversion, while === compares both value and type.
Example:
3๏ธโฃ Q: Explain the Box Model in CSS.
A: The CSS Box Model consists of:
- *Content* โ The actual text/image
- *Padding* โ Space around content
- *Border* โ Around the padding
- *Margin* โ Space outside the border
4๏ธโฃ Q: What are the different HTTP methods?
A: Common methods:
- *GET* โ Retrieve data
- *POST* โ Send data
- *PUT* โ Update existing data
- *DELETE* โ Remove data
5๏ธโฃ Q: What is the difference between null and undefined in JavaScript?
A:
-
-
6๏ธโฃ Q: What is responsive design?
A: It makes web pages look good on all devices (mobile, tablet, desktop) using CSS media queries and flexible layouts.
7๏ธโฃ Q: What is the role of JavaScript in web development?
A: JavaScript adds interactivity to web pages โ like dropdowns, sliders, form validation, etc.
8๏ธโฃ Q: What is DOM?
A: The Document Object Model represents the page structure in a tree format, allowing JavaScript to interact with and manipulate HTML/CSS dynamically.
๐ Tap โค๏ธ for more!
1๏ธโฃ Q: What is the difference between HTML and HTML5?
A: HTML5 is the latest version and supports new elements like <audio>, <video>, <canvas>, and improved semantic tags. It also supports local storage and offline capabilities.
2๏ธโฃ Q: What is the difference between == and === in JavaScript?
A: == compares values after type conversion, while === compares both value and type.
Example:
5 == '5' is true, but 5 === '5' is false.3๏ธโฃ Q: Explain the Box Model in CSS.
A: The CSS Box Model consists of:
- *Content* โ The actual text/image
- *Padding* โ Space around content
- *Border* โ Around the padding
- *Margin* โ Space outside the border
4๏ธโฃ Q: What are the different HTTP methods?
A: Common methods:
- *GET* โ Retrieve data
- *POST* โ Send data
- *PUT* โ Update existing data
- *DELETE* โ Remove data
5๏ธโฃ Q: What is the difference between null and undefined in JavaScript?
A:
-
null โ Assigned value meaning โno valueโ-
undefined โ A variable that has been declared but not assigned a value6๏ธโฃ Q: What is responsive design?
A: It makes web pages look good on all devices (mobile, tablet, desktop) using CSS media queries and flexible layouts.
7๏ธโฃ Q: What is the role of JavaScript in web development?
A: JavaScript adds interactivity to web pages โ like dropdowns, sliders, form validation, etc.
8๏ธโฃ Q: What is DOM?
A: The Document Object Model represents the page structure in a tree format, allowing JavaScript to interact with and manipulate HTML/CSS dynamically.
๐ Tap โค๏ธ for more!
โค5
๐ ๐ช๐ฎ๐ป๐ ๐๐ผ ๐๐ฒ๐ฐ๐ผ๐บ๐ฒ ๐ฎ ๐๐๐น๐น ๐ฆ๐๐ฎ๐ฐ๐ธ ๐๐ฒ๐๐ฒ๐น๐ผ๐ฝ๐ฒ๐ฟ ๐ถ๐ป ๐ฎ๐ฌ๐ฎ๐ฒ?
Tech companies are hiring developers with React, JavaScript, Node.js & MongoDB skills.
This Full Stack Development Program helps you learn everything from scratch with real projects.
๐ก Perfect for:
* Beginners
* Students
* Career switchers
๐ฅ๐ฒ๐ด๐ถ๐๐๐ฒ๐ฟ ๐ก๐ผ๐ ๐:-
https://pdlink.in/4hO7rWY
โก Donโt miss this chance to enter the high-paying tech industry!
Tech companies are hiring developers with React, JavaScript, Node.js & MongoDB skills.
This Full Stack Development Program helps you learn everything from scratch with real projects.
๐ก Perfect for:
* Beginners
* Students
* Career switchers
๐ฅ๐ฒ๐ด๐ถ๐๐๐ฒ๐ฟ ๐ก๐ผ๐ ๐:-
https://pdlink.in/4hO7rWY
โก Donโt miss this chance to enter the high-paying tech industry!
Best practices for writing SQL queries:
1- Filter Early, Aggregate Late: Apply filtering conditions in the WHERE clause early in the query, and perform aggregations in the HAVING or SELECT clauses as needed.
2- Use table aliases with columns when you are joining multiple tables.
3- Never use select *, always mention list of columns in select clause before deploying the code.
4- Add useful comments wherever you write complex logic. Avoid too many comments.
5- Use joins instead of correlated subqueries when possible for better performance.
6- Create CTEs instead of multiple sub queries, it will make your query easy to read.
7- Join tables using JOIN keywords instead of writing join condition in where clause for better readability.
8- Never use order by in sub queries, It will unnecessary increase runtime. In fact some databases don't even allow you to do that.
9- If you know there are no duplicates in 2 tables, use UNION ALL instead of UNION for better performance.
1- Filter Early, Aggregate Late: Apply filtering conditions in the WHERE clause early in the query, and perform aggregations in the HAVING or SELECT clauses as needed.
2- Use table aliases with columns when you are joining multiple tables.
3- Never use select *, always mention list of columns in select clause before deploying the code.
4- Add useful comments wherever you write complex logic. Avoid too many comments.
5- Use joins instead of correlated subqueries when possible for better performance.
6- Create CTEs instead of multiple sub queries, it will make your query easy to read.
7- Join tables using JOIN keywords instead of writing join condition in where clause for better readability.
8- Never use order by in sub queries, It will unnecessary increase runtime. In fact some databases don't even allow you to do that.
9- If you know there are no duplicates in 2 tables, use UNION ALL instead of UNION for better performance.
โค2
๐๐ฅ๐๐ ๐ข๐ป๐น๐ถ๐ป๐ฒ ๐ ๐ฎ๐๐๐ฒ๐ฟ๐ฐ๐น๐ฎ๐๐ ๐ข๐ป ๐๐ ๐๐ป๐ฑ๐๐๐๐ฟ๐ ๐๐
๐ฝ๐ฒ๐ฟ๐๐ ๐
Choose the Right Career Path in 2026
Learn โ Level Up โ Get Hired
๐ฏ Join this FREE Career Guidance Session & find:
โ The right tech career for YOU
โ Skills companies are hiring for
โ Step-by-step roadmap to get a job
๐ ๐ฆ๐ฎ๐๐ฒ ๐๐ผ๐๐ฟ ๐๐ฝ๐ผ๐ ๐ป๐ผ๐ (๐๐ถ๐บ๐ถ๐๐ฒ๐ฑ ๐๐ฒ๐ฎ๐๐)
https://pdlink.in/4sNAyhW
Date & Time :- 18th March 2026 , 7:00 PM
Choose the Right Career Path in 2026
Learn โ Level Up โ Get Hired
๐ฏ Join this FREE Career Guidance Session & find:
โ The right tech career for YOU
โ Skills companies are hiring for
โ Step-by-step roadmap to get a job
๐ ๐ฆ๐ฎ๐๐ฒ ๐๐ผ๐๐ฟ ๐๐ฝ๐ผ๐ ๐ป๐ผ๐ (๐๐ถ๐บ๐ถ๐๐ฒ๐ฑ ๐๐ฒ๐ฎ๐๐)
https://pdlink.in/4sNAyhW
Date & Time :- 18th March 2026 , 7:00 PM
SQL Interview Questions for 0-1 year of Experience (Asked in Top Product-Based Companies).
Sharpen your SQL skills with these real interview questions!
Q1. Customer Purchase Patterns -
You have two tables, Customers and Purchases: CREATE TABLE Customers ( customer_id INT PRIMARY KEY, customer_name VARCHAR(255) ); CREATE TABLE Purchases ( purchase_id INT PRIMARY KEY, customer_id INT, product_id INT, purchase_date DATE );
Assume necessary INSERT statements are already executed.
Write an SQL query to find the names of customers who have purchased more than 5 different products within the last month. Order the result by customer_name.
Q2. Call Log Analysis -
Suppose you have a CallLogs table: CREATE TABLE CallLogs ( log_id INT PRIMARY KEY, caller_id INT, receiver_id INT, call_start_time TIMESTAMP, call_end_time TIMESTAMP );
Assume necessary INSERT statements are already executed.
Write a query to find the average call duration per user. Include only users who have made more than 10 calls in total. Order the result by average duration descending.
Q3. Employee Project Allocation - Consider two tables, Employees and Projects:
CREATE TABLE Employees ( employee_id INT PRIMARY KEY, employee_name VARCHAR(255), department VARCHAR(255) ); CREATE TABLE Projects ( project_id INT PRIMARY KEY, lead_employee_id INT, project_name VARCHAR(255), start_date DATE, end_date DATE );
Assume necessary INSERT statements are already executed.
The goal is to write an SQL query to find the names of employees who have led more than 3 projects in the last year. The result should be ordered by the number of projects led.
Sharpen your SQL skills with these real interview questions!
Q1. Customer Purchase Patterns -
You have two tables, Customers and Purchases: CREATE TABLE Customers ( customer_id INT PRIMARY KEY, customer_name VARCHAR(255) ); CREATE TABLE Purchases ( purchase_id INT PRIMARY KEY, customer_id INT, product_id INT, purchase_date DATE );
Assume necessary INSERT statements are already executed.
Write an SQL query to find the names of customers who have purchased more than 5 different products within the last month. Order the result by customer_name.
Q2. Call Log Analysis -
Suppose you have a CallLogs table: CREATE TABLE CallLogs ( log_id INT PRIMARY KEY, caller_id INT, receiver_id INT, call_start_time TIMESTAMP, call_end_time TIMESTAMP );
Assume necessary INSERT statements are already executed.
Write a query to find the average call duration per user. Include only users who have made more than 10 calls in total. Order the result by average duration descending.
Q3. Employee Project Allocation - Consider two tables, Employees and Projects:
CREATE TABLE Employees ( employee_id INT PRIMARY KEY, employee_name VARCHAR(255), department VARCHAR(255) ); CREATE TABLE Projects ( project_id INT PRIMARY KEY, lead_employee_id INT, project_name VARCHAR(255), start_date DATE, end_date DATE );
Assume necessary INSERT statements are already executed.
The goal is to write an SQL query to find the names of employees who have led more than 3 projects in the last year. The result should be ordered by the number of projects led.
โค2๐1
๐๐ฟ๐ฒ๐๐ต๐ฒ๐ฟ๐ ๐๐ฎ๐ป ๐๐ฒ๐ ๐ฎ ๐ฏ๐ฌ ๐๐ฃ๐ ๐๐ผ๐ฏ ๐ข๐ณ๐ณ๐ฒ๐ฟ ๐๐ถ๐๐ต ๐๐ & ๐๐ฆ ๐๐ฒ๐ฟ๐๐ถ๐ณ๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป๐
IIT Roorkee offering AI & Data Science Certification Program
๐ซLearn from IIT ROORKEE Professors
โ Students & Fresher can apply
๐ IIT Certification Program
๐ผ 5000+ Companies Placement Support
Deadline: 22nd March 2026
๐ ๐ฅ๐ฒ๐ด๐ถ๐๐๐ฒ๐ฟ ๐ก๐ผ๐ ๐ :-
https://pdlink.in/4kucM7E
Big Opportunity, Do join asap!
IIT Roorkee offering AI & Data Science Certification Program
๐ซLearn from IIT ROORKEE Professors
โ Students & Fresher can apply
๐ IIT Certification Program
๐ผ 5000+ Companies Placement Support
Deadline: 22nd March 2026
๐ ๐ฅ๐ฒ๐ด๐ถ๐๐๐ฒ๐ฟ ๐ก๐ผ๐ ๐ :-
https://pdlink.in/4kucM7E
Big Opportunity, Do join asap!
โค1
โ
Essential Programming Acronyms You Should Know ๐ป๐ง
API โ Application Programming Interface
Set of rules allowing software apps to communicate and exchange data seamlessly.
IDE โ Integrated Development Environment
Software suite combining tools like editor, debugger, and compiler for efficient coding.
OOP โ Object-Oriented Programming
Paradigm organizing code around objects and classes for reusability and modularity.
HTML โ HyperText Markup Language
Standard markup language for structuring web pages and content.
CSS โ Cascading Style Sheets
Stylesheet language defining presentation and layout of HTML documents.
SQL โ Structured Query Language
Language for managing and manipulating relational databases.
JSON โ JavaScript Object Notation
Lightweight data-interchange format easy for humans and machines to parse.
DOM โ Document Object Model
Tree-like representation of a web page's structure for dynamic manipulation.
CRUD โ Create, Read, Update, Delete
Core database operations for managing data persistence.
SDK โ Software Development Kit
Collection of tools, libraries, and docs for building on a platform.
UI โ User Interface
Point of interaction between user and software application.
UX โ User Experience
Overall feel of the interaction with a product or service.
CLI โ Command Line Interface
Text-based interface for issuing commands to software.
HTTP โ HyperText Transfer Protocol
Foundation protocol for data communication on the web.
REST โ Representational State Transfer
Architectural style for designing scalable web APIs using standard HTTP methods.
๐ฌ Tap โค๏ธ for more!
API โ Application Programming Interface
Set of rules allowing software apps to communicate and exchange data seamlessly.
IDE โ Integrated Development Environment
Software suite combining tools like editor, debugger, and compiler for efficient coding.
OOP โ Object-Oriented Programming
Paradigm organizing code around objects and classes for reusability and modularity.
HTML โ HyperText Markup Language
Standard markup language for structuring web pages and content.
CSS โ Cascading Style Sheets
Stylesheet language defining presentation and layout of HTML documents.
SQL โ Structured Query Language
Language for managing and manipulating relational databases.
JSON โ JavaScript Object Notation
Lightweight data-interchange format easy for humans and machines to parse.
DOM โ Document Object Model
Tree-like representation of a web page's structure for dynamic manipulation.
CRUD โ Create, Read, Update, Delete
Core database operations for managing data persistence.
SDK โ Software Development Kit
Collection of tools, libraries, and docs for building on a platform.
UI โ User Interface
Point of interaction between user and software application.
UX โ User Experience
Overall feel of the interaction with a product or service.
CLI โ Command Line Interface
Text-based interface for issuing commands to software.
HTTP โ HyperText Transfer Protocol
Foundation protocol for data communication on the web.
REST โ Representational State Transfer
Architectural style for designing scalable web APIs using standard HTTP methods.
๐ฌ Tap โค๏ธ for more!
โค3
๐ข ๐๐ฒ๐ฟ๐๐ถ๐ณ๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป ๐๐น๐ฒ๐ฟ๐ โ Data Analytics with Artificial Intelligence
Upgrade your career with AI-powered data science skills.
Open for all. No Coding Background Required
๐ Learn Data Analytics with Artificial Intelligence from Scratch
๐ค AI Tools & Automation
๐ Build real world Projects for job ready portfolio
๐ E&ICT IIT Roorkee Certification Program
๐ฅDeadline :- 22nd March
๐๐ฝ๐ฝ๐น๐ ๐ก๐ผ๐ ๐ :-
https://pdlink.in/4tkErvS
Don't Miss This Opportunity. Get Placement Assistance With 5000+ Companies
Upgrade your career with AI-powered data science skills.
Open for all. No Coding Background Required
๐ Learn Data Analytics with Artificial Intelligence from Scratch
๐ค AI Tools & Automation
๐ Build real world Projects for job ready portfolio
๐ E&ICT IIT Roorkee Certification Program
๐ฅDeadline :- 22nd March
๐๐ฝ๐ฝ๐น๐ ๐ก๐ผ๐ ๐ :-
https://pdlink.in/4tkErvS
Don't Miss This Opportunity. Get Placement Assistance With 5000+ Companies
โค2
๐ฏ ๐ป Coding Interview Questions (With Answers)
๐ง 1๏ธโฃ Tell me about yourself
โ Sample Answer:
"I have 4+ years as a software engineer specializing in full-stack development and algorithms. I've built scalable systems handling 1M+ daily users at a fintech startup using MERN stack and microservices. Expert in JavaScript/Python, system design, and competitive programming (LeetCode 2000+/2800). I love writing clean, testable code and optimizing for performance under scale."
๐ 2๏ธโฃ What is the difference between a stack and a queue?
โ Answer:
A stack follows LIFO (Last In, First Out) principle with operations push (add to top) and pop (remove from top). Use cases: function call stack, undo/redo features.
A queue follows FIFO (First In, First Out) with enqueue (add to rear) and dequeue (remove from front). Use cases: breadth-first search, task scheduling, printers.
Both O(1) operations with arrays/linked lists.
๐ 3๏ธโฃ What is the difference between time complexity and space complexity?
โ Answer:
Time complexity measures how runtime grows with input size n (e.g., O(nยฒ) quadratic loops).
Space complexity measures memory usage growth (e.g., O(n) array stores all elements).
Tradeoffs exist: recursion uses stack space O(n), iteration uses O(1). Always analyze both.
๐ง 4๏ธโฃ How do you find duplicates in an array?
โ Answer:
Optimal: Hash Set O(n) time/space
๐ 5๏ธโฃ What is binary search and when would you use it?
โ Answer:
Binary search finds target in sorted array in O(log n) by repeatedly dividing search interval in half:
mid = (left + right) / 2
If arr[mid] == target return mid
If arr[mid] < target search right half
Else search left half
Use when: Data naturally sorted or sorting cost acceptable. Iterative version avoids recursion stack overflow.
๐ 6๏ธโฃ How do you reverse a linked list?
โ Answer:
Iterative O(n) solution flipping next pointers:
๐ 7๏ธโฃ What is recursion and why is the base case important?
โ Answer:
Recursion is a function calling itself with modified arguments until base case stops it. Without base case โ stack overflow.
Example Fibonacci:
๐ 8๏ธโฃ How do you merge two sorted arrays?
โ Answer:
Two-pointer technique O(n+m):
๐ง 9๏ธโฃ How do you detect a cycle in a linked list?
โ Answer:
Floyd's Tortoise & Hare: Slow moves 1 step, fast moves 2. If they meet โ cycle.
To find start: Reset slow to head, move both 1 step until meet.
Double Tap โค๏ธ For More
๐ง 1๏ธโฃ Tell me about yourself
โ Sample Answer:
"I have 4+ years as a software engineer specializing in full-stack development and algorithms. I've built scalable systems handling 1M+ daily users at a fintech startup using MERN stack and microservices. Expert in JavaScript/Python, system design, and competitive programming (LeetCode 2000+/2800). I love writing clean, testable code and optimizing for performance under scale."
๐ 2๏ธโฃ What is the difference between a stack and a queue?
โ Answer:
A stack follows LIFO (Last In, First Out) principle with operations push (add to top) and pop (remove from top). Use cases: function call stack, undo/redo features.
A queue follows FIFO (First In, First Out) with enqueue (add to rear) and dequeue (remove from front). Use cases: breadth-first search, task scheduling, printers.
Both O(1) operations with arrays/linked lists.
๐ 3๏ธโฃ What is the difference between time complexity and space complexity?
โ Answer:
Time complexity measures how runtime grows with input size n (e.g., O(nยฒ) quadratic loops).
Space complexity measures memory usage growth (e.g., O(n) array stores all elements).
Tradeoffs exist: recursion uses stack space O(n), iteration uses O(1). Always analyze both.
๐ง 4๏ธโฃ How do you find duplicates in an array?
โ Answer:
Optimal: Hash Set O(n) time/space
function findDuplicates(arr) {
const seen = new Set();
const dups = new Set();
for (let num of arr) {
if (seen.has(num)) dups.add(num);
else seen.add(num);
}
return Array.from(dups);
}
Space optimized: Sort O(n log n) then scan adjacent equals.๐ 5๏ธโฃ What is binary search and when would you use it?
โ Answer:
Binary search finds target in sorted array in O(log n) by repeatedly dividing search interval in half:
mid = (left + right) / 2
If arr[mid] == target return mid
If arr[mid] < target search right half
Else search left half
Use when: Data naturally sorted or sorting cost acceptable. Iterative version avoids recursion stack overflow.
๐ 6๏ธโฃ How do you reverse a linked list?
โ Answer:
Iterative O(n) solution flipping next pointers:
function reverseList(head) {
let prev = null, curr = head;
while (curr) {
let nextTemp = curr.next;
curr.next = prev;
prev = curr;
curr = nextTemp;
}
return prev;
}
Recursive: reverseList(curr.next).then(curr.next.prev = curr, curr.next = null).๐ 7๏ธโฃ What is recursion and why is the base case important?
โ Answer:
Recursion is a function calling itself with modified arguments until base case stops it. Without base case โ stack overflow.
Example Fibonacci:
function fib(n) {
if (n <= 1) return n; // Base case
return fib(n-1) + fib(n-2);
}
Memoization optimizes overlapping subproblems.๐ 8๏ธโฃ How do you merge two sorted arrays?
โ Answer:
Two-pointer technique O(n+m):
function mergeSorted(a1, a2) {
let i=0, j=0, result = [];
while (i < a1.length && j < a2.length) {
if (a1[i] < a2[j]) result.push(a1[i++]);
else result.push(a2[j++]);
}
return result.concat(a1.slice(i)).concat(a2.slice(j));
}
Handles unequal lengths cleanly.๐ง 9๏ธโฃ How do you detect a cycle in a linked list?
โ Answer:
Floyd's Tortoise & Hare: Slow moves 1 step, fast moves 2. If they meet โ cycle.
To find start: Reset slow to head, move both 1 step until meet.
function hasCycle(head) {
let slow = head, fast = head;
while (fast && fast.next) {
slow = slow.next;
fast = fast.next.next;
if (slow === fast) return true;
}
return false;
}
Double Tap โค๏ธ For More
โค6