Daily Coding Quiz: Monday, 2 November 2026
All 10 coding questions with answers and explanations. 0 players took part.
Which of these is a stable sorting algorithm by default?
DSA · easy · 100% of players got it right
- Quick sort
- Heap sort
- Merge sort
- Selection sort
Answer: C. Merge sort
Explanation: Merge sort keeps equal elements in their original order (take from the left half on ties). Standard quick, heap and selection sort do not.
What is printed?
Python · easy · 0% of players got it right
s = "Python" print(s[-1], s[::-1])- n nohtyP
- P nohtyP
- n Python
- nohtyP n
Answer: A. n nohtyP
Explanation: s[-1] is the last character; a step of −1 walks the string backwards, reversing it.
Which keyword creates a generator function?
Python · easy · 100% of players got it right
- return
- yield
- async
- lambda
Answer: B. yield
Explanation: A function containing yield returns a generator: it produces values lazily, pausing at each yield.
Floyd’s “tortoise and hare” algorithm is mainly used to:
DSA · medium · 0% of players got it right
- Sort a linked list
- Detect a cycle in a linked list
- Reverse a linked list
- Merge two sorted lists
Answer: B. Detect a cycle in a linked list
Explanation: One pointer moves 1 step, the other 2. If there is a cycle the fast pointer eventually meets the slow one; if not, it reaches the end.
What is printed?
Python · medium · 0% of players got it right
a = [1, 2, 3] b = a b += [4] print(a)- [1, 2, 3]
- [1, 2, 3, 4]
- [4]
- An error
Answer: B. [1, 2, 3, 4]
Explanation: b = a makes both names point to the same list, and += on a list extends it in place, so a sees the change.
What is printed?
Python · medium · 0% of players got it right
from collections import Counter c = Counter("mississippi") print(c.most_common(2))- [('i', 4), ('s', 4)]
- [('s', 4), ('i', 4)]
- [('i', 4), ('p', 2)]
- [('m', 1), ('i', 4)]
Answer: A. [('i', 4), ('s', 4)]
Explanation: i and s both appear 4 times. Ties keep the order in which elements were first seen, and i (index 1) appears before s (index 2).
What is printed?
Python · medium · 0% of players got it right
a = [[0] * 2] * 2 a[0][0] = 1 print(a)- [[1, 0], [0, 0]]
- [[1, 0], [1, 0]]
- [[1, 1], [0, 0]]
- An error
Answer: B. [[1, 0], [1, 0]]
Explanation: * 2 on the outer list copies the reference, so both rows are the same list object. Use [[0] * 2 for _ in range(2)] for independent rows.
What is the time complexity of the classic dynamic-programming solution to the Longest Common Subsequence of strings of length m and n?
DSA · hard · 0% of players got it right
- O(m + n)
- O(m · n)
- O(2^(m+n))
- O((m + n) log(m + n))
Answer: B. O(m · n)
Explanation: The DP table has (m+1)(n+1) cells and each is filled in O(1) from its neighbours.
What is printed?
Python · hard · 0% of players got it right
def deco(fn): def wrap(*a): return fn(*a) * 2 return wrap @deco @deco def three(): return 3 print(three())- 6
- 9
- 12
- 3
Answer: C. 12
Explanation: Stacked decorators apply bottom-up: three = deco(deco(three)). The inner wrapper doubles 3 to 6, the outer doubles that to 12.
What is printed?
Python · hard · 0% of players got it right
x = [1, 2, 3] y = x[:] z = x x.append(4) print(len(y), len(z), y is x, z is x)- 3 4 False True
- 4 4 False True
- 3 3 True True
- 4 4 True True
Answer: A. 3 4 False True
Explanation: x[:] makes a shallow copy (a new list), so y keeps 3 items. z is just another name for x.
Top 10
- Sriharini Kalidas: 24 points (2/10)