0
0
Blockchain / Solidityprogramming~20 mins

Rollups (Optimistic vs ZK) in Blockchain / Solidity - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Rollup Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of Optimistic Rollup Fraud Proof Simulation
Consider the following simplified Python code simulating an optimistic rollup fraud proof check. What is the output when the code runs?
Blockchain / Solidity
def optimistic_rollup_check(state, new_state):
    # Fraud proof triggers if new_state is less than state
    if new_state < state:
        return "Fraud detected"
    else:
        return "State accepted"

print(optimistic_rollup_check(100, 90))
AState accepted
BFraud detected
CTypeError
DSyntaxError
Attempts:
2 left
💡 Hint
Think about the condition that triggers fraud detection in optimistic rollups.
🧠 Conceptual
intermediate
1:30remaining
Difference in Verification Time Between Rollups
Which statement correctly describes the verification time difference between Optimistic Rollups and ZK Rollups?
AOptimistic Rollups use zero-knowledge proofs for instant verification
BOptimistic Rollups verify transactions instantly, ZK Rollups delay verification
CBoth rollups verify transactions instantly with no delay
DZK Rollups verify transactions instantly using proofs, Optimistic Rollups delay verification due to fraud proofs
Attempts:
2 left
💡 Hint
Recall how each rollup type handles transaction verification.
🔧 Debug
advanced
1:30remaining
Identify the Error in ZK Rollup Proof Generation Code
What error will the following Python code raise when simulating a ZK Rollup proof generation?
Blockchain / Solidity
def generate_zk_proof(data):
    # Simulate proof generation
    proof = data / 0
    return proof

print(generate_zk_proof(10))
AZeroDivisionError
BNo error, outputs 0
CValueError
DTypeError
Attempts:
2 left
💡 Hint
Look at the operation dividing by zero.
📝 Syntax
advanced
1:00remaining
Syntax Error in Optimistic Rollup Challenge Period Code
Which option contains the correct syntax to define a function that returns the challenge period length in days?
Blockchain / Solidity
def challenge_period():
    return 7
A
def challenge_period()
    return 7
B
def challenge_period():
return 7
C
def challenge_period():
    return 7
D
def challenge_period:
    return 7
Attempts:
2 left
💡 Hint
Check for colons and indentation in function definitions.
🚀 Application
expert
2:00remaining
Calculate Final State After Batch Processing in ZK Rollup
Given the following Python code simulating batch state updates in a ZK Rollup, what is the final state printed?
Blockchain / Solidity
def zk_rollup_batch(states):
    final_state = 0
    for s in states:
        final_state += s * 2
    return final_state

batch_states = [1, 3, 5]
print(zk_rollup_batch(batch_states))
A18
B9
C15
D30
Attempts:
2 left
💡 Hint
Multiply each state by 2 and add them all up.