Challenge - 5 Problems
Zero-Downtime Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What is the main goal of zero-downtime deployment in Express apps?
Choose the best description of zero-downtime deployment for an Express server.
Attempts:
2 left
💡 Hint
Think about user experience during deployment.
✗ Incorrect
Zero-downtime deployment means updating the server without interrupting active users or dropping requests. The server keeps running while new code is loaded.
❓ component_behavior
intermediate2:00remaining
How does a load balancer help achieve zero-downtime deployment?
Select the option that best explains the role of a load balancer in zero-downtime deployment.
Attempts:
2 left
💡 Hint
Think about how traffic is managed between multiple servers.
✗ Incorrect
A load balancer sends requests to both old and new server versions during deployment, so users experience no downtime.
❓ lifecycle
advanced3:00remaining
What is the correct sequence for zero-downtime deployment steps in Express?
Order the steps to perform a zero-downtime deployment correctly.
Attempts:
2 left
💡 Hint
Think about starting new first, then switching traffic, then stopping old.
✗ Incorrect
The new server starts first, then the load balancer directs traffic to it. After that, the old server stops receiving traffic and finally shuts down.
🔧 Debug
advanced2:30remaining
Why does this zero-downtime deployment code cause downtime?
Identify the problem in this Express deployment snippet:
const server = app.listen(3000);
// Deploy new code
server.close();
app.listen(3000);
Options:
Attempts:
2 left
💡 Hint
Think about when the server stops accepting requests.
✗ Incorrect
Calling server.close() stops the server immediately, so there is downtime before the new server starts listening.
❓ state_output
expert2:00remaining
What is the output of this Express zero-downtime deployment simulation?
Given this simplified code simulating zero-downtime deployment, what is logged?
let activeServers = 1;
function deployNewVersion() {
activeServers++;
console.log(`Servers running: ${activeServers}`);
activeServers--;
console.log(`Servers running: ${activeServers}`);
}
deployNewVersion();
Attempts:
2 left
💡 Hint
Track the value of activeServers after each operation.
✗ Incorrect
The function increments activeServers to 2, logs it, then decrements back to 1 and logs again.