0
0
Firebasecloud~20 mins

First Firebase integration - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Firebase Integration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Firebase Initialization Behavior
What happens if you try to initialize Firebase twice in the same web app without checking if it is already initialized?
AFirebase throws an error indicating it is already initialized.
BFirebase silently re-initializes without any error.
CFirebase merges the new config with the old one and continues.
DFirebase resets all previous data and starts fresh.
Attempts:
2 left
💡 Hint
Think about how Firebase protects against multiple initializations in a single app instance.
Configuration
intermediate
2:00remaining
Correct Firebase Config Object
Which of the following is a valid Firebase configuration object for initializing Firebase in a web app?
A{ api_key: "abc123", auth_domain: "myapp.firebaseapp.com", project_id: "myapp" }
B{ key: "abc123", domain: "myapp.firebaseapp.com", id: "myapp" }
C{ apiKey: "abc123", authDomain: "myapp.firebaseapp.com", projectId: "myapp" }
D{ apiKey: "abc123", authDomain: "myapp.firebaseapp.com" }
Attempts:
2 left
💡 Hint
Look for the exact property names Firebase expects in its config.
Architecture
advanced
3:00remaining
Firebase Hosting and Cloud Functions Integration
You want to serve a static website and also run backend code on Firebase. Which architecture correctly uses Firebase Hosting and Cloud Functions together?
AHost static files on Cloud Functions and use Firebase Hosting only for API calls.
BHost static files on Firebase Hosting and use Cloud Functions as API endpoints triggered by HTTPS requests.
CUse Firebase Hosting to run backend code and Cloud Functions only for database triggers.
DDeploy backend code inside Firebase Hosting and static files inside Cloud Functions.
Attempts:
2 left
💡 Hint
Think about which Firebase service is optimized for static content and which for backend logic.
security
advanced
3:00remaining
Firebase Security Rules for Firestore
Which Firestore security rule allows only authenticated users to read and write their own user document under 'users/{userId}'?
Firebase
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{userId} {
      allow read, write: if ________ ;
    }
  }
}
Arequest.auth.uid != null
Brequest.auth == null || request.auth.uid == userId
Crequest.auth != null && request.auth.token.email_verified == true
Drequest.auth != null && request.auth.uid == userId
Attempts:
2 left
💡 Hint
Users should only access their own documents and must be signed in.
service_behavior
expert
3:00remaining
Firebase Realtime Database Offline Behavior
What happens when a Firebase Realtime Database client loses internet connection but continues to write data locally?
AWrites are queued locally and synchronized automatically when connection is restored.
BWrites are lost and not saved locally during offline periods.
CWrites fail immediately and throw an error until connection is back.
DWrites are saved locally but require manual sync calls to update the server.
Attempts:
2 left
💡 Hint
Consider Firebase's offline capabilities and automatic synchronization.