In JavaScript, what is a Promise primarily used for?
Anonymous Quiz
2%
Styling components
85%
Handling asynchronous operations
12%
Declaring constants
0%
Looping over arrays
Which of these is a self-balancing binary search tree?
Anonymous Quiz
11%
Binary heap
76%
AVL tree
0%
Trie
13%
Hash map
Topic: Web Development
🔍 Quick look before the question:
🔍 Quick look before the question:
async function loadUser() {
const res = await fetch('/api/user');
const data = await res.json();
return data;
}
console.log(loadUser());
console.log('after call');
What does the first console.log actually print?
Anonymous Quiz
19%
The resolved user data object directly
63%
A pending Promise object, since loadUser() is async and console.log runs before it resolves
0%
undefined, always
19%
"after call" first, then the user object
Which traversal visits a binary tree's root before its left and right subtrees?
Anonymous Quiz
21%
Inorder
29%
Postorder
43%
Preorder
7%
Level-order
What is the purpose of a Content Security Policy (CSP) header?
Anonymous Quiz
7%
To speed up CSS parsing
93%
Restricts allowed sources for scripts and other resources
0%
To compress images automatically
0%
To enable dark mode
Topic: Debugging & Code Output
🔍 Quick look before the question:
🔍 Quick look before the question:
def f(n):
if n == 0:
return 0
return n + f(n - 1)
import sys
sys.setrecursionlimit(3)
print(f(5))
What happens when this code runs?
Anonymous Quiz
17%
Prints 15
22%
Prints 0
56%
Raises a RecursionError because the recursion limit is set too low for the required depth
6%
Hangs forever in an infinite loop
What is the main purpose of CORS (Cross-Origin Resource Sharing) headers?
Anonymous Quiz
4%
To compress HTTP responses
80%
To let a server explicitly permit cross-origin browser requests
16%
To encrypt traffic between client and server
0%
To cache static assets
Topic: Debugging & Code Output
🔍 Quick look before the question:
🔍 Quick look before the question:
x = 5
def outer():
x = 10
def inner():
print(x)
x = 20
inner()
outer()
What happens when this code runs?
Anonymous Quiz
47%
Prints 10
27%
Prints 5
27%
Prints 20
0%
Raises an UnboundLocalError
What is the main goal of the Liskov Substitution Principle?
Anonymous Quiz
18%
Subclasses should be substitutable for their base class
27%
Every class must have exactly one subclass
55%
Subclasses should never override any parent methods
0%
It only applies to abstract classes, never concrete ones
Topic: Data Structures & Algorithms
🔍 Quick look before the question:
🔍 Quick look before the question:
def mystery(n, memo={}):
if n in memo:
return memo[n]
if n <= 1:
return n
memo[n] = mystery(n-1, memo) + mystery(n-2, memo)
return memo[n]
print(mystery(30))
What is the time complexity of this function, and why does it differ from naive recursive Fibonacci?
Anonymous Quiz
17%
O(2^n), same as naive recursion since it's still recursive
67%
O(n), because memoization ensures each subproblem is only computed once
17%
O(n^2), because the dictionary lookups are slow
0%
O(log n), because of the recursive halving