0
0
GCPcloud~10 mins

Why serverless patterns matter in GCP - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to deploy a serverless function on Google Cloud Functions.

GCP
gcloud functions deploy myFunction --runtime [1] --trigger-http --allow-unauthenticated
Drag options to blanks, or click blank then click option'
Apython39
Bnodejs16
Cgo113
Djava11
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a runtime that does not support Python 3.9
Using an unsupported or outdated runtime version
2fill in blank
medium

Complete the code to set the memory allocation for a Cloud Function.

GCP
gcloud functions deploy myFunction --runtime python39 --memory [1] --trigger-http
Drag options to blanks, or click blank then click option'
A128MB
B512MB
C256MB
D1GB
Attempts:
3 left
💡 Hint
Common Mistakes
Using memory sizes without units
Choosing memory sizes not supported by Cloud Functions
3fill in blank
hard

Fix the error in the Cloud Function trigger type to respond to HTTP requests.

GCP
gcloud functions deploy myFunction --runtime python39 --trigger-[1] --allow-unauthenticated
Drag options to blanks, or click blank then click option'
Abucket
Bhttp
Ctopic
Dpubsub
Attempts:
3 left
💡 Hint
Common Mistakes
Using bucket or pubsub triggers for HTTP functions
Misspelling the trigger type
4fill in blank
hard

Fill both blanks to create a serverless function that scales automatically and logs output.

GCP
gcloud functions deploy myFunction --runtime python39 --trigger-http --[1] --set-env-vars LOG_LEVEL=[2]
Drag options to blanks, or click blank then click option'
Amax-instances=5
Bmin-instances=0
CDEBUG
DINFO
Attempts:
3 left
💡 Hint
Common Mistakes
Setting max-instances instead of min-instances for scaling
Using DEBUG level when INFO is preferred for general logs
5fill in blank
hard

Fill all three blanks to define a serverless function with a timeout, memory, and environment variable.

GCP
gcloud functions deploy myFunction --runtime python39 --timeout=[1] --memory=[2] --set-env-vars MODE=[3]
Drag options to blanks, or click blank then click option'
A60s
B256MB
Cproduction
D120s
Attempts:
3 left
💡 Hint
Common Mistakes
Using too short timeout causing function to stop early
Choosing memory sizes too small for workload
Setting environment variables incorrectly