0
0
Expressframework~20 mins

Zero-downtime deployment concept in Express - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Zero-Downtime Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2: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.
ATo deploy new code only during scheduled maintenance windows with downtime.
BTo restart the server immediately after deployment, causing a brief downtime.
CTo update the server code without stopping the server or dropping user requests.
DTo disable all incoming requests during deployment to avoid errors.
Attempts:
2 left
💡 Hint
Think about user experience during deployment.
component_behavior
intermediate
2: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.
AIt distributes incoming requests between old and new server instances to avoid downtime.
BIt restarts the server automatically after deployment.
CIt blocks all traffic during deployment to prevent errors.
DIt directs traffic only to the old server version until the new one is fully ready.
Attempts:
2 left
💡 Hint
Think about how traffic is managed between multiple servers.
lifecycle
advanced
3:00remaining
What is the correct sequence for zero-downtime deployment steps in Express?
Order the steps to perform a zero-downtime deployment correctly.
A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Think about starting new first, then switching traffic, then stopping old.
🔧 Debug
advanced
2: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:
AThe port 3000 is not freed immediately after server.close(), causing a bind error.
BCalling server.close() stops the server before the new one starts, causing downtime.
CThe new app.listen(3000) call is missing a callback, causing errors.
DThe app variable is not reinitialized with new code before listening.
Attempts:
2 left
💡 Hint
Think about when the server stops accepting requests.
state_output
expert
2: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();
A
Servers running: 1
Servers running: 1
B
Servers running: 1
Servers running: 2
C
Servers running: 2
Servers running: 2
D
Servers running: 2
Servers running: 1
Attempts:
2 left
💡 Hint
Track the value of activeServers after each operation.