AZ-204 Develop Azure compute solutions Practice Question
You are a developer at a financial services company. You need to design a solution for processing real-time stock trade data. The system receives thousands of trades per second from an on-premises system. Each trade must be validated, enriched with reference data, and then stored in a data lake for analytics. You have the following requirements: - The processing must be serverless and scale automatically with high throughput. - The enrichment step requires calling an external REST API that can handle up to 100 requests per second. If the API is overwhelmed, trades must be retried with exponential backoff. - The solution must minimize cost and operational overhead. - Trades must be processed in order per stock symbol. You provision an Azure Event Hubs namespace with a single event hub. Trades are sent to the event hub with the stock symbol as the partition key. You configure an Azure Functions app with an Event Hubs trigger to process events. The function validates, enriches by calling the external API, and writes the enriched trade to Azure Data Lake Storage. During testing, you notice that some trades are processed out of order for the same stock symbol when the external API throttles requests. What should you do to ensure ordering per stock symbol?
⚠ Common exam trap
Test-takers frequently assume increasing batch size improves throughput without realizing that it can break ordering when retries are involved, or they mistakenly think Durable Functions are needed for any ordering requirement.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Set the 'maxEventBatchSize' to 1 in the host.json file to process one event at a time per instance.
Setting 'maxEventBatchSize' to 1 ensures that each function instance processes only one event at a time. When the external API throttles and triggers retries with exponential backoff, processing of subsequent events for the same partition (stock symbol) is blocked until the current event completes. This preserves the per-partition ordering guarantee that Event Hubs provides, as events within a partition are processed sequentially by a single consumer.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Durable Functions to orchestrate the processing and enforce ordering.
Why it's wrong here
Using Durable Functions for simple sequential processing within an Event Hubs partition introduces unnecessary architectural complexity and overhead. Event Hubs inherently guarantees message ordering *within a single partition*, meaning events sent to the same partition are delivered to consumers in the order they were published. Durable Functions are designed for stateful, long-running orchestrations and complex workflows, which are not required when the primary goal is merely to preserve the existing stream order.
- ✗
Increase the 'maxEventBatchSize' setting to 100 in the host.json file to improve throughput.
Why it's wrong here
Increasing the 'maxEventBatchSize' to 100 would allow the Azure Function to receive and process up to 100 events concurrently within a single batch from an Event Hubs partition. While this can improve overall throughput by reducing trigger invocations, it directly compromises the requirement for strict ordering. Processing multiple events from the same partition simultaneously means there's no guarantee that the processing of event N will complete before event N+1, leading to out-of-order results.
- ✓
Set the 'maxEventBatchSize' to 1 in the host.json file to process one event at a time per instance.
Why this is correct
Setting 'maxEventBatchSize' to 1 in the host.json file ensures that the Azure Function's Event Hubs trigger processes only one event at a time from each partition it consumes. This configuration is critical for maintaining strict sequential processing order within an Event Hubs partition. By forcing single-event processing, the function guarantees that event N is fully processed before event N+1 from the same partition is even delivered, thereby preserving the required transactional integrity.
- ✗
Use a different partition key such as a unique trade ID to distribute load evenly.
Why it's wrong here
Using a different partition key, such as a unique trade ID, would indeed distribute the load more evenly across Event Hubs partitions. However, this approach would shatter the crucial ordering requirement for events related to the *same stock symbol*. Event Hubs only guarantees ordering *within a single partition*; if trades for the same stock symbol are spread across multiple partitions, their processing order cannot be guaranteed, leading to potential inconsistencies in financial calculations.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Durable Functions
Durable Functions is an extension of Azure Functions that lets you write stateful workflows in code, managing complex sequences of tasks, retries, and delays automatically.
Key term
Azure Event Hubs
Azure Event Hubs is a cloud-based service that ingests and processes millions of events per second from devices, applications, and services in real time.
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.