C100DEV MongoDB Overview and Document Model Practice Question
A developer is building a MongoDB application to store sensor readings from thousands of IoT devices. Each reading document contains a device ID, timestamp, and an array of up to 100 numeric values. The developer wants to minimize document size and storage overhead while preserving the ability to query individual readings. Which BSON data type should be used to store the numeric values array to achieve the smallest document size?
⚠ Common exam trap
The trap here is assuming that the default numeric type (double) is always the most efficient, when smaller integer types can significantly reduce document size for whole numbers.
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
✓
Store the values as a BSON array of 32-bit integers (int).
For integer sensor readings, the 32-bit integer BSON type offers the best balance of compactness and queryability. It uses half the space of a double and allows direct indexing and querying of array elements, unlike binary blobs. Decimal128 and doubles are unnecessarily large for whole numbers, and BinData would require custom deserialization.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Store the values as a BSON array of Decimal128.
Why it's wrong here
Decimal128 is a 128-bit decimal floating-point type designed for monetary and high-precision calculations. It consumes 16 bytes per value, quadruple the size of a 32-bit integer, and is overkill for sensor readings that do not require exact decimal arithmetic. Using Decimal128 would increase document size and reduce performance without any benefit.
- ✗
Store the values as a BSON array of doubles.
Why it's wrong here
Each double in BSON consumes 8 bytes plus array overhead, resulting in a relatively large document for 100 values. While doubles are the default numeric type in the mongo shell, they are not the most compact choice for numeric arrays when fractional precision is not required. This option increases storage and memory usage unnecessarily for integer sensor readings.
- ✗
Store the values as a BSON binary subtype 0 (generic binary) using the BinData type.
Why it's wrong here
BinData stores raw bytes but does not provide native numeric interpretation or indexing for individual elements. To query specific values, the application would need to deserialize the binary blob, which defeats the purpose of storing an array. While compact, it sacrifices queryability and adds application-side complexity that is not warranted here.
- ✓
Store the values as a BSON array of 32-bit integers (int).
Why this is correct
BSON 32-bit integers occupy 4 bytes each, half the size of a double. For sensor readings that are whole numbers, this reduces document size significantly while preserving array structure and allowing direct queries on elements. The int type is fully supported by MongoDB drivers and maintains indexability, making it the most efficient choice for this scenario.
About these practice questions
This C100DEV question is part of Courseiva's 259-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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DEV practice question is part of Courseiva's free MongoDB 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 C100DEV exam.