Python Interview Questions
โค2
๐ด ๐ฆ๐ธ๐ถ๐น๐น๐ ๐ง๐ผ ๐ ๐ฎ๐๐๐ฒ๐ฟ ๐๐ฒ๐ณ๐ผ๐ฟ๐ฒ ๐๐ป๐๐ฒ๐ฟ๐ถ๐ป๐ด ๐๐ป๐๐ผ ๐ฎ๐ฌ๐ฎ๐ฒ๐
- Python Programming
- Data Analytics
- ChatGPT
- Data Visualization With Power BI
- Generative AI
- Data Science
- Tableau
- Java & SQL
๐ฆ๐๐ฎ๐ฟ๐ ๐ก๐ผ๐๐:-
https://pdlink.in/4m3FwTX
Learn Online | Get Certified With Pro Courses๐
- Python Programming
- Data Analytics
- ChatGPT
- Data Visualization With Power BI
- Generative AI
- Data Science
- Tableau
- Java & SQL
๐ฆ๐๐ฎ๐ฟ๐ ๐ก๐ผ๐๐:-
https://pdlink.in/4m3FwTX
Learn Online | Get Certified With Pro Courses๐
๐1๐1
โ
Complete Coding Interview Roadmap โ What You MUST Know ๐จโ๐ป๐ผ
Whether you're preparing for FAANG or startups, here's everything you need to crack coding interviews in 2025:
๐ฐ 1. Programming Language Mastery
Choose one (C++, Java, Python) & master:
- Syntax & built-in functions
- Time & space complexity
- Object-oriented programming
- Recursion, Iterative logic
๐ 2. Data Structures
Understand how they work + when to use them:
- Arrays & Strings
- Linked Lists (Singly, Doubly)
- Stacks & Queues
- Hash Maps / Hash Tables
- Trees (Binary, BST, Trie)
- Graphs (Adjacency List/Matrix)
- Heaps & Priority Queues
โ๏ธ 3. Algorithms
Key to solving problems efficiently:
- Sorting & Searching (Binary Search, Merge/Quick Sort)
- Recursion & Backtracking
- Sliding Window, Two Pointers
- Greedy & Divide and Conquer
- Dynamic Programming (0/1 Knapsack, LIS, etc.)
- Graph Algorithms (DFS, BFS, Dijkstraโs, Topological Sort)
- Bit Manipulation
๐ฌ 4. Problem Solving Practice
Use platforms like:
- LeetCode (Top 150/Blind 75)
- HackerRank / Codeforces
- InterviewBit / GFG
๐ก 5. System Design (For 3+ years experience)
- High-level design (scalability, availability, latency)
- Components: Load Balancer, Database, Caching, Message Queues
- Design examples: URL Shortener, Instagram, Chat App
- Use tools like draw.io or Excalidraw to visualize designs
๐ง 6. Behavioral + HR Round Prep
Prepare STAR-based answers for:
- "Tell me about yourself"
- "Biggest challenge you faced"
- "Why do you want to join us?"
- "Teamwork, leadership, conflict"
๐ 7. Resume & Portfolio
- Keep it ONE page
- Highlight impact, not tasks
- Add GitHub, LinkedIn, Portfolio links
- Projects that use real-world APIs or solve real problems
๐ 8. Mock Interviews & Feedback
- Practice with peers, mentors or platforms like Pramp / Interviewing.io
- Get feedback on approach, not just correctness
๐ฏ Tips:
- Stay consistent (1โ2 hours daily)
- Focus on patterns, not just solutions
- Keep track of mistakes & revise weekly
- Rest before interviews โ donโt cram
๐ Tap โค๏ธ for more!
Whether you're preparing for FAANG or startups, here's everything you need to crack coding interviews in 2025:
๐ฐ 1. Programming Language Mastery
Choose one (C++, Java, Python) & master:
- Syntax & built-in functions
- Time & space complexity
- Object-oriented programming
- Recursion, Iterative logic
๐ 2. Data Structures
Understand how they work + when to use them:
- Arrays & Strings
- Linked Lists (Singly, Doubly)
- Stacks & Queues
- Hash Maps / Hash Tables
- Trees (Binary, BST, Trie)
- Graphs (Adjacency List/Matrix)
- Heaps & Priority Queues
โ๏ธ 3. Algorithms
Key to solving problems efficiently:
- Sorting & Searching (Binary Search, Merge/Quick Sort)
- Recursion & Backtracking
- Sliding Window, Two Pointers
- Greedy & Divide and Conquer
- Dynamic Programming (0/1 Knapsack, LIS, etc.)
- Graph Algorithms (DFS, BFS, Dijkstraโs, Topological Sort)
- Bit Manipulation
๐ฌ 4. Problem Solving Practice
Use platforms like:
- LeetCode (Top 150/Blind 75)
- HackerRank / Codeforces
- InterviewBit / GFG
๐ก 5. System Design (For 3+ years experience)
- High-level design (scalability, availability, latency)
- Components: Load Balancer, Database, Caching, Message Queues
- Design examples: URL Shortener, Instagram, Chat App
- Use tools like draw.io or Excalidraw to visualize designs
๐ง 6. Behavioral + HR Round Prep
Prepare STAR-based answers for:
- "Tell me about yourself"
- "Biggest challenge you faced"
- "Why do you want to join us?"
- "Teamwork, leadership, conflict"
๐ 7. Resume & Portfolio
- Keep it ONE page
- Highlight impact, not tasks
- Add GitHub, LinkedIn, Portfolio links
- Projects that use real-world APIs or solve real problems
๐ 8. Mock Interviews & Feedback
- Practice with peers, mentors or platforms like Pramp / Interviewing.io
- Get feedback on approach, not just correctness
๐ฏ Tips:
- Stay consistent (1โ2 hours daily)
- Focus on patterns, not just solutions
- Keep track of mistakes & revise weekly
- Rest before interviews โ donโt cram
๐ Tap โค๏ธ for more!
โค8
๐จ๐ป๐น๐ผ๐ฐ๐ธ ๐ข๐ฝ๐ฝ๐ผ๐ฟ๐๐๐ป๐๐ถ๐ฒ๐ ๐ช๐๐๐ต ๐ฑ๐ฌ๐ฌ+ ๐๐ถ๐ฟ๐ถ๐ป๐ด ๐ฃ๐ฎ๐ฟ๐๐ป๐ฒ๐ฟ๐ ๐
Learn coding from the Top 1% of the Tech industry
๐๐ถ๐ด๐ต๐น๐ถ๐ด๐ต๐๐ฒ๐:-
- Pay After Placement
- 60+ Hiring Drives Every Month
๐๐ผ๐ผ๐ธ ๐ฎ ๐๐ฅ๐๐ ๐๐ฒ๐บ๐ผ๐:-
Online:- https://pdlink.in/4hO7rWY
๐น Hyderabad :- https://pdlink.in/4cJUWtx
๐น Pune :- https://pdlink.in/3YA32zi
๐น Noida :- https://linkpd.in/NoidaFSD
Hurry Up๐โโ๏ธ.....Limited Slots Available
Learn coding from the Top 1% of the Tech industry
๐๐ถ๐ด๐ต๐น๐ถ๐ด๐ต๐๐ฒ๐:-
- Pay After Placement
- 60+ Hiring Drives Every Month
๐๐ผ๐ผ๐ธ ๐ฎ ๐๐ฅ๐๐ ๐๐ฒ๐บ๐ผ๐:-
Online:- https://pdlink.in/4hO7rWY
๐น Hyderabad :- https://pdlink.in/4cJUWtx
๐น Pune :- https://pdlink.in/3YA32zi
๐น Noida :- https://linkpd.in/NoidaFSD
Hurry Up๐โโ๏ธ.....Limited Slots Available
โค3
๐ฏ The Only SQL You Actually Need For Your First Data Analytics Job
๐ซ Avoid the Learning Trap:
Watching 100+ tutorials but no hands-on practice.
โ Reality:
75% of real SQL work boils down to these essentials:
1๏ธโฃ SELECT, FROM, WHERE
โฆ Pick columns, tables, and filter rows
2๏ธโฃ JOINs
โฆ Combine related tables (INNER JOIN, LEFT JOIN)
3๏ธโฃ GROUP BY
โฆ Aggregate data by groups
4๏ธโฃ ORDER BY
โฆ Sort results ascending or descending
5๏ธโฃ Aggregation Functions
โฆ COUNT(), SUM(), AVG(), MIN(), MAX()
6๏ธโฃ ROW_NUMBER()
โฆ Rank rows within partitions
๐ก Final Tip:
Master these basics well, practice hands-on, and build up confidence!
Double Tap โฅ๏ธ For More
๐ซ Avoid the Learning Trap:
Watching 100+ tutorials but no hands-on practice.
โ Reality:
75% of real SQL work boils down to these essentials:
1๏ธโฃ SELECT, FROM, WHERE
โฆ Pick columns, tables, and filter rows
SELECT name, age FROM customers WHERE age > 30;
2๏ธโฃ JOINs
โฆ Combine related tables (INNER JOIN, LEFT JOIN)
SELECT o.id, c.name FROM orders o JOIN customers c ON o.customer_id = c.id;
3๏ธโฃ GROUP BY
โฆ Aggregate data by groups
SELECT country, COUNT(*) FROM users GROUP BY country;
4๏ธโฃ ORDER BY
โฆ Sort results ascending or descending
SELECT name, score FROM students ORDER BY score DESC;
5๏ธโฃ Aggregation Functions
โฆ COUNT(), SUM(), AVG(), MIN(), MAX()
SELECT AVG(salary) FROM employees;
6๏ธโฃ ROW_NUMBER()
โฆ Rank rows within partitions
SELECT name,
ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS rank
FROM employees;
๐ก Final Tip:
Master these basics well, practice hands-on, and build up confidence!
Double Tap โฅ๏ธ For More
โค8
โ
Step-by-Step Approach to Learn Programming ๐ป๐
โ Pick a Programming Language
Start with beginner-friendly languages that are widely used and have lots of resources.
โ Python โ Great for beginners, versatile (web, data, automation)
โ JavaScript โ Perfect for web development
โ C++ / Java โ Ideal if you're targeting DSA or competitive programming
Goal: Be comfortable with syntax, writing small programs, and using an IDE.
โ Learn Basic Programming Concepts
Understand the foundational building blocks of coding:
โ Variables, data types
โ Input/output
โ Loops (for, while)
โ Conditional statements (if/else)
โ Functions and scope
โ Error handling
Tip: Use visual platforms like W3Schools, freeCodeCamp, or Sololearn.
โ Understand Data Structures & Algorithms (DSA)
โ Arrays, Strings
โ Linked Lists, Stacks, Queues
โ Hash Maps, Sets
โ Trees, Graphs
โ Sorting & Searching
โ Recursion, Greedy, Backtracking
โ Dynamic Programming
Use GeeksforGeeks, NeetCode, or Striver's DSA Sheet.
โ Practice Problem Solving Daily
โ LeetCode (real interview Qs)
โ HackerRank (step-by-step)
โ Codeforces / AtCoder (competitive)
Goal: Focus on logic, not just solutions.
โ Build Mini Projects
โ Calculator
โ To-do list app
โ Weather app (using APIs)
โ Quiz app
โ Rock-paper-scissors game
Projects solidify your concepts.
โ Learn Git & GitHub
โ Initialize a repo
โ Commit & push code
โ Branch and merge
โ Host projects on GitHub
Must-have for collaboration.
โ Learn Web Development Basics
โ HTML โ Structure
โ CSS โ Styling
โ JavaScript โ Interactivity
Then explore:
โ React.js
โ Node.js + Express
โ MongoDB / MySQL
โ Choose Your Career Path
โ Web Dev (Frontend, Backend, Full Stack)
โ App Dev (Flutter, Android)
โ Data Science / ML
โ DevOps / Cloud (AWS, Docker)
โ Work on Real Projects & Internships
โ Build a portfolio
โ Clone real apps (Netflix UI, Amazon clone)
โ Join hackathons
โ Freelance or open source
โ Apply for internships
โ Stay Updated & Keep Improving
โ Follow GitHub trends
โ Dev YouTube channels (Fireship, etc.)
โ Tech blogs (Dev.to, Medium)
โ Communities (Discord, Reddit, X)
๐ฏ Remember:
โข Consistency > Intensity
โข Learn by building
โข Debugging is learning
โข Track progress weekly
Useful WhatsApp Channels to Learn Programming Languages
Python Programming: https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L
JavaScript: https://whatsapp.com/channel/0029VavR9OxLtOjJTXrZNi32
C++ Programming: https://whatsapp.com/channel/0029VbBAimF4dTnJLn3Vkd3M
Java Programming: https://whatsapp.com/channel/0029VamdH5mHAdNMHMSBwg1s
๐ React โฅ๏ธ for more
โ Pick a Programming Language
Start with beginner-friendly languages that are widely used and have lots of resources.
โ Python โ Great for beginners, versatile (web, data, automation)
โ JavaScript โ Perfect for web development
โ C++ / Java โ Ideal if you're targeting DSA or competitive programming
Goal: Be comfortable with syntax, writing small programs, and using an IDE.
โ Learn Basic Programming Concepts
Understand the foundational building blocks of coding:
โ Variables, data types
โ Input/output
โ Loops (for, while)
โ Conditional statements (if/else)
โ Functions and scope
โ Error handling
Tip: Use visual platforms like W3Schools, freeCodeCamp, or Sololearn.
โ Understand Data Structures & Algorithms (DSA)
โ Arrays, Strings
โ Linked Lists, Stacks, Queues
โ Hash Maps, Sets
โ Trees, Graphs
โ Sorting & Searching
โ Recursion, Greedy, Backtracking
โ Dynamic Programming
Use GeeksforGeeks, NeetCode, or Striver's DSA Sheet.
โ Practice Problem Solving Daily
โ LeetCode (real interview Qs)
โ HackerRank (step-by-step)
โ Codeforces / AtCoder (competitive)
Goal: Focus on logic, not just solutions.
โ Build Mini Projects
โ Calculator
โ To-do list app
โ Weather app (using APIs)
โ Quiz app
โ Rock-paper-scissors game
Projects solidify your concepts.
โ Learn Git & GitHub
โ Initialize a repo
โ Commit & push code
โ Branch and merge
โ Host projects on GitHub
Must-have for collaboration.
โ Learn Web Development Basics
โ HTML โ Structure
โ CSS โ Styling
โ JavaScript โ Interactivity
Then explore:
โ React.js
โ Node.js + Express
โ MongoDB / MySQL
โ Choose Your Career Path
โ Web Dev (Frontend, Backend, Full Stack)
โ App Dev (Flutter, Android)
โ Data Science / ML
โ DevOps / Cloud (AWS, Docker)
โ Work on Real Projects & Internships
โ Build a portfolio
โ Clone real apps (Netflix UI, Amazon clone)
โ Join hackathons
โ Freelance or open source
โ Apply for internships
โ Stay Updated & Keep Improving
โ Follow GitHub trends
โ Dev YouTube channels (Fireship, etc.)
โ Tech blogs (Dev.to, Medium)
โ Communities (Discord, Reddit, X)
๐ฏ Remember:
โข Consistency > Intensity
โข Learn by building
โข Debugging is learning
โข Track progress weekly
Useful WhatsApp Channels to Learn Programming Languages
Python Programming: https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L
JavaScript: https://whatsapp.com/channel/0029VavR9OxLtOjJTXrZNi32
C++ Programming: https://whatsapp.com/channel/0029VbBAimF4dTnJLn3Vkd3M
Java Programming: https://whatsapp.com/channel/0029VamdH5mHAdNMHMSBwg1s
๐ React โฅ๏ธ for more
โค5๐1
๐ Top 10 HTML Interview Questions With Answers
1. What is HTML?
HTML (HyperText Markup Language) is the standard language used to create and design web pages. It structures content by using elements and tags.
2. What are the different types of HTML tags?
There are block-level tags (like
3. What is the difference between HTML elements and tags?
A tag is the markup itself (e.g.,
4. What are semantic HTML elements?
Semantic elements clearly describe their meaning in a human- and machine-readable way. Examples include
5. What is the purpose of the
The
6. What are the different ways to include CSS in an HTML page?
CSS can be added via inline styles (
7. What is the difference between an ID and a Class in HTML?
ID is unique within a page and is used to identify a single element, while class can be assigned to multiple elements for styling or scripting.
8. How do you create a hyperlink in HTML?
Using the
9. What are HTML forms used for?
Forms collect user input and submit data to a server for processing, with tags like
10. What is the role of the
Meta tags provide metadata about the HTML document such as character set, page description, viewport settings, and SEO info.
Double Tap โฅ๏ธ For More
1. What is HTML?
HTML (HyperText Markup Language) is the standard language used to create and design web pages. It structures content by using elements and tags.
2. What are the different types of HTML tags?
There are block-level tags (like
<div>
, <p>
, <h1>
) which start on a new line, and inline tags (like <span>
, <a>
, <img>
) which do not start on a new line.3. What is the difference between HTML elements and tags?
A tag is the markup itself (e.g.,
<p>
), while an element includes the opening tag, content, and closing tag (<p>Content</p>
).4. What are semantic HTML elements?
Semantic elements clearly describe their meaning in a human- and machine-readable way. Examples include
<header>
, <footer>
, <article>
, and <section>
.5. What is the purpose of the
doctype
declaration in HTML? The
<!DOCTYPE html>
declaration defines the document type and version of HTML, helping browsers render the page correctly.6. What are the different ways to include CSS in an HTML page?
CSS can be added via inline styles (
style
attribute), internal styles (<style>
tag inside <head>
), or external style sheets linked via <link>
tag.7. What is the difference between an ID and a Class in HTML?
ID is unique within a page and is used to identify a single element, while class can be assigned to multiple elements for styling or scripting.
8. How do you create a hyperlink in HTML?
Using the
<a>
tag with an href
attribute, e.g., <a href="https://example.com">Link</a>
.9. What are HTML forms used for?
Forms collect user input and submit data to a server for processing, with tags like
<form>
, <input>
, <textarea>
, <button>
, and more.10. What is the role of the
<meta>
tag in HTML? Meta tags provide metadata about the HTML document such as character set, page description, viewport settings, and SEO info.
Double Tap โฅ๏ธ For More
โค7
๐ฅ Ultimate Coding Interview Cheat Sheet (2025 Edition)
โ 1. Data Structures
Key Concepts:
โข Arrays/Lists
โข Strings
โข Hashmaps (Dicts)
โข Stacks & Queues
โข Linked Lists
โข Trees (BST, Binary)
โข Graphs
โข Heaps
Practice Questions:
โข Reverse a string or array
โข Detect duplicates in an array
โข Find missing number
โข Implement stack using queue
โข Traverse binary tree (Inorder, Preorder)
โ 2. Algorithms
Key Concepts:
โข Sorting (Quick, Merge, Bubble)
โข Searching (Binary search)
โข Recursion
โข Backtracking
โข Divide & Conquer
โข Greedy
โข Dynamic Programming
Practice Questions:
โข Fibonacci with DP
โข Merge sort implementation
โข N-Queens Problem
โข Knapsack problem
โข Coin change
โ 3. Problem Solving Patterns
Important Patterns:
โข Two Pointers
โข Sliding Window
โข Fast & Slow Pointer
โข Recursion + Memoization
โข Prefix Sum
โข Binary Search on answer
Practice Questions:
โข Longest Substring Without Repeat
โข Max Sum Subarray of Size K
โข Linked list cycle detection
โข Peak Element
โ 4. System Design Basics
Key Concepts:
โข Scalability, Load Balancing
โข Caching (Redis)
โข Rate Limiting
โข APIs and Databases
โข CAP Theorem
โข Consistency vs Availability
Practice Projects:
โข Design URL shortener
โข Design Twitter feed
โข Design chat system (e.g., WhatsApp)
โ 5. OOP & Programming Basics
Key Concepts:
โข Classes & Objects
โข Inheritance, Polymorphism
โข Encapsulation, Abstraction
โข SOLID Principles
Practice Projects:
โข Design a Library System
โข Implement Parking Lot
โข Bank Account Simulation
โ 6. SQL & Database Concepts
Key Concepts:
โข Joins (INNER, LEFT, RIGHT)
โข GROUP BY, HAVING
โข Subqueries
โข Window Functions
โข Indexing
Practice Queries:
โข Get top 3 salaries
โข Find duplicate emails
โข Most frequent orders per user
๐ Double Tap โฅ๏ธ For More
โ 1. Data Structures
Key Concepts:
โข Arrays/Lists
โข Strings
โข Hashmaps (Dicts)
โข Stacks & Queues
โข Linked Lists
โข Trees (BST, Binary)
โข Graphs
โข Heaps
Practice Questions:
โข Reverse a string or array
โข Detect duplicates in an array
โข Find missing number
โข Implement stack using queue
โข Traverse binary tree (Inorder, Preorder)
โ 2. Algorithms
Key Concepts:
โข Sorting (Quick, Merge, Bubble)
โข Searching (Binary search)
โข Recursion
โข Backtracking
โข Divide & Conquer
โข Greedy
โข Dynamic Programming
Practice Questions:
โข Fibonacci with DP
โข Merge sort implementation
โข N-Queens Problem
โข Knapsack problem
โข Coin change
โ 3. Problem Solving Patterns
Important Patterns:
โข Two Pointers
โข Sliding Window
โข Fast & Slow Pointer
โข Recursion + Memoization
โข Prefix Sum
โข Binary Search on answer
Practice Questions:
โข Longest Substring Without Repeat
โข Max Sum Subarray of Size K
โข Linked list cycle detection
โข Peak Element
โ 4. System Design Basics
Key Concepts:
โข Scalability, Load Balancing
โข Caching (Redis)
โข Rate Limiting
โข APIs and Databases
โข CAP Theorem
โข Consistency vs Availability
Practice Projects:
โข Design URL shortener
โข Design Twitter feed
โข Design chat system (e.g., WhatsApp)
โ 5. OOP & Programming Basics
Key Concepts:
โข Classes & Objects
โข Inheritance, Polymorphism
โข Encapsulation, Abstraction
โข SOLID Principles
Practice Projects:
โข Design a Library System
โข Implement Parking Lot
โข Bank Account Simulation
โ 6. SQL & Database Concepts
Key Concepts:
โข Joins (INNER, LEFT, RIGHT)
โข GROUP BY, HAVING
โข Subqueries
โข Window Functions
โข Indexing
Practice Queries:
โข Get top 3 salaries
โข Find duplicate emails
โข Most frequent orders per user
๐ Double Tap โฅ๏ธ For More
โค9
๐ AI Journey Contest 2025: Test your AI skills!
Join our international online AI competition. Register now for the contest! Award fund โ RUB 6.5 mln!
Choose your track:
ยท ๐ค Agent-as-Judge โ build a universal โjudgeโ to evaluate AI-generated texts.
ยท ๐ง Human-centered AI Assistant โ develop a personalized assistant based on GigaChat that mimics human behavior and anticipates preferences. Participants will receive API tokens and a chance to get an additional 1M tokens.
ยท ๐พ GigaMemory โ design a long-term memory mechanism for LLMs so the assistant can remember and use important facts in dialogue.
Why Join
Level up your skills, add a strong line to your resume, tackle pro-level tasks, compete for an award, and get an opportunity to showcase your work at AI Journey, a leading international AI conference.
How to Join
1. Register here.
2. Choose your track.
3. Create your solution and submit it by 30 October 2025.
๐ Ready for a challenge? Join a global developer community and show your AI skills!
Join our international online AI competition. Register now for the contest! Award fund โ RUB 6.5 mln!
Choose your track:
ยท ๐ค Agent-as-Judge โ build a universal โjudgeโ to evaluate AI-generated texts.
ยท ๐ง Human-centered AI Assistant โ develop a personalized assistant based on GigaChat that mimics human behavior and anticipates preferences. Participants will receive API tokens and a chance to get an additional 1M tokens.
ยท ๐พ GigaMemory โ design a long-term memory mechanism for LLMs so the assistant can remember and use important facts in dialogue.
Why Join
Level up your skills, add a strong line to your resume, tackle pro-level tasks, compete for an award, and get an opportunity to showcase your work at AI Journey, a leading international AI conference.
How to Join
1. Register here.
2. Choose your track.
3. Create your solution and submit it by 30 October 2025.
๐ Ready for a challenge? Join a global developer community and show your AI skills!
โค7๐2๐1
Here are some tricky๐งฉ SQL interview questions!
1. Find the second-highest salary in a table without using LIMIT or TOP.
2. Write a SQL query to find all employees who earn more than their managers.
3. Find the duplicate rows in a table without using GROUP BY.
4. Write a SQL query to find the top 10% of earners in a table.
5. Find the cumulative sum of a column in a table.
6. Write a SQL query to find all employees who have never taken a leave.
7. Find the difference between the current row and the next row in a table.
8. Write a SQL query to find all departments with more than one employee.
9. Find the maximum value of a column for each group without using GROUP BY.
10. Write a SQL query to find all employees who have taken more than 3 leaves in a month.
These questions are designed to test your SQL skills, including your ability to write efficient queries, think creatively, and solve complex problems.
Here are the answers to these questions:
1. SELECT MAX(salary) FROM table WHERE salary NOT IN (SELECT MAX(salary) FROM table)
2. SELECT e1.* FROM employees e1 JOIN employees e2 ON e1.manager_id = (link unavailable) WHERE e1.salary > e2.salary
3. SELECT * FROM table WHERE rowid IN (SELECT rowid FROM table GROUP BY column HAVING COUNT(*) > 1)
4. SELECT * FROM table WHERE salary > (SELECT PERCENTILE_CONT(0.9) WITHIN GROUP (ORDER BY salary) FROM table)
5. SELECT column, SUM(column) OVER (ORDER BY rowid) FROM table
6. SELECT * FROM employees WHERE id NOT IN (SELECT employee_id FROM leaves)
7. SELECT *, column - LEAD(column) OVER (ORDER BY rowid) FROM table
8. SELECT department FROM employees GROUP BY department HAVING COUNT(*) > 1
9. SELECT MAX(column) FROM table WHERE column NOT IN (SELECT MAX(column) FROM table GROUP BY group_column)
1. Find the second-highest salary in a table without using LIMIT or TOP.
2. Write a SQL query to find all employees who earn more than their managers.
3. Find the duplicate rows in a table without using GROUP BY.
4. Write a SQL query to find the top 10% of earners in a table.
5. Find the cumulative sum of a column in a table.
6. Write a SQL query to find all employees who have never taken a leave.
7. Find the difference between the current row and the next row in a table.
8. Write a SQL query to find all departments with more than one employee.
9. Find the maximum value of a column for each group without using GROUP BY.
10. Write a SQL query to find all employees who have taken more than 3 leaves in a month.
These questions are designed to test your SQL skills, including your ability to write efficient queries, think creatively, and solve complex problems.
Here are the answers to these questions:
1. SELECT MAX(salary) FROM table WHERE salary NOT IN (SELECT MAX(salary) FROM table)
2. SELECT e1.* FROM employees e1 JOIN employees e2 ON e1.manager_id = (link unavailable) WHERE e1.salary > e2.salary
3. SELECT * FROM table WHERE rowid IN (SELECT rowid FROM table GROUP BY column HAVING COUNT(*) > 1)
4. SELECT * FROM table WHERE salary > (SELECT PERCENTILE_CONT(0.9) WITHIN GROUP (ORDER BY salary) FROM table)
5. SELECT column, SUM(column) OVER (ORDER BY rowid) FROM table
6. SELECT * FROM employees WHERE id NOT IN (SELECT employee_id FROM leaves)
7. SELECT *, column - LEAD(column) OVER (ORDER BY rowid) FROM table
8. SELECT department FROM employees GROUP BY department HAVING COUNT(*) > 1
9. SELECT MAX(column) FROM table WHERE column NOT IN (SELECT MAX(column) FROM table GROUP BY group_column)