Daily Coding Quiz: Tuesday, 27 October 2026
All 10 coding questions with answers and explanations. 4 players took part.
Which problem is a classic use of the two-pointer technique on a sorted array?
DSA · easy · 25% of players got it right
- Find two numbers that add up to a target
- Find the median of a stream
- Detect a cycle in a graph
- Find all permutations
Answer: A. Find two numbers that add up to a target
Explanation: Start one pointer at each end: if the sum is too small move the left pointer right, if too big move the right pointer left. O(n) total.
Which JOIN returns every row from the left table, with NULLs where there is no match on the right?
SQL · easy · 75% of players got it right
- INNER JOIN
- LEFT JOIN
- CROSS JOIN
- SELF JOIN
Answer: B. LEFT JOIN
Explanation: LEFT (OUTER) JOIN keeps all left rows. INNER JOIN keeps only rows that match on both sides.
What does this return?
SQL · easy · 50% of players got it right
SELECT name FROM employees WHERE name LIKE 'M%'; -- names: Asha, Ravi, Meera, Kabir, Neha- Meera
- Meera, Neha
- Asha, Meera
- No rows
Answer: A. Meera
Explanation: 'M%' matches names starting with M. % is any run of characters and _ is exactly one.
The recurrence T(n) = 2T(n/2) + O(n) solves to:
DSA · medium · 25% of players got it right
- O(n)
- O(n log n)
- O(n²)
- O(log n)
Answer: B. O(n log n)
Explanation: This is merge sort: log n levels of recursion, each doing O(n) total work. Master theorem case 2.
Table A has 3 rows and table B has 4 rows. How many rows does SELECT * FROM A CROSS JOIN B return?
SQL · medium · 25% of players got it right
- 7
- 12
- 4
- 3
Answer: B. 12
Explanation: A cross join pairs every row of A with every row of B: 3 × 4 = 12 (a Cartesian product).
Which statements are true about a VIEW? (Select all that apply)
SQL · medium · 25% of players got it right
- It is a stored query
- By default it does not store a copy of the data
- It always makes queries faster
- It can hide columns from users
Answer: A. It is a stored query; B. By default it does not store a copy of the data; D. It can hide columns from users
Explanation: A view is a named SELECT that runs when queried, so it is not automatically faster (materialized views, which store results, are a different feature). Views are often used to expose only some columns.
What does this return?
SQL · medium · 25% of players got it right
-- Table employees(id, name, dept, salary): -- (1, Asha, Eng, 90) -- (2, Ravi, Eng, 70) -- (3, Meera, Sales, 60) -- (4, Kabir, Sales, 60) -- (5, Neha, HR, NULL) SELECT dept, COUNT(*) AS n FROM employees GROUP BY dept HAVING COUNT(*) > 1 ORDER BY dept;- Eng 2, Sales 2
- Eng 2, HR 1, Sales 2
- Sales 2
- Eng 2
Answer: A. Eng 2, Sales 2
Explanation: Eng and Sales have 2 employees each; HR has 1 and is filtered out by HAVING.
With union by rank and path compression, the amortised cost of a Union-Find operation is:
DSA · hard · 50% of players got it right
- O(log n)
- O(α(n)), inverse Ackermann
- O(√n)
- O(1) worst case
Answer: B. O(α(n)), inverse Ackermann
Explanation: Tarjan proved the amortised bound is O(α(n)); α grows so slowly it is ≤ 4 for any practical n, but it is not strictly constant.
What does this recursive CTE return?
SQL · hard · 50% of players got it right
WITH RECURSIVE n(x) AS ( SELECT 1 UNION ALL SELECT x * 2 FROM n WHERE x < 20 ) SELECT SUM(x) FROM n;- 31
- 63
- 30
- 62
Answer: B. 63
Explanation: Rows: 1, 2, 4, 8, 16, then 32 (16 < 20 still passes, producing 32; 32 stops the recursion). 1+2+4+8+16+32 = 63.
What does this return?
SQL · hard · 50% of players got it right
SELECT * FROM a WHERE id NOT IN (SELECT a_id FROM b); -- a.id: 1, 2, 3 -- b.a_id: 1, NULL- 2, 3
- No rows
- 1
- 1, 2, 3
Answer: B. No rows
Explanation: id NOT IN (1, NULL) means id <> 1 AND id <> NULL. Comparing with NULL is unknown, so no row qualifies. NOT EXISTS does not have this trap.
Top 10
- Sathvik S A: 206 points (8/10)
- Sneha Pal: 138 points (6/10)
- Nitin Singh: 26 points (2/10)
- Devika Srivastava: 0 points (0/10)