Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
You're offline
Unit 1 MCQsBuilding Cloud-Enabled Applications with Firebase
Question 1 of 60 · Introduction of Firebase · Easy
What is Firebase?
Not quite. Try another option.
Answer: A mobile and web application development platform
Firebase is a comprehensive platform developed by Google that provides backend services, tools, and infrastructure for building high-quality mobile and web applications.
Question 2 of 60 · Introduction of Firebase · Easy
Which company currently owns and develops Firebase?
Not quite. Try another option.
Answer: Google
Firebase was originally an independent company founded in 2011, but it was acquired by Google in 2014 and is now their flagship mobile development platform.
Question 3 of 60 · Feature of Firebase · Easy
Which Firebase feature provides a NoSQL cloud database for storing and syncing data in real-time?
Not quite. Try another option.
Answer: Firebase Realtime Database
The Firebase Realtime Database is a cloud-hosted NoSQL database that lets you store and sync data between your users in real-time.
Question 4 of 60 · Feature of Firebase · Easy
What is the primary purpose of Firebase Cloud Messaging (FCM)?
Not quite. Try another option.
Answer: To send push notifications and messages to client apps
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably send messages and notifications to users' devices.
Question 5 of 60 · Feature of Firebase · Easy
Which Firebase feature allows you to run backend code without managing your own servers?
Not quite. Try another option.
Answer: Cloud Functions
Cloud Functions for Firebase is a serverless framework that lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests.
Question 6 of 60 · connecting firebase to app · Easy
What is the name of the configuration file that you must download from the Firebase console and add to your Android app?
Not quite. Try another option.
Answer: google-services.json
To connect your Android app to a Firebase project, you must include the google-services.json file in your app's module (app/) directory.
Question 7 of 60 · connecting firebase to app · Easy
In which Gradle file do you typically add the Firebase Bill of Materials (BOM) dependency?
Not quite. Try another option.
Answer: App-level build.gradle
The Firebase BOM is added to the dependencies block of your module-level (often app/build.gradle) file to manage all Firebase library versions.
Question 8 of 60 · connecting firebase to app · Easy
What unique identifier for your Android app must you provide when registering it in the Firebase console?
Not quite. Try another option.
Answer: Package Name
The package name (e.g., com.example.myapp) is a unique identifier for your app on a device and in the Google Play Store, and it's required to connect your app to Firebase.
Question 9 of 60 · Firebase Authentication · Easy
What is the main function of Firebase Authentication?
Not quite. Try another option.
Answer: To manage user sign-up and sign-in processes
Firebase Authentication provides backend services, SDKs, and UI libraries to authenticate users to your app using various methods like passwords, phone numbers, and social providers.
Question 10 of 60 · Firebase Authentication · Easy
Which of the following is a common sign-in provider supported by Firebase Authentication?
Not quite. Try another option.
Answer: Google Sign-In
Firebase Authentication offers built-in support for several popular identity providers, including Google, Facebook, Twitter, and GitHub.
Question 11 of 60 · Firebase Authentication · Easy
Which object represents the currently authenticated user in the Firebase Android SDK?
Not quite. Try another option.
Answer: FirebaseUser
The FirebaseUser object contains information about the signed-in user, such as their unique ID, display name, and email address.
Question 12 of 60 · Firebase UI · Easy
What is a major benefit of using the FirebaseUI library?
Not quite. Try another option.
Answer: It provides pre-built UI components for tasks like authentication and data display.
FirebaseUI is an open-source library that provides drop-in UI solutions for common Firebase tasks, saving developers from writing a lot of boilerplate code.
Question 13 of 60 · Firebase UI · Easy
The FirebaseRecyclerAdapter from the FirebaseUI library simplifies binding data from a Firebase database to which Android view?
Not quite. Try another option.
Answer: RecyclerView
FirebaseRecyclerAdapter is a specialized adapter that listens for database changes and automatically updates the RecyclerView UI, making it easy to display lists of data.
Question 14 of 60 · Real time dataset base configure and setup · Easy
How is data structured within the Firebase Realtime Database?
Not quite. Try another option.
Answer: As a large JSON tree
The Realtime Database stores all data as a single JSON tree, which allows for flexible, denormalized data structures.
Question 15 of 60 · Real time dataset base configure and setup · Easy
Which of the following is used to get the root reference of your Firebase Realtime Database in Android?
To begin reading or writing data, you first need a reference to a location in your database. You can get the root reference by calling FirebaseDatabase.getInstance().getReference().
Question 16 of 60 · CRUD operation · Easy
What does CRUD stand for in the context of database management?
Not quite. Try another option.
Answer: Create, Read, Update, Delete
CRUD represents the four fundamental operations for interacting with a database: Creating new data, Reading existing data, Updating it, and Deleting it.
Question 17 of 60 · CRUD operation · Easy
Which Firebase Realtime Database method is used to write or replace data at a specific path?
Not quite. Try another option.
Answer: setValue()
The setValue() method overwrites the data at the specified location, including any child nodes. It is used for both creating new data and completely replacing existing data.
Question 18 of 60 · CRUD operation · Easy
To add a new item to a list of data in Firebase without specifying an ID, which method is typically used to generate a unique key?
Not quite. Try another option.
Answer: push()
The push() method generates a unique key every time a new child is added to the specified Firebase reference. It's the standard way to create lists of data.
Question 19 of 60 · Firebase Notification · Easy
Which class must you extend to create a service that handles incoming push notifications in an Android app?
Not quite. Try another option.
Answer: FirebaseMessagingService
To receive and handle messages from Firebase Cloud Messaging, you need to create a service that extends FirebaseMessagingService and register it in your AndroidManifest.xml.
Question 20 of 60 · Firebase Notification · Easy
What is the unique token that Firebase Cloud Messaging (FCM) assigns to each app instance?
Not quite. Try another option.
Answer: Registration Token
FCM provides a unique registration token for each client app instance. You use this token to target and send messages to that specific device.
Question 21 of 60 · Introduction of Firebase · Medium
A startup is developing a new social media app with a small team. They need to quickly implement user login, data storage, and push notifications without managing server infrastructure. Which classification best describes Firebase in this context?
Not quite. Try another option.
Answer: Backend as a Service (BaaS)
Firebase provides pre-built backend services like authentication, databases, and notifications, allowing developers to focus on the frontend. This model is known as Backend as a Service (BaaS).
Question 22 of 60 · Feature of Firebase · Medium
An e-commerce app requires complex queries to filter products by price, category, and brand simultaneously. It also needs to scale globally with strong data consistency. Which Firebase database solution is better suited for this requirement?
Not quite. Try another option.
Answer: Cloud Firestore due to its advanced querying and scalability
Cloud Firestore is designed for complex, indexed queries and offers better scalability and reliability for large, complex applications compared to the Realtime Database's simpler data structure.
Question 23 of 60 · connecting firebase to app · Medium
When building an Android app with different build flavors (e.g., 'dev' and 'prod') that connect to separate Firebase projects, where should the respective google-services.json files be placed?
Not quite. Try another option.
Answer: Place google-services.json for the 'dev' flavor in app/src/dev/ and for 'prod' in app/src/prod/.
The Google Services Gradle plugin automatically detects the build flavor and uses the google-services.json file from the corresponding source set directory (e.g., app/src/<flavorName>/).
Question 24 of 60 · Firebase Authentication · Medium
After a user successfully signs in using Firebase Authentication, the client app receives an ID token. What is the primary purpose of this token for validating the user on a custom backend server?
Not quite. Try another option.
Answer: To securely send to your custom backend server, which can verify it to authenticate the user's API calls.
The Firebase ID token is a JSON Web Token (JWT) that proves a user's identity. It can be sent to a backend server, which can then verify the token's integrity to securely identify which user is making a request.
Question 25 of 60 · Firebase Authentication · Medium
What is the recommended approach for an Android Activity to react to a user signing in or out at any point while the app is running?
Not quite. Try another option.
Answer: Register an FirebaseAuth.AuthStateListener in onStart() and unregister it in onStop().
The AuthStateListener is the designated callback for observing changes in the user's sign-in state. Attaching it in onStart() and detaching in onStop() follows the recommended Android Activity lifecycle management.
Question 26 of 60 · Firebase UI · Medium
A developer needs to add sign-in with Google, Email, and Phone Number to their app. Why might they choose to use the Firebase UI Auth library instead of implementing the Firebase Auth SDK for each provider manually?
Not quite. Try another option.
Answer: It provides a complete, drop-in UI flow that handles user journeys like sign-up, sign-in, and password resets, significantly reducing boilerplate code.
The main advantage of Firebase UI Auth is that it abstracts away the entire user interface and logic for handling multiple authentication providers, including edge cases, which saves significant development time.
Question 27 of 60 · Real time dataset base configure and setup · Medium
You are building a chat application using the Firebase Realtime Database. To optimize for performance and scalability, what is the recommended way to structure the data for a group chat with many messages?
Not quite. Try another option.
Answer: Denormalize the data by storing messages in a flat list and using a separate index to map chat rooms to messages.
Firebase Realtime Database works best with flat data structures. Deeply nesting data or fetching large arrays is inefficient. Denormalizing (flattening) the data allows you to download only the necessary subsets of data for a given view, improving performance.
Question 28 of 60 · Real time dataset base configure and setup · Medium
You need to configure Firebase Realtime Database security rules for a userProfiles node. The rule should allow any authenticated user to read any profile, but a user should only be able to write to their own profile data. Which of the following rules accomplishes this?
The rule ".read": "auth != null" grants read access to all authenticated users. The nested rule under the wildcard "$uid" uses ".write": "auth.uid == $uid" to ensure that the authenticated user's ID (auth.uid) matches the key of the data they are trying to write to ($uid).
Question 29 of 60 · CRUD operation · Medium
Given a user object at users/user123 with the data { "name": "Alice", "email": "alice@example.com", "level": 5 }, which CRUD operation would you use to change the level to 6 and add a new status field with the value "active", without affecting the name and email?
updateChildren() updates only the specified keys at a location without overwriting the entire object. In contrast, setValue() would completely replace the existing data at users/user123 with the new map, deleting the name and email fields.
Question 30 of 60 · CRUD operation · Medium
In a multiplayer game, you are using the Realtime Database to store a player's score. Multiple events can increase the score concurrently. Why is using a transaction (runTransaction()) the correct way to update the score?
Not quite. Try another option.
Answer: To prevent race conditions where concurrent writes might overwrite each other, ensuring the final score is a result of all increments.
A transaction is an atomic operation. It reads the current value, applies the update logic, and writes the new value back. If the data was modified by another client during this process, the transaction re-runs, ensuring that no concurrent updates are lost.
Question 31 of 60 · Firebase Notification · Medium
When using Firebase Cloud Messaging (FCM) in an Android app, what is the key difference in behavior when a notification payload is received while the app is in the foreground versus in the background?
Not quite. Try another option.
Answer: In the background, the system tray handles the notification automatically. In the foreground, the onMessageReceived() callback is always triggered for you to handle the message.
Android's behavior with FCM messages depends on the app's state. When backgrounded, notification payloads are shown in the system tray. When foregrounded, the FirebaseMessagingService's onMessageReceived() method is invoked, giving the developer full control.
Question 32 of 60 · Firebase Notification · Medium
You are building a feature to send a direct message notification to a specific user. After the user logs into your app, you retrieve and store their unique FCM registration token on your server. How do you use this token to send a notification to only that user's device?
Not quite. Try another option.
Answer: In your server-side code (e.g., using Firebase Admin SDK), set the token field in the message payload to the user's specific registration token.
The FCM registration token is a unique identifier for a specific app instance on a device. To target that single device, you send a message request to the FCM backend specifying that exact token.
Question 33 of 60 · CRUD operation · Medium
On a user's profile screen, you need to load their username and bio once when the screen opens. The data is not expected to change while the user is on that screen. Which method for reading data from the Firebase Realtime Database is most efficient for this use case?
Not quite. Try another option.
Answer: addListenerForSingleValueEvent() to fetch the data once.
addListenerForSingleValueEvent() reads the data at a location and triggers the callback once with the result. It does not continue to listen for changes, making it perfect for data that only needs to be fetched once, saving network bandwidth and resources.
Question 34 of 60 · Firebase UI · Medium
You are using the Firebase UI Auth library and want to build a sign-in screen that only offers Google Sign-In and Email/Password authentication. How would you configure the AuthUI.SignInIntentBuilder?
Not quite. Try another option.
Answer: Call createSignInIntentBuilder().setAvailableProviders(Arrays.asList(new AuthUI.IdpConfig.GoogleBuilder().build(), new AuthUI.IdpConfig.EmailBuilder().build()))
The setAvailableProviders method on the SignInIntentBuilder allows you to explicitly define a list of IdpConfig objects for the providers you want to display on the sign-in screen. This is the correct way to customize the offered sign-in methods.
Question 35 of 60 · Feature of Firebase · Medium
Your app has a "theme of the day" feature that changes the app's color scheme daily. You want to be able to change this theme for all users without shipping a new app update. Which Firebase feature is best suited for this purpose?
Not quite. Try another option.
Answer: Firebase Remote Config
Firebase Remote Config is designed specifically for changing the behavior and appearance of your app without requiring an app update. You can define parameters (like daily_theme_color) in the Firebase console and fetch their values in your app at runtime.
Question 36 of 60 · connecting firebase to app · Medium
An Android app successfully connects to Firebase, but after adding a new build variant (e.g., 'staging'), the new variant fails to connect. The error is "Default FirebaseApp is not initialized". What is a likely cause of this issue?
Not quite. Try another option.
Answer: The apply plugin: 'com.google.gms.google-services' line is missing or misplaced in the app-level build.gradle file.
The Google Services Gradle plugin reads the google-services.json file and auto-initializes Firebase. It must be applied at the end of the app-level build.gradle file. If it's missing or placed incorrectly, the initialization process can fail, especially in multi-flavor projects.
Question 37 of 60 · Firebase Authentication · Medium
A user first uses an app with an anonymous account. Later, they decide to create a permanent account using their Google profile. What is the correct Firebase Authentication procedure to merge their anonymous session data with the new Google account?
Not quite. Try another option.
Answer: Get an AuthCredential from the Google Sign-In result and use firebaseAuth.getCurrentUser().linkWithCredential(credential).
Firebase Authentication provides the linkWithCredential method precisely for this purpose. It allows you to link an existing user account (including anonymous ones) to a new authentication provider, effectively merging the two accounts under a single Firebase UID.
Question 38 of 60 · CRUD operation · Medium
In the Firebase Realtime Database, which of the following method calls on a DatabaseReference pointing to users/user123 is the standard and most explicit way to delete all data at that location?
Not quite. Try another option.
Answer: ref.removeValue()
The removeValue() method is the explicit and recommended way to delete data at a given database reference. While setValue(null) also works, removeValue() is clearer in its intent. The other methods do not exist in the SDK.
Question 39 of 60 · Firebase Notification · Medium
Your news app allows users to subscribe to different categories like 'sports' and 'technology'. If a user wants to receive notifications for 'sports' but not 'technology', which Firebase Cloud Messaging methods should the app call?
Not quite. Try another option.
Answer: FirebaseMessaging.getInstance().subscribeToTopic("sports") and FirebaseMessaging.getInstance().unsubscribeFromTopic("technology")
FCM provides distinct methods for managing topic subscriptions. subscribeToTopic() adds a subscription, and unsubscribeFromTopic() removes one. These operations are independent and allow for granular control over which topics a device is subscribed to.
Question 40 of 60 · Introduction of Firebase · Medium
What is a key advantage of Firebase's real-time data synchronization for collaborative applications, such as a shared whiteboard or a group document editor?
Not quite. Try another option.
Answer: It automatically handles offline data persistence and synchronizes changes back to the server once connectivity is restored.
A major strength of Firebase's databases is their built-in offline support. The SDKs maintain a local cache. Any writes made while offline are queued and automatically sent to the server when the device reconnects, simplifying the development of collaborative apps that work seamlessly.
Question 41 of 60 · CRUD operation · Hard
In a Firebase Realtime Database, multiple users are concurrently trying to increment a 'like' counter on a post. Using a simple setValue(currentValue + 1) call leads to a race condition and lost updates. Which of the following is the most robust solution to ensure atomicity for the increment operation?
Not quite. Try another option.
Answer: Using a runTransaction block to read the current value, increment it, and set the new value.
While ServerValue.increment(1) is an atomic operation for Firestore, the correct method for Realtime Database is using a transaction. The runTransaction block provides a current snapshot of the data and retries the update function automatically if the data is modified by another client before the write is committed, thus preventing race conditions.
Question 42 of 60 · Firebase Authentication · Hard
When a user signs in with Firebase Authentication, the client receives an ID Token. When this token is sent to your backend server for verification, what is the primary purpose of checking the 'aud' (Audience) claim within the JWT payload?
Not quite. Try another option.
Answer: To verify that the token was intended for your specific Firebase project and not another.
The 'aud' (Audience) claim in the ID Token contains your Firebase Project ID. Verifying it ensures that a token issued for one project cannot be used to authenticate with another project's backend, preventing a type of replay attack.
Question 43 of 60 · Firebase Notification · Hard
Your Android app receives an FCM message with both notification and data payloads while the app is in the background. What is the expected behavior on the device?
Not quite. Try another option.
Answer: The system tray displays the notification automatically, and onMessageReceived() is not called. The data payload is delivered in the Intent extras of the launcher Activity if the user taps the notification.
When an app is in the background, FCM messages with a notification payload are handled by the system tray. onMessageReceived is bypassed. The custom key-value pairs from the data payload are only accessible when the user interacts with the notification.
Question 44 of 60 · Real time dataset base configure and setup · Hard
You are designing a security rule for a userProfiles node in Realtime Database. You want to allow a user to write to their own profile (/userProfiles/$uid) but only if the new email field being written matches the email associated with their authentication token. Which rule correctly implements this complex validation?
This rule correctly separates concerns. The .write rule ensures authentication (only the user can write to their node), while the .validate rule checks the integrity of the incoming data (newData) against the user's verified token email before the write is committed. This is more secure and efficient than putting all logic in the .write rule.
Question 45 of 60 · connecting firebase to app · Hard
You are building an Android app with 'dev' and 'prod' product flavors, each requiring a different Firebase project. What is the correct way to configure your build.gradle and project structure to handle the different google-services.json files?
Not quite. Try another option.
Answer: Create directories app/src/dev/ and app/src/prod/ and place the corresponding google-services.json file inside each.
The Google Services Gradle plugin is designed to automatically detect the correct google-services.json file based on the build variant. By placing each configuration file in the source set directory for that specific product flavor (app/src/flavorName/), Gradle will select the appropriate one during the build process.
Question 46 of 60 · Firebase UI · Hard
You are using FirebaseUI for Authentication. A user attempts to sign up with an email address that is already associated with an account created via a different provider (e.g., Google). What is the specific error code you should check for in the IdpResponse to handle this account collision scenario and prompt the user to link the accounts?
Not quite. Try another option.
Answer: ErrorCodes.EMAIL_MISMATCH_ERROR
FirebaseUI Auth uses ErrorCodes.EMAIL_MISMATCH_ERROR to indicate that the email is already in use by another authentication provider. Your app should catch this specific error, fetch the sign-in methods for that email using fetchSignInMethodsForEmail(), and then guide the user through the process of signing in with the existing provider to link the new credential.
Question 47 of 60 · CRUD operation · Hard
You are modeling a social media app in Realtime Database. To display a user's feed, you need to retrieve 20 posts and, for each post, the author's username and profile picture. A naive approach is to nest author data inside each post object. What is the primary scalability problem with this nested approach?
Not quite. Try another option.
Answer: It makes updating a user's username inefficient, as it requires updating every post they've ever made.
This is a classic denormalization problem. While nesting data simplifies reads, it creates massive write amplification for updates. If a user with 10,000 posts changes their username, you would have to update 10,000 separate locations. The recommended 'flatter' approach is to store user data separately and reference it by user ID in the posts.
Question 48 of 60 · Firebase Authentication · Hard
You need to implement a custom authentication system where your existing backend server validates user credentials. What is the correct and secure flow for your backend to grant a user access to Firebase services?
Not quite. Try another option.
Answer: The backend uses the Firebase Admin SDK's createCustomToken(uid) method to generate a signed token, which is sent to the client to be used with signInWithCustomToken().
The secure flow for custom authentication involves your server acting as the source of truth. After validating credentials, it uses the Admin SDK—which has service account privileges—to mint a short-lived, signed custom token for a specific UID. The client then exchanges this token with Firebase Auth for a standard ID and Refresh token.
Question 49 of 60 · Firebase Notification · Hard
Using the Firebase Admin SDK on a server, you send a high-priority FCM message with a ttl (time_to_live) of 3600 seconds to an Android device that is currently turned off. The device is turned back on 2 hours (7200 seconds) later. What happens?
Not quite. Try another option.
Answer: The message is discarded by FCM servers and is never delivered because its ttl has expired.
The time_to_live (TTL) parameter specifies the maximum lifespan of a message in seconds. If the device is offline for longer than the TTL, FCM servers will discard the message to prevent the delivery of stale data. In this case, 7200 seconds is greater than the 3600-second TTL.
Question 50 of 60 · Real time dataset base configure and setup · Hard
To optimize queries in Realtime Database, you add an .indexOn rule for a timestamp child key in your security rules. Which of the following queries will NOT be able to leverage this server-side index?
The .indexOn rule explicitly tells Firebase to create a server-side index for a specific child key (timestamp in this case). Queries that use orderByChild on any other key (user_id) will not use the index. This will work for small datasets but will fail or perform very poorly on large datasets, and Firebase will log a performance warning in the console.
Question 51 of 60 · Feature of Firebase · Hard
You are building an app that requires complex, chained queries (e.g., "find all cities with a population greater than 1 million in countries that are in Europe"). It also needs robust offline capabilities. Which Firebase database product is architecturally better suited for this task and why?
Not quite. Try another option.
Answer: Cloud Firestore, because it supports compound queries on multiple fields and has a more advanced offline caching mechanism.
Cloud Firestore is designed for more complex data models and querying than Realtime Database. It natively supports creating indexes and running compound queries across multiple fields within a collection. Realtime Database queries are limited to ordering/filtering by a single child key. Firestore also has a superior, query-aware offline persistence model.
Question 52 of 60 · Firebase Authentication · Hard
A user authenticated with Google Sign-In tries to sign up using the same email address with the Email/Password provider. Your app correctly catches the FirebaseAuthUserCollisionException. What is the required sequence of actions to link the new Email/Password credential to the existing Google account?
Not quite. Try another option.
Answer: Get the AuthCredential from the exception, sign the user in with Google, and then call firebaseUser.linkWithCredential(credential).
The correct and secure flow is to first re-authenticate the user with their original provider (Google) to prove ownership of the account. Once you have the currently signed-in FirebaseUser, you can use the AuthCredential object, which is helpfully attached to the collision exception, and pass it to the linkWithCredential method to safely merge the accounts.
Question 53 of 60 · CRUD operation · Hard
What is the primary function of the onDisconnect() operation in the Firebase Realtime Database SDK, and what is a key limitation to be aware of?
Not quite. Try another option.
Answer: It queues a set of write operations on the Firebase server to be executed when the client disconnects. These operations are not guaranteed if the server crashes.
onDisconnect() is a server-side mechanism for managing state after a client goes offline. It's commonly used for presence systems. The operations (like setValue or remove) are held on the Firebase server and executed when the server detects the client has disconnected. However, it's a best-effort operation and is not guaranteed to execute in all failure scenarios.
Question 54 of 60 · Real time dataset base configure and setup · Hard
You need to write a security rule that allows a user to read a specific 'group' document only if their auth.uid is present as a key in the members map of that same group document. Which rule structure is the most efficient and correct way to achieve this?
This rule is the most direct and performant. It uses the data variable to refer to the document being accessed ($groupId). It then checks for the existence of the user's UID as a key within the members map using child(auth.uid).exists(). The other options are either inefficient (reading from root), incorrect syntax (.contains()), or irrelevant (query).
Question 55 of 60 · connecting firebase to app · Hard
After uploading your release APK to the Play Store, Google Play App Signing re-signs your app with a new key. You notice that Firebase features dependent on the SHA-1 fingerprint, like Google Sign-In and Phone Auth, are failing for users downloading from the store. What is the cause and correct solution?
Not quite. Try another option.
Answer: You need to retrieve the 'App signing key certificate' SHA-1 from the Play Console and add it to your Firebase project settings.
When Google Play App Signing is enabled, Google replaces your upload key with a new signing key before distributing the app. Firebase services rely on the SHA-1 of the final signing key. You must copy the SHA-1 fingerprint for the 'App signing key certificate' from the 'App integrity' section of the Play Console and add it to your app's configuration in the Firebase console.
Question 56 of 60 · CRUD operation · Hard
You are implementing infinite scroll pagination in Realtime Database for a list of items sorted by a unique timestamp. Your initial query is ref.orderByChild("timestamp").limitToFirst(10). To fetch the next page, what is the correct and most performant query?
Using only the timestamp with startAt can lead to issues if multiple items have the exact same timestamp. To create a stable cursor, you must provide a second argument to startAt: the key of the last item from the previous page. This tells Firebase exactly where to resume the query, preventing duplicate or skipped items.
Question 57 of 60 · Feature of Firebase · Hard
Which statement accurately describes a key architectural difference between Firebase Realtime Database (RTDB) and Cloud Firestore regarding how they charge for usage?
Not quite. Try another option.
Answer: RTDB charges primarily for bandwidth and storage, while Firestore charges primarily for the number of read/write/delete operations.
This is a fundamental difference in their pricing models. RTDB's pricing is based on the amount of data downloaded/stored and simultaneous connections. Firestore's model is more granular, billing per document read, written, and deleted, in addition to storage and network egress. This makes Firestore potentially more cost-effective for apps with many small, infrequent updates.
Question 58 of 60 · Firebase Authentication · Hard
A user's Firebase ID token has expired. Your client code attempts to make an authenticated request to a backend resource protected by Firebase security rules. What is the expected behavior of the Firebase SDK?
Not quite. Try another option.
Answer: The SDK automatically queues the request, silently uses the refresh token to get a new ID token, and then retries the request transparently.
The Firebase client SDKs (for Android, iOS, Web) are designed to manage token lifecycle automatically. When an ID token expires (typically after 1 hour), the SDK will use the long-lived refresh token to obtain a new ID token from the Firebase Auth servers without requiring developer intervention. This process is transparent to the app code making the database/storage request.
Question 59 of 60 · Firebase UI · Hard
You want to implement a custom theme for the FirebaseUI Auth flow that matches your app's branding, including specific colors for the primary button and a custom logo. What is the correct method for achieving this deep customization?
Not quite. Try another option.
Answer: Create a new style in your styles.xml that inherits from one of the FirebaseUI themes (e.g., FirebaseUI.Auth.Theme) and override specific attributes like colorPrimary and colorButtonNormal. Then, set this style in the createSignInIntentBuilder().
FirebaseUI is designed to be customizable through Android's style and theme system. The proper way is to define a custom style that inherits from a FirebaseUI base theme and then override the desired material design attributes. This custom theme can then be applied to the sign-in flow using the .setTheme() method on the intent builder.
Question 60 of 60 · Firebase Notification · Hard
You need to send a time-critical notification with a custom sound that should bypass the user's Doze mode settings to the greatest extent possible. Which combination of parameters in the server-side FCM payload is most effective for this purpose?
Setting the priority to high at the top level and within the android specific block signals to FCM and the device that the message is important, increasing its likelihood of being delivered immediately even in power-saving modes. For Android 8.0+, specifying a high-importance channel_id is also crucial for controlling sound and visual interruption behavior.
That's unit 1
Answer a few questions and your score shows up here.
Nearly through. Did unit 1 of CSE227 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 1 of CSE227 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.