Challenge - 5 Problems
Cloud Functions Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate2:00remaining
Cloud Function Trigger Behavior
You deploy a Firebase Cloud Function triggered by Firestore document creation in the 'orders' collection. What happens when a new document is added to 'orders'?
Attempts:
2 left
💡 Hint
Think about what triggers a Firestore onCreate function.
✗ Incorrect
The Cloud Function triggers every time a new document is created in the specified collection. It does not trigger on updates or deletions.
❓ Configuration
intermediate2:00remaining
Correct Firebase Function Initialization
Which code snippet correctly initializes a Firebase Cloud Function to respond to HTTP requests?
Attempts:
2 left
💡 Hint
Check which Firebase function type supports HTTP triggers.
✗ Incorrect
Only functions.https.onRequest creates an HTTP-triggered function. Others are for database or storage triggers.
❓ Architecture
advanced3:00remaining
Designing Scalable Cloud Functions
You want to design a Firebase Cloud Function that processes image uploads to Cloud Storage and scales efficiently under heavy load. Which approach is best?
Attempts:
2 left
💡 Hint
Think about decoupling processing from upload to handle spikes.
✗ Incorrect
Using Pub/Sub decouples upload from processing, allowing the system to scale and retry processing without blocking uploads.
❓ security
advanced3:00remaining
Securing Firebase Cloud Functions
Which practice best secures a Firebase Cloud Function that handles sensitive user data via HTTP requests?
Attempts:
2 left
💡 Hint
Think about verifying the identity of the caller before processing sensitive data.
✗ Incorrect
Verifying Firebase Authentication tokens ensures only authorized users access the function, protecting sensitive data.
✅ Best Practice
expert3:00remaining
Optimizing Cold Start Times in Cloud Functions
You notice your Firebase Cloud Functions have high cold start latency. Which option is the best way to reduce cold start times?
Attempts:
2 left
💡 Hint
Think about what affects the time it takes to start a function instance.
✗ Incorrect
Smaller code and fewer imports reduce initialization time, lowering cold start latency.