Get ready for your next interview with our comprehensive question library
Traditional Backend:
Firebase:
Firebase Authentication supports multiple sign-in methods:
Social Providers:
Traditional Methods:
Enterprise:
// Initialize Firebase Auth
import { auth } from './firebase-config';
import { createUserWithEmailAndPassword, signInWithEmailAndPassword } from 'firebase/auth';
// Sign up
const signUp = async (email, password) => {
try {
const userCredential = await createUserWithEmailAndPassword(auth, email, password);
console.log('User created:', userCredential.user);
} catch (error) {
console.error('Sign up error:', error.message);
}
};
// Sign in
const signIn = async (email, password) => {
try {
const userCredential = await signInWithEmailAndPassword(auth, email, password);
console.log('User signed in:', userCredential.user);
} catch (error) {
console.error('Sign in error:', error.message);
}
};
Firestore uses a hierarchical data model:
Documents:
Collections:
Structure Example:
users (collection)
├── user1 (document)
│ ├── name: "John Doe"
│ ├── email: "john@example.com"
│ └── posts (subcollection)
│ └── post1 (document)
│ ├── title: "My First Post"
│ └── content: "Hello World"
└── user2 (document)
├── name: "Jane Smith"
└── email: "jane@example.com"
Cloud Functions are serverless functions that run backend code in response to events.
Main Use Cases:
Benefits:
Upgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumAccess all premium content - interview questions, and other learning resources
We regularly update our features and content, to ensure you get the most relevant and updated premium content.
1000 monthly credits
Cancel anytime