Bird
Raised Fist0
Firebasecloud~20 mins

Rollback deployments in Firebase - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Firebase Rollback Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate
2:00remaining
Understanding Firebase Hosting Rollback Behavior

You deployed a new version of your Firebase Hosting site but noticed a critical bug. You want to rollback to the previous version quickly.

What happens when you run firebase hosting:rollback?

AIt instantly switches the live site to the previous deployed version without downtime.
BIt creates a new deployment identical to the previous version but does not switch traffic automatically.
CIt deletes the current version and redeploys the previous version, causing downtime.
DIt archives all versions but requires manual DNS changes to rollback.
Attempts:
2 left
💡 Hint

Think about how Firebase Hosting manages versions and traffic switching.

❓ Configuration
intermediate
2:00remaining
Rollback Command Usage

You want to rollback your Firebase Hosting deployment to the version deployed 3 deployments ago.

Which command correctly rolls back to that specific version?

Afirebase hosting:rollback --version-name 3
Bfirebase hosting:rollback --to 3
Cfirebase hosting:rollback 3
Dfirebase hosting:rollback --target 3
Attempts:
2 left
💡 Hint

Check the official Firebase CLI rollback command syntax.

❓ Architecture
advanced
2:00remaining
Rollback Impact on CDN Cache

After rolling back a Firebase Hosting deployment, what happens to the cached content on the CDN edge servers?

AThe rollback triggers a manual cache purge request that you must run separately.
BThe CDN cache continues serving the old content until it expires naturally.
CThe CDN cache is disabled temporarily during rollback to prevent stale content.
DThe CDN cache is automatically invalidated and refreshed with the rollback version content.
Attempts:
2 left
💡 Hint

Consider how Firebase Hosting manages content freshness after deployment changes.

❓ security
advanced
2:00remaining
Rollback and Security Rules Consistency

You rolled back your Firebase Hosting deployment to a previous version. What happens to the Firebase Security Rules associated with the hosting content?

ASecurity Rules remain as they were in the current version and do not rollback automatically.
BSecurity Rules rollback automatically to the version associated with the hosting rollback.
CSecurity Rules are disabled temporarily until manually re-enabled after rollback.
DSecurity Rules are deleted and must be redeployed manually after rollback.
Attempts:
2 left
💡 Hint

Think about how Firebase separates hosting content from security rules deployment.

✅ Best Practice
expert
3:00remaining
Rollback Strategy for Zero Downtime

You want to implement a rollback strategy for Firebase Hosting that guarantees zero downtime and quick recovery from faulty deployments.

Which approach best achieves this?

ADeploy a new version with fixes and manually update DNS records to point to it.
BUse Firebase Hosting's built-in rollback command to instantly switch versions without downtime.
CDelete the faulty deployment and redeploy the previous version from local files.
DPause all traffic to the site, rollback, then resume traffic after verification.
Attempts:
2 left
💡 Hint

Consider the features Firebase Hosting provides for deployment management.

Practice

(1/5)
1.

What is the main purpose of firebase hosting:rollback?

easy
A. To deploy a new version of the website
B. To create a backup of the current deployment
C. To delete all hosting versions permanently
D. To undo a recent deployment and restore the previous version

Solution

  1. Step 1: Understand rollback purpose

    Rollback is used to undo a deployment that caused issues by restoring the previous stable version.
  2. Step 2: Identify command function

    The command firebase hosting:rollback specifically reverts to the last working deployment.
  3. Final Answer:

    To undo a recent deployment and restore the previous version -> Option D
  4. Quick Check:

    Rollback = undo deployment [OK]
Hint: Rollback means undo last deployment fast [OK]
Common Mistakes:
  • Confusing rollback with deploying new versions
  • Thinking rollback deletes all versions
  • Assuming rollback creates backups
2.

Which of the following is the correct syntax to rollback the last Firebase Hosting deployment?

easy
A. firebase hosting:rollback
B. firebase rollback hosting
C. firebase deploy:rollback hosting
D. firebase hosting rollback --last

Solution

  1. Step 1: Recall correct command structure

    The official Firebase CLI command for rollback is firebase hosting:rollback.
  2. Step 2: Check option syntax

    Options B, C, and D do not match the correct Firebase CLI syntax for rollback.
  3. Final Answer:

    firebase hosting:rollback -> Option A
  4. Quick Check:

    Correct syntax = firebase hosting:rollback [OK]
Hint: Remember exact command: firebase hosting:rollback [OK]
Common Mistakes:
  • Swapping command parts order
  • Adding extra flags not needed
  • Using deploy instead of hosting
3.

Given the deployment history shows versions v5, v6, and v7, with v7 currently live, what will firebase hosting:rollback do?

medium
A. Rollback to version v6
B. Rollback to version v7 again
C. Rollback to version v5
D. Delete all versions except v7

Solution

  1. Step 1: Identify current live version

    The current live version is v7, the latest deployment.
  2. Step 2: Understand rollback behavior

    Rollback reverts to the previous version before the current one, which is v6.
  3. Final Answer:

    Rollback to version v6 -> Option A
  4. Quick Check:

    Rollback = previous version v6 [OK]
Hint: Rollback always reverts to the immediate previous version [OK]
Common Mistakes:
  • Choosing the oldest version instead of previous
  • Thinking rollback redeploys current version
  • Assuming rollback deletes versions
4.

You ran firebase hosting:rollback but got an error saying "No previous version found." What is the most likely cause?

medium
A. Firebase CLI is outdated
B. You have no prior deployments to rollback to
C. Your internet connection is down
D. You typed the command incorrectly

Solution

  1. Step 1: Analyze error message meaning

    The error "No previous version found" means there is no earlier deployment saved to revert to.
  2. Step 2: Consider possible causes

    This usually happens if this is the first deployment or all previous versions were deleted.
  3. Final Answer:

    You have no prior deployments to rollback to -> Option B
  4. Quick Check:

    No previous version = no rollback possible [OK]
Hint: No previous version means no rollback available [OK]
Common Mistakes:
  • Assuming command syntax error
  • Blaming network issues
  • Ignoring deployment history
5.

You deployed version v10 but found a critical bug. You want to rollback to v9. However, v9 was deleted from the history. What is the best approach to recover your site quickly?

hard
A. Delete v10 and wait for Firebase to restore v9 automatically
B. Run firebase hosting:rollback to get v9 back
C. Redeploy a saved local copy of v9 manually
D. Contact Firebase support to restore v9

Solution

  1. Step 1: Understand rollback limitations

    Rollback only works if the previous version exists in deployment history. Since v9 is deleted, rollback cannot restore it.
  2. Step 2: Identify recovery method

    The best way is to redeploy a saved local copy of v9 manually to restore the stable version quickly.
  3. Step 3: Evaluate other options

    Options B and C won't work because rollback needs the version present, and Firebase does not auto-restore deleted versions. Contact Firebase support to restore v9 may take too long for urgent fixes.
  4. Final Answer:

    Redeploy a saved local copy of v9 manually -> Option C
  5. Quick Check:

    Deleted version = manual redeploy needed [OK]
Hint: Rollback needs version history; redeploy local copy if missing [OK]
Common Mistakes:
  • Expecting rollback to restore deleted versions
  • Waiting for automatic Firebase restore
  • Ignoring local backups
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard