Platform Events interview questions
Platform Events come up whenever an interviewer wants to talk about decoupling systems. Know how publishing works, how subscribers recover, and when Change Data Capture is the better fit.
On this page (6 sections)
Interview questionsCommon MistakesRelated Platform Events Interview QuestionsFrequently Asked Questions about Platform Events InterviewsRelated CertificationsRelated ResourcesNew to this topic? Learn integration step by step before you practise.
Event-driven architecture is now standard in modern Salesforce projects. Interviewers ask about Platform Events to see if you can decouple systems, design for scale and avoid the classic pitfalls (lost events, infinite trigger loops, capacity planning).
01What are Platform Events in Salesforce?
What are Platform Events in Salesforce?
Platform Events are the event-driven messaging backbone of Salesforce. Publishers publish events, subscribers (Apex triggers, Flows, external systems via CometD/Pub-Sub API) consume them in near real-time. Used to decouple systems and enable event-driven architectures.
02How do you publish a Platform Event?
How do you publish a Platform Event?
Three ways: (:
- Apex: EventBus.publish(new MyEvent__e(Field__c='value')); (.
- Flow: Create Records action with the event as the object; (.
- External system: REST API POST to /services/data/vXX/sobjects/MyEvent__e/.
03How do you subscribe in Apex?
How do you subscribe in Apex?
Create a trigger on the event after insert: trigger MyEventTrigger on MyEvent__e (after insert) { for (MyEvent__e e : Trigger.new) { /* handle */ } }. Runs in the Automated Process user context, not the publisher's user context.
04What's the difference between Standard-Volume and High-Volume events?
What's the difference between Standard-Volume and High-Volume events?
High-Volume Platform Events (HVPE) are the modern default: designed for millions of events/day, durable for 72 hours, support replay. Standard-Volume is legacy with lower throughput and is being deprecated. Always pick HVPE for new work.
05What is the Pub/Sub API?
What is the Pub/Sub API?
gRPC-based modern subscriber API for external systems. Replaces CometD-based Streaming API. Supports replay, error recovery, and is significantly more efficient. Use it for any new external Platform Event subscriber.
06How do you handle event delivery failures?
How do you handle event delivery failures?
In Apex triggers, use EventBus.TriggerContext.currentContext().setResumeCheckpoint(replayId) to mark progress. On uncaught exceptions, the platform replays the event up to 5 times. For external subscribers, persist the lastReplayId and resume from it after restarts.
07Can Platform Events fire from within transactions?
Can Platform Events fire from within transactions?
Yes, but they're not delivered until the transaction commits successfully. EventBus.publish with publishBehavior=PUBLISH_AFTER_COMMIT (default) waits for commit. PUBLISH_IMMEDIATELY publishes regardless of rollback: use carefully.
08What are Change Data Capture (CDC) events?
What are Change Data Capture (CDC) events?
Auto-generated Platform Events that fire when records change: no Apex required. Configure which objects emit CDC in Setup. Subscribers get the changed fields and old values. Great for keeping external systems in sync without trigger code.
09Platform Events vs Outbound Messages: when to use each?
Platform Events vs Outbound Messages: when to use each?
Platform Events: real-time, multiple subscribers, modern. Outbound Messages: declarative, SOAP-based, single endpoint, retries with backoff for 24h. Use Platform Events for new event-driven work, Outbound Messages for simple legacy integrations.
10What governor limits apply to Platform Events?
What governor limits apply to Platform Events?
Daily event publish allocation based on edition (e.g. ~250K for Enterprise, more with add-ons). Per-transaction publish limit. Subscriber Apex CPU and SOQL limits apply to the trigger context. Plan capacity before designing event-heavy architectures.
Common Mistakes
Non-idempotent subscribers. Replays will duplicate work: design for at-least-once.
Publishing inside loops. Bulk-publish a list instead.
Ignoring replayId persistence. External subscribers lose events after restart.
Using Standard-Volume for new work. Always pick HVPE.
Frequently Asked Questions about Platform Events Interviews
Are Platform Events guaranteed delivery?
At-least-once for HVPE within the 72-hour retention window. Subscribers must be idempotent.
Can I unit-test a Platform Event?
Yes. EventBus.publish in a test method, then Test.getEventBus().deliver() to fire the trigger.
Do Platform Events count toward DML limits?
Yes, EventBus.publish counts as one DML statement per call.
Can a Flow subscribe to a Platform Event?
Yes. Platform Event-Triggered Flow runs when an event is published.
What is replayId?
Sequential ID assigned by Salesforce; subscribers persist it to resume from a known point after disconnection.
Related Certifications
PD2, Integration Architect, Application Architect. See certification guides.