Bird
Raised Fist0
GCPcloud~20 mins

Revision management in GCP - Practice Problems & Coding Challenges

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

You deploy a new revision of a Cloud Run service. What happens to the previous revision?

AThe previous revision is automatically scaled down to zero and removed after 24 hours.
BThe previous revision is deleted immediately to save resources.
CThe previous revision is archived and cannot be accessed anymore.
DThe previous revision remains available and can receive traffic if configured.
Attempts:
2 left
💡 Hint

Think about how Cloud Run manages traffic between revisions.

❓ Configuration
intermediate
2:00remaining
Traffic Splitting Between Revisions in Cloud Run

You want to split traffic 70% to the latest revision and 30% to the previous revision in Cloud Run. Which configuration snippet correctly sets this?

A{"traffic": [{"revisionName": "rev-1", "percent": 70}, {"revisionName": "rev-2", "percent": 30}]}
B{"traffic": [{"revisionName": "rev-2", "percent": 70}, {"revisionName": "rev-1", "percent": 30}]}
C{"traffic": [{"revisionName": "rev-2", "percent": 30}, {"revisionName": "rev-1", "percent": 70}]}
D{"traffic": [{"revisionName": "rev-1", "percent": 30}, {"revisionName": "rev-2", "percent": 70}]}
Attempts:
2 left
💡 Hint

Latest revision is usually the one you want to get 70% traffic.

❓ Architecture
advanced
2:00remaining
Designing a Rollback Strategy Using Cloud Run Revisions

You want to design a system that can quickly rollback to a previous stable version of your Cloud Run service if the latest deployment fails. Which approach best supports this?

AKeep previous revisions and use traffic splitting to route 100% traffic back to the stable revision.
BManually edit the service to rename the previous revision as the latest.
CUse Cloud Build triggers to automatically rollback on failure.
DDelete the latest revision and redeploy the previous revision from source code.
Attempts:
2 left
💡 Hint

Think about how Cloud Run manages revisions and traffic routing.

❓ security
advanced
2:00remaining
Security Implications of Retaining Old Revisions in Cloud Run

What is a potential security risk of keeping multiple old revisions active in Cloud Run?

AOld revisions consume all available CPU resources causing denial of service.
BOld revisions automatically expose admin credentials to all users.
COld revisions may have outdated code with vulnerabilities accessible if traffic is routed to them.
DOld revisions disable HTTPS causing unencrypted traffic.
Attempts:
2 left
💡 Hint

Consider what happens if old code has security flaws.

✅ Best Practice
expert
2:00remaining
Managing Revision Limits and Cleanup in Cloud Run

Cloud Run retains up to 1000 revisions per service. What is the best practice to manage revision cleanup to avoid hitting this limit?

AManually delete old revisions regularly using gcloud or console to keep the count low.
BIgnore the limit as Cloud Run automatically deletes oldest revisions when limit is reached.
CConfigure Cloud Run to auto-delete revisions older than 7 days via service settings.
DDisable revision retention so only the latest revision is kept automatically.
Attempts:
2 left
💡 Hint

Check how Cloud Run handles revision limits and what control you have.

Practice

(1/5)
1. What is the main purpose of revision management in Google Cloud services?
easy
A. To track and control different versions of your cloud services
B. To increase the storage capacity of your cloud database
C. To monitor network traffic between services
D. To automatically scale the number of virtual machines

Solution

  1. Step 1: Understand revision management concept

    Revision management is about keeping track of different versions of your cloud services.
  2. Step 2: Identify the main goal

    The main goal is to control versions for safe updates and rollbacks.
  3. Final Answer:

    To track and control different versions of your cloud services -> Option A
  4. Quick Check:

    Revision management = version control [OK]
Hint: Revision management means version control of services [OK]
Common Mistakes:
  • Confusing revision management with scaling
  • Thinking it manages storage or network
  • Mixing it with monitoring tools
2. Which gcloud command is used to list all revisions of a Cloud Run service named my-service?
easy
A. gcloud run revisions list --service=my-service
B. gcloud run services list --revisions=my-service
C. gcloud revisions describe my-service
D. gcloud run deploy revisions --service=my-service

Solution

  1. Step 1: Identify correct command structure

    The command to list revisions uses gcloud run revisions list with the service flag.
  2. Step 2: Match service name parameter

    Using --service=my-service correctly specifies the service.
  3. Final Answer:

    gcloud run revisions list --service=my-service -> Option A
  4. Quick Check:

    List revisions = gcloud run revisions list --service [OK]
Hint: List revisions with 'gcloud run revisions list --service' [OK]
Common Mistakes:
  • Using 'services list' instead of 'revisions list'
  • Mixing 'describe' with listing
  • Wrong command order or flags
3. Given the following commands, what will be the output of gcloud run revisions list --service=my-app after deploying twice?
gcloud run deploy my-app --image=image:v1 --no-traffic
gcloud run deploy my-app --image=image:v2 --no-traffic
medium
A. One revision with image:v2
B. No revisions because traffic is zero
C. Two revisions: one with image:v1 and one with image:v2
D. Error because --no-traffic disables revisions

Solution

  1. Step 1: Understand deployment with --no-traffic

    Deploying with --no-traffic creates a new revision but does not route traffic to it.
  2. Step 2: Analyze multiple deployments

    Deploying twice with different images creates two separate revisions.
  3. Final Answer:

    Two revisions: one with image:v1 and one with image:v2 -> Option C
  4. Quick Check:

    Each deploy creates a revision even with no traffic [OK]
Hint: Each deploy creates a revision, traffic doesn't affect revision count [OK]
Common Mistakes:
  • Assuming no traffic means no revision
  • Thinking only latest revision exists
  • Confusing traffic routing with revision creation
4. You deployed a new revision but it is not receiving traffic. Which command fixes this by routing 100% traffic to the latest revision named my-app-00002?
medium
A. gcloud run revisions set-traffic my-app-00002 --percent=100
B. gcloud run services update-traffic my-app --to-revisions my-app-00002=100
C. gcloud run services update my-app --traffic my-app-00002=100
D. gcloud run services update-traffic my-app --to-revision my-app-00002=100

Solution

  1. Step 1: Identify correct command to update traffic

    The command to update traffic routing is gcloud run services update-traffic.
  2. Step 2: Use correct syntax for traffic split

    The syntax --to-revisions my-app-00002=100 routes 100% traffic to that revision.
  3. Final Answer:

    gcloud run services update-traffic my-app --to-revisions my-app-00002=100 -> Option B
  4. Quick Check:

    Update traffic with 'services update-traffic' and '--to-revisions' [OK]
Hint: Use 'gcloud run services update-traffic' with '--to-revisions' [OK]
Common Mistakes:
  • Using 'update' instead of 'update-traffic'
  • Wrong flag names like '--percent'
  • Trying to set traffic on revision directly
5. You want to roll back your Cloud Run service web-app to a previous revision web-app-00003 safely without downtime. Which sequence of commands achieves this?
hard
A. gcloud run deploy web-app --image=web-app-00003
B. gcloud run services update web-app --revision web-app-00003
C. gcloud run revisions delete web-app-00004 && gcloud run services update-traffic web-app --to-revisions web-app-00003=100
D. gcloud run services update-traffic web-app --to-revisions web-app-00003=100

Solution

  1. Step 1: Understand rollback via traffic routing

    Rolling back means routing traffic back to an existing previous revision.
  2. Step 2: Use traffic update command

    Use gcloud run services update-traffic to send 100% traffic to the old revision.
  3. Step 3: Avoid deleting revisions or redeploying

    Deleting or redeploying is unnecessary and may cause downtime.
  4. Final Answer:

    gcloud run services update-traffic web-app --to-revisions web-app-00003=100 -> Option D
  5. Quick Check:

    Rollback by routing traffic to old revision [OK]
Hint: Rollback by updating traffic to old revision, no redeploy needed [OK]
Common Mistakes:
  • Trying to redeploy old revision as image
  • Deleting newer revisions unnecessarily
  • Using wrong commands to update revision
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