Serving Predictions via Firebase Cloud Messaging for Scale
Short answer
D Use Firebase Cloud Messaging to send personalized push notifications to registered user devices when their individual predicted balance falls below the threshold.
Question
balances 3 days in the future. Your team will use the results in a new feature that will notify users when their account balance is likely to drop below $25. How
should you serve your predictions?
Key Takeaways
The main trap is assuming Pub/Sub can handle one-topic-per-user architectures; FCM is the scalable solution for individual push notifications.
Learn how to serve ML predictions to millions of users using Firebase Cloud Messaging (FCM) instead of Pub/Sub to avoid quota limits and ensure personalized delivery.
Common mistake: Candidates often choose Option A (Pub/Sub + Cloud Function) because it feels like a standard serverless pattern, failing to recognize that creating millions of topics hits hard quota limits and does not scale.
Expert Analysis
The Trap: Pub/Sub for Personalization Option A is the most attractive distractor because it attempts to provide a real-time, event-driven architecture using Cloud Functions and Pub/Sub. In many serverless scenarios, this pattern works well. However, the question specifies "millions of customers" and requires individual notifications based on specific user predictions. Creating a dedicated Pub/Sub topic for each of millions of users exceeds Google Cloud's hard quota limits (typically 10,000 topics per project) and makes subscription management impossible at scale. This violates the scalability constraint inherent in objective 4.2.
Why Firebase Cloud Messaging (FCM) is Correct Option D correctly utilizes Firebase Cloud Messaging (FCM), which is designed specifically for sending push notifications to mobile and web clients at scale. FCM allows you to register user devices with unique tokens or IDs and target messages to specific individuals without managing individual message queues for every user. It handles the delivery infrastructure, ensuring that when your model predicts a balance drop below $25, the notification reaches the correct device efficiently and cost-effectively.
Eliminating Other Options Option B suffers from the same Pub/Sub quota issue as Option A. Option C is incorrect because it sends notifications based on the average of all account balances, whereas the requirement is to notify users when their own predicted balance drops below the threshold. Therefore, D is the only option that satisfies both the technical constraints (scalability/quota) and the business logic (personalized alerts).
Official Reference
- https://cloud.google.com/pubsub/quotas#resource_limits
- https://firebase.google.com/docs/cloud-messaging
These links open the official vendor documentation in a new tab.
Exam Strategy
When designing solutions for 'millions' of users, always check service quotas first. If an option suggests creating one resource instance (like a Pub/Sub topic or Datastore entity) per user, it is likely incorrect due to scalability limits. Prefer managed messaging services like FCM for end-user notifications over building custom queue-per-user architectures.
Frequently Asked Questions
Why can't I create a Pub/Sub topic for each user?
What is the difference between Option C and Option D?
Community Votes
91% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 19 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 19
-
salsabilsf 👍 20Should be D ! creating a Pub/Sub topic for each user is overkill
-
SlipperySlope 👍 9 Answered DD is correct. Firebase is designed for exactly this sort of scenario. Also, it would not be possible to create millions of pubsub topics due to GCP quotas https://cloud.google.com/pubsub/quotas#quotas https://firebase.google.com/docs/cloud-messaging
-
fdmenendez 👍 4Project limit is 10,000 topics, you could have multiple projects but that does not scale well. so D. https://cloud.google.com/pubsub/quotas#resource_limits
-
Danny2021 👍 4Answer is D. FCM is designed for this type of notification sent to mobile and desktop apps.
-
Y2Data 👍 3Yes, create a topic is overkill but not a NOTIFICATION SYSTEM. it's totally normal. Seriously, the step two involves "REGISTER EACH USER ....", how is this better than create a topic???? should be A and it's so obvious!
Show 14 more comments
-
Danny2021 👍 3A doesn't work. There is a quota limit on the number of pub/sub topics you can create, also one Cloud function cannot subscribe to millions of topics. A doesn't scale at all.
-
q4exam 👍 3I think A is straight forward answer but in real life, customer also consider cost, so practically, app engine will be picked in this case..... because of the large user base
-
NamitSehgal 👍 3D looks more relevant Notification messages: Simply display a message content, which is handled by the FCM SDK. Data Messages: Display a message with some set interactions
-
Mohamed_Mossad 👍 3 Answered D"Create a Pub/Sub topic for each user" this is crazy , we can not imagine a system with millions of pub/sub topics , so A,B wrong C also wrong
-
Kowalski 👍 3Pub/Sub has a limit of 10,000 topics only and can't be increased https://cloud.google.com/pubsub/quotas#resource_limits.
-
Vidyasagar 👍 3 Answered DI think, D is the best answer
-
SergioRubiano 👍 2 Answered D"Create a Pub/Sub topic for each user" xD
-
OpenKnowledge 👍 1 Answered DThis is similar to how the push notification works to send notifications to ios and android devices. Firebase cloud messaging (FCM), formerly known as Google cloud messaging (GCM), can be set to configure push notifications to ios, Android and web applications from server (in this case the banking application server) when the user registers his device to receive the notifications.
-
taylz876 👍 1 Answered DD- You need to send a personalized push notification to each of millions of users, based on that user's own prediction. Firebase Cloud Messaging (FCM) is built for this. It's free, scales to millions of devices, and delivers a message to a specific user's phone. Registering each user with a user ID lets you target the notification at the right person.
-
harithacML 👍 1 Answered Asimple answer , use tools most mentioned during training . , cloud functions
-
mmona19 👍 1 Answered DD- is more automated compared to A. A is overkill
-
fragkris 👍 1 Answered DD is correct. Firebase is used for applications.
-
PhilipKoku 👍 1 Answered DD) Firebase
-
M25 👍 1 Answered DWent with D
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All PMLE Questions
Access 65 questions with complete answers and detailed explanations.
View Full PMLE Practice Test →