Coding Interview Preparation
5.85K subscribers
500 photos
2 videos
118 files
176 links
Coding interview preparation for software engineers

Interview questions, DSA, clean solutions.
Join πŸ‘‰ https://rebrand.ly/bigdatachannels

Buy ads: https://telega.io/c/coding_interview_preparation

DMCA: @disclosure_bds
Contact: @mldatascientist
Download Telegram
If you’re a fresher and you’re in 3rd/4th year but still don’t know coding, don’t start with LeetCode Hard.

Get these questions down first. A lot of service-based companies test these basic coding problems in fresher interviews:

1. Reverse a string without using a built-in reverse function
2. Check whether a string or number is a palindrome
3. Find the largest and smallest element in an array
4. Find duplicate elements in an array
5. Find the second-largest element without sorting
6. Check whether a number is prime
7. Print the first N Fibonacci numbers
8. Find factorial using recursion
9. Check whether two strings are anagrams
10. Count the frequency of each character in a string
11. Find the missing number from 1 to N
12. Find two numbers whose sum equals a target

You don’t need to know everything.

Try to solve these confidently first.
Most Asked Topics in SQL Interviews
5 DSA Patterns in Coding Interviews.pdf
689.7 KB
5 DSA Patterns in Coding Interviews
πŸ‘1
πŸ”₯ SQL Interview Case Studies (Advanced Business Scenarios)

🧠 Case Study 1: Find Repeat Customers
πŸ“Š Orders Table
order_id customer_id
1 101
2 102
3 101

❓ Business Question
Find customers who placed more than 1 order.

βœ… Solution
SELECT customer_id,
COUNT(*) AS total_orders
FROM orders
GROUP BY customer_id
HAVING COUNT(*) > 1;

🧠 Case Study 2: Highest Paid Employee Per Department
❓ Business Question
Find highest paid employee in every department.

βœ… Solution
WITH RankedEmployees AS (
SELECT *,
ROW_NUMBER() OVER(
PARTITION BY department
ORDER BY salary DESC
) rn
FROM employees
)
SELECT *
FROM RankedEmployees
WHERE rn = 1;

🧠 Case Study 3: Find Inactive Customers
❓ Business Question
Customers who haven't ordered in the last 6 months.

βœ… Solution
SELECT c.customer_id,
c.name
FROM customers c
LEFT JOIN orders o
ON c.customer_id = o.customer_id
GROUP BY c.customer_id, c.name
HAVING MAX(o.order_date) <
DATE_SUB(CURDATE(), INTERVAL 6 MONTH);

🧠 Case Study 4: Product Generating Highest Revenue
πŸ“Š Sales Table
product_id amount

βœ… Solution
SELECT product_id,
SUM(amount) AS revenue
FROM sales
GROUP BY product_id
ORDER BY revenue DESC
LIMIT 1;

🧠 Case Study 5: Employee Salary Above Department Average

βœ… Solution
WITH DeptAvg AS (
SELECT department,
AVG(salary) avg_salary
FROM employees
GROUP BY department
)

SELECT e.*
FROM employees e
JOIN DeptAvg d
ON e.department = d.department
WHERE e.salary > d.avg_salary;

🧠 Case Study 6: Running Total Sales
❓ Business Question
Calculate cumulative sales.

βœ… Solution
SELECT order_date,
amount,
SUM(amount) OVER(
ORDER BY order_date
) AS running_total
FROM sales;

🧠 Case Study 7: Top 3 Products Per Category

βœ… Solution
WITH RankedProducts AS (
SELECT *,
ROW_NUMBER() OVER(
PARTITION BY category
ORDER BY sales DESC
) rn
FROM products
)
SELECT *
FROM RankedProducts
WHERE rn <= 3;

🎯 Practice Tasks
1️⃣ Find customer with highest number of orders
2️⃣ Find lowest salary employee per department
3️⃣ Find products never sold
4️⃣ Find departments with average salary > company average
5️⃣ Find month with lowest sales

⚑️ Mini Challenge πŸ”₯
Banking Scenario
Tables:
Accounts
account_id customer_name

Transactions
transaction_id account_id amount transaction_date

Question
πŸ‘‰ Find the top 3 customers with highest total transaction amount in the last 1 year.

πŸ”₯ Interview Tip
When solving case studies:
1️⃣ Understand business question
2️⃣ Identify tables
3️⃣ Identify JOINs
4️⃣ Identify Aggregations
5️⃣ Decide whether Window Function is needed
JavaScript Interview Questions

These are some of the most important JavaScript interview questions every developer should know, from closures and hoisting to promises, async/await, CORS, debouncing, throttling, and more.