Programming Quiz Channel
795 subscribers
81 photos
4 videos
1 file
Programming quizzes and knowledge tests

Short quizzes on programming, logic and computer science.

Test and improve your coding knowledge.
Join 👉 https://rebrand.ly/bigdatachannels

DMCA: @disclosure_bds
Contact: @mldatascientist
Download Telegram
Which collection interface in Java does not allow duplicate elements?
Anonymous Quiz
15%
List
70%
Set
7%
Map
7%
Queue
Which Python keyword defines a named function?
Anonymous Quiz
3%
func
93%
def
0%
function
3%
lambda
Topic: Java

🔍 Quick look before the question:

public class Test {
static int counter = 0;

static synchronized void increment() {
counter++;
}

public static void main(String[] args) throws InterruptedException {
Thread t1 = new Thread(() -> {
for (int i = 0; i < 1000; i++) increment();
});
Thread t2 = new Thread(() -> {
for (int i = 0; i < 1000; i++) increment();
});
t1.start(); t2.start();
t1.join(); t2.join();
System.out.println(counter);
}
}
In Python, what is the result of 3 ** 2?
Anonymous Quiz
15%
6
81%
9
4%
5
0%
8
Topic: Debugging & Code Output

🔍 Quick look before the question:

for i in range(5):
if i == 3:
continue
print(i)
What gets printed?
Anonymous Quiz
13%
0 1 2 3 4
61%
0 1 2 4
13%
0 1 2
13%
3
Topic: SQL

🔍 Quick look before the question:

BEGIN TRANSACTION;
UPDATE accounts SET balance = balance - 200 WHERE id = 1;
UPDATE accounts SET balance = balance + 200 WHERE id = 2;
COMMIT;
Topic: Debugging & Code Output

🔍 Quick look before the question:

def outer():
result = []
for i in range(3):
def inner():
return i
result.append(inner)
return [f() for f in result]

print(outer())
Which isolation level allows a transaction to read data another concurrent transaction has written but not yet committed?
Anonymous Quiz
15%
Serializable
17%
Repeatable Read
19%
Read Committed
49%
Read Uncommitted
What is the practical difference between Object.is(NaN, NaN) and NaN === NaN?
Anonymous Quiz
5%
Both return false
0%
Both return true
89%
Object.is returns true, === returns false, because === treats NaN as never equal to itself
5%
Object.is throws an error for NaN
Which of these creates a shallow copy of a list in Python?
Anonymous Quiz
0%
list2 = list1
63%
list2 = list1.copy()
26%
list2 = list1[:]
11%
Both B and C
Topic: Python

🔍 Quick look before the question:

def outer():
x = 10
def inner():
nonlocal x
x += 5
return x
return inner

f = outer()
print(f())
print(f())