0
0
GCPcloud~20 mins

Cloud Shell and gcloud CLI in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Cloud Shell and gcloud CLI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
1:30remaining
Understanding Cloud Shell Session Persistence

You start a Cloud Shell session and create a file named notes.txt in your home directory. After 12 hours, you reconnect to Cloud Shell. What will happen to the notes.txt file?

AThe file will be there only if you saved it to the /tmp directory.
BThe file will be gone because Cloud Shell resets the home directory every time you reconnect.
CThe file will still be there because Cloud Shell home directory is persistent across sessions.
DThe file will be deleted automatically after 1 hour of inactivity.
Attempts:
2 left
💡 Hint

Think about where Cloud Shell stores your home directory and how it manages user files.

Configuration
intermediate
1:00remaining
Setting the Default Project with gcloud CLI

You want to set your default project for gcloud commands to my-project-123. Which command will correctly set this default project?

Agcloud project set-default my-project-123
Bgcloud config set project my-project-123
Cgcloud config project set my-project-123
Dgcloud set project my-project-123
Attempts:
2 left
💡 Hint

Remember the syntax for setting configuration properties in gcloud CLI.

Architecture
advanced
2:00remaining
Choosing the Right Environment for Long-Running Scripts

You need to run a script that will take 10 hours to complete. You want to use Cloud Shell or gcloud CLI. Which is the best approach to ensure the script runs without interruption?

AUse Cloud Shell to start a Compute Engine VM and run the script there to avoid session timeouts.
BRun the script directly in Cloud Shell; it will keep running even if you close the browser.
CRun the script in Cloud Shell and keep the browser tab open to prevent disconnection.
DRun the script using gcloud CLI on your local machine only.
Attempts:
2 left
💡 Hint

Consider Cloud Shell session limits and how to run long tasks reliably.

security
advanced
2:00remaining
Managing Credentials in Cloud Shell

You want to run gcloud commands in Cloud Shell that access multiple projects with different permissions. What is the best way to manage credentials securely?

AUse <code>gcloud auth login</code> multiple times to switch between accounts as needed.
BUse service account keys stored in Cloud Shell home directory for each project.
CShare your Cloud Shell session with others to use their credentials when needed.
DUse <code>gcloud config configurations</code> to create separate configurations for each project and account.
Attempts:
2 left
💡 Hint

Think about how gcloud CLI supports multiple configurations for different accounts and projects.

🧠 Conceptual
expert
1:30remaining
Understanding Cloud Shell Resource Limits

Which of the following statements about Cloud Shell resource limits is TRUE?

ACloud Shell sessions have a fixed 5 GB persistent home disk and 1.7 GB RAM with limited CPU.
BCloud Shell automatically scales resources based on your script's demands.
CCloud Shell provides unlimited CPU and memory resources for any workload.
DCloud Shell allows running background processes indefinitely without session timeout.
Attempts:
2 left
💡 Hint

Recall the typical resource specifications and session behavior of Cloud Shell.