0
0
Firebasecloud~20 mins

Supported data types in Firebase - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Firestore Data Types Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Firebase Firestore Supported Data Types
Which of the following data types is NOT supported by Firebase Firestore for storing in documents?
AGeoPoint
BFunction
CTimestamp
DArray
Attempts:
2 left
💡 Hint
Think about what kinds of data Firestore can store directly in documents.
service_behavior
intermediate
2:00remaining
Behavior of Unsupported Data Types in Firestore
What happens if you try to store a JavaScript Date object directly in Firestore without converting it?
AIt throws an error because Firestore requires a Timestamp type.
BIt stores the Date object as a number representing milliseconds.
CIt silently converts the Date to a Firestore Timestamp.
DIt stores the Date object as a string automatically.
Attempts:
2 left
💡 Hint
Consider how Firestore expects date/time values to be formatted.
Configuration
advanced
2:00remaining
Storing Nested Data Structures in Firestore
Given the following Firestore document data, which option correctly represents a nested map with an array inside?
Firebase
const data = {
  user: {
    name: "Alice",
    roles: ["admin", "editor"]
  }
};
A{"user": {"name": "Alice", "roles": ["admin", "editor"]}}
B{"user": {"name": "Alice", "roles": "admin, editor"}}
C{"user": ["name", "Alice", "roles", ["admin", "editor"]]}
D{"user": {"name": "Alice", "roles": {"0": "admin", "1": "editor"}}}
Attempts:
2 left
💡 Hint
Think about how Firestore stores objects and arrays.
security
advanced
2:00remaining
Security Implications of Storing Binary Data in Firestore
Which statement about storing binary data (like images) directly in Firestore is true?
AFirestore is optimized for large binary data and is the best place to store images.
BBinary data cannot be stored in Firestore at all.
CFirestore automatically compresses binary data to save space and cost.
DStoring large binary data in Firestore can increase costs and slow down reads.
Attempts:
2 left
💡 Hint
Consider Firestore's intended use and pricing model.
Architecture
expert
3:00remaining
Choosing Data Types for Efficient Firestore Queries
You want to store a user's status that can be one of: 'active', 'inactive', or 'pending'. Which data type choice allows the most efficient Firestore queries and indexing?
AStore status as a string field with values 'active', 'inactive', or 'pending'.
BStore status as a boolean field where true means active and false means inactive or pending.
CStore status as a number: 1 for active, 2 for inactive, 3 for pending.
DStore status as an array containing all possible statuses.
Attempts:
2 left
💡 Hint
Think about how Firestore indexes and queries string fields versus other types.