MongoDB Questions and Answers – Model Monetary and Time Data

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Model Monetary and Time Data”.

1. __________ precision multiplies the monetary value by a power of 10.
a) Exact
b) Accurate
c) Ambiguity
d) None of the mentioned
View Answer

Answer: a
Explanation: MongoDB stores numeric data as either IEEE 754 standard 64-bit floating point numbers or as 32-bit or 64-bit signed integers.

2. Point out the correct statement.
a) Applications that handle monetary data often require capturing fractional units of currency
b) Applications that handle time data often require capturing fractional units of currency
c) Applications that handle temporal and spatial data often require capturing fractional units of currency
d) All of the mentioned
View Answer

Answer: a
Explanation: Some fractional numeric quantities, such as one third and one tenth, have no exact representation in binary floating point numbers.

3. Which of the following precision uses two values for the field?
a) Exact
b) Accurate
c) Ambiguity
d) None of the mentioned
View Answer

Answer: c
Explanation: Arbitrary Precision which uses two fields for the value: one field to store the exact monetary value as a non-numeric and another field to store a floating point approximation of the value.

4. MongoDB stores times in _____ by default, and will convert any local time representations into this form.
a) UTC
b) GMT
c) IST
d) None of the mentioned
View Answer

Answer: a
Explanation: Applications that must operate or report on some unmodified local time value may store the time zone alongside the UTC timestamp, and compute the original local time in their application logic.

advertisement
advertisement

5. Point out the wrong statement.
a) If you need to query the database for exact, mathematically valid matches, use Exact Precision
b) If you regularly need to perform server-side arithmetic on monetary data, the exact precision model may be appropriate
c) If you need to query the database for exact, mathematically valid matches, use Ambiguity Precision
d) None of the mentioned
View Answer

Answer: c
Explanation: If you need to be able to do server-side arithmetic, e.g., $inc, $mul, and aggregation framework arithmetic, use Exact Precision.

6. Which of the following is used to handle arbitrary or unforeseen number of precision?
a) Exact
b) Accurate
c) Ambiguity
d) None of the mentioned
View Answer

Answer: c
Explanation: If there is no need to perform server-side arithmetic on monetary data, modeling monetary data using the arbitrary precision model may be suitable.

Note: Join free Sanfoundry classes at Telegram or Youtube

7. Use of the approximation field for the query and sort operations requires that applications perform _______ side post-processing.
a) client
b) server
c) application
d) none of the mentioned
View Answer

Answer: a
Explanation: Client side processing is used to decode the non-numeric representation of the exact value and then filter out the returned documents based on the exact monetary value.

8. The ______ factor is a constant and known property of the currency.
a) rank
b) scale
c) high
d) none of the mentioned
View Answer

Answer: b
Explanation: Applications can determine the scale factor from the currency.

advertisement

9. In one field, exact monetary value is encoded as a _________ data type.
a) numeric
b) character
c) non numeric
d) none of the mentioned
View Answer

Answer: b
Explanation: In one field, exact monetary value is encoded as a non-numeric data type; e.g., BinData or a string.

Sanfoundry Global Education & Learning Series – MongoDB.

advertisement

Here’s the list of Best Books in MongoDB.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.