Format: 90 minutes | 3 DSA + 1 SQL
We had a table with columns:
(product_id, department, cost, product_name)Task:
Print product_name, department, max(cost) for each department.
Example:
Input table:
product_id | department | cost | product_name
---------------------------------------------
1 | Toys | 200 | Car
2 | Toys | 300 | Doll
3 | Electronics| 800 | Phone
4 | Electronics| 1200 | LaptopOutput:
product_name | department | max_cost
-------------------------------------
Doll | Toys | 300
Laptop | Electronics | 1200S.Example:
S = "apple"
words = ["aple", "maple", "apply", "orange"]
Minimum distance → "aple"Example:
Grid =
1 3 3
2 1 4
0 6 4
Max gold = 12 (path: 2 → 6 → 4)Example:
arr = [1, 2, 1, 2, 1], K = 2
Valid subarrays count = (many subarrays like [1,2,1], [1,2,1,2], [2,1,2] …)✅ Hope this helps anyone preparing for Goto OA!