Programming Quiz Channel
الذهاب إلى القناة على Telegram
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
إظهار المزيد790
المشتركون
+124 ساعات
+77 أيام
+1530 أيام
أرشيف المشاركات
What is the primary advantage of a hash map over a balanced binary search tree for key-value storage?
What does the 'volatile' keyword guarantee for a Java field?
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())What is a primary key's main purpose in a relational table?
Which of these creates a shallow copy of a list in Python?
What is the practical difference between Object.is(NaN, NaN) and NaN === NaN?
Which isolation level allows a transaction to read data another concurrent transaction has written but not yet committed?
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())Why is wrapping both UPDATEs in a single transaction important here?
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:
for i in range(5):
if i == 3:
continue
print(i)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);
}
}