0
0
Firebasecloud~20 mins

Email/password signup in Firebase - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Firebase Email Signup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What happens after a successful email/password signup in Firebase?

When a user signs up with email and password using Firebase Authentication, what is the immediate state of the user session?

Firebase
firebase.auth().createUserWithEmailAndPassword(email, password).then(userCredential => {
  // What is true here?
});
AThe user session is created but remains inactive until email verification.
BThe user is automatically signed in and the session is active.
CThe user must manually sign in after signup to activate the session.
DThe user is signed out immediately after signup for security reasons.
Attempts:
2 left
💡 Hint

Think about what Firebase does by default after creating a user.

security
intermediate
2:00remaining
Which Firebase rule prevents users from reading other users' data?

Given Cloud Firestore with user data stored under /users/{userId}, which security rule ensures users can only read their own data?

Firebase
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{userId} {
      allow read: if request.auth.uid == userId;
    }
  }
}
Arequest.auth.uid == userId
Brequest.auth.email_verified == true
Crequest.auth.uid != userId
Dtrue
Attempts:
2 left
💡 Hint

Users should only access data where their ID matches the data path.

Configuration
advanced
2:00remaining
What is the correct Firebase config snippet to enable email/password signup?

Which Firebase Authentication configuration snippet correctly enables email/password signup in the Firebase console?

ASet <code>allowEmailPasswordSignup: true</code> in firebase.json file.
BAdd email and password fields in Firestore database rules.
CEnable 'Email/Password' provider in Authentication > Sign-in method tab.
DCreate a Cloud Function to handle email/password signup manually.
Attempts:
2 left
💡 Hint

Think about the Firebase console settings for authentication.

🧠 Conceptual
advanced
2:00remaining
Why is email verification important after signup?

After a user signs up with email and password, why should you require email verification before granting full access?

ATo allow users to sign in without a password.
BTo automatically reset the user's password.
CTo speed up the signup process.
DTo confirm the user owns the email and prevent fake accounts.
Attempts:
2 left
💡 Hint

Think about security and trust in user identity.

Best Practice
expert
2:00remaining
What is the best practice for handling errors during email/password signup?

When a signup attempt fails (e.g., weak password, email already in use), what is the best way to handle errors in your app?

Firebase
firebase.auth().createUserWithEmailAndPassword(email, password).catch(error => {
  // What should you do here?
});
AShow a clear, user-friendly message explaining the error cause.
BLog the error silently and do not inform the user.
CReload the page automatically without explanation.
DIgnore the error and proceed as if signup succeeded.
Attempts:
2 left
💡 Hint

Good user experience includes clear communication.