MCQs > IT & Programming > JSON MCQs > Basic JSON MCQs

Basic JSON MCQ

1. What is supported by YAML but not supported by JSON?

Answer

Correct Answer: Comments

Note: This Question is unanswered, help us to find answer for this one

2. The JSON structure features nested objects and arrays. Sometimes the data containing these features exists in relational databases. How is the relational structure different that JSON?

Answer

Correct Answer: It has an array-only structure.

Note: This Question is unanswered, help us to find answer for this one

3. What characters are used to define an object?

Answer

Correct Answer: {}

Note: This Question is unanswered, help us to find answer for this one

4. Which code is a valid JSON equivalent of the key/value pair shown that also preserves the data type? variance: -0.0823

Answer

Correct Answer: "variance": "-0.0823"

Note: This Question is unanswered, help us to find answer for this one

5. What technique can you use to safely encode very large numbers?

Answer

Correct Answer: Store the number as a string

Note: This Question is unanswered, help us to find answer for this one

6. What is the only valid whitespace character within a string that does not require an escape character?

Answer

Correct Answer: Space

Note: This Question is unanswered, help us to find answer for this one

7. When parsing JSON, "caching" is a method used to _.

Answer

Correct Answer: Temporarily store data for faster access

Note: This Question is unanswered, help us to find answer for this one

8. If an object key contains spaces, how can you access its value in JavaScript?

Answer

Correct Answer: Use bracket notation to access the value.

Note: This Question is unanswered, help us to find answer for this one

9. How does JSON represent truth, falsity and nullness?

Answer

Correct Answer: True, false, null

Note: This Question is unanswered, help us to find answer for this one

10. In JSON, a set of brackets ([]) is used to denote _, whereas curly braces ({}) denote _.

Answer

Correct Answer: Arrays; objects

Note: This Question is unanswered, help us to find answer for this one

11. What is the minimum number of values in an array?

Answer

Correct Answer: Zero

Note: This Question is unanswered, help us to find answer for this one

12. How are the values in an array separated?

Answer

Correct Answer: With commas

Note: This Question is unanswered, help us to find answer for this one

13. What JavaScript method is used to load JSON data?

Answer

Correct Answer: JSON.parse()

Note: This Question is unanswered, help us to find answer for this one

14. What two nonnumerical characters can numbers contain?

Answer

Correct Answer: Dash and dot

Note: This Question is unanswered, help us to find answer for this one

15. Does JSON support signed numbers?

Answer

Correct Answer: No

Note: This Question is unanswered, help us to find answer for this one

16. What is the recommended term used to refer to multiple resources?

Answer

Correct Answer: Multiple resources

Note: This Question is unanswered, help us to find answer for this one

17. What is the maximum number of key/value pairs that JSON supports?

Answer

Correct Answer: There is no defined limit.

Note: This Question is unanswered, help us to find answer for this one

18. With what character should object keys be enclosed?

Answer

Correct Answer: ''

Note: This Question is unanswered, help us to find answer for this one

19. Can you assume the order of keys in an object?

Answer

Correct Answer: No, but you can sort the keys with JSON.sort().

Note: This Question is unanswered, help us to find answer for this one

20. What is the purpose of JSON?

Answer

Correct Answer: To provide a simple way to serialize and deserialize data between different sources

Note: This Question is unanswered, help us to find answer for this one

21. What character cannot be part of string within JSON without additional formatting?

Answer

Correct Answer: ''

Note: This Question is unanswered, help us to find answer for this one

22. What is the official MIME type for JSON?

Answer

Correct Answer: Application/json

Note: This Question is unanswered, help us to find answer for this one

23. What characters are used to enclose an array?

Answer

Correct Answer: {}

Note: This Question is unanswered, help us to find answer for this one

24. What technique can be used to represent complex objects with JSON?

Answer

Correct Answer: Nesting

Note: This Question is unanswered, help us to find answer for this one

25. What values can arrays contain?

Answer

Correct Answer: Any valid JSON value

Note: This Question is unanswered, help us to find answer for this one

26. With which programming language is JSON best used?

Answer

Correct Answer: Any language, as JSON is language agnostic.

Note: This Question is unanswered, help us to find answer for this one

27. How are values separated in JSON?

Answer

Correct Answer: With commas

Note: This Question is unanswered, help us to find answer for this one

28. How would you make the following string valid in JSON? "name": 'bb-8'

Answer

Correct Answer: "name": "bb-8"

Note: This Question is unanswered, help us to find answer for this one

29. How should comments be formatted in JSON?

Answer

Correct Answer: JSON does not support comments.

Note: This Question is unanswered, help us to find answer for this one

30. Which key format is valid JSON?

Answer

Correct Answer: "key": "value"

Note: This Question is unanswered, help us to find answer for this one

31. What are valid values in JSON?

Answer

Correct Answer: Objects, arrays, strings, numbers, booleans, null

Note: This Question is unanswered, help us to find answer for this one

32. What data structure do you use to encode ordered information?

Answer

Correct Answer: Array

Note: This Question is unanswered, help us to find answer for this one

33. How should a date value be stored in JSON?

Answer

Correct Answer: As a string in ISO 8601 format

Note: This Question is unanswered, help us to find answer for this one

34. Which number types are available in javascript but not supported in json?

Answer

Correct Answer: Infinity or NaN

Note: This Question is unanswered, help us to find answer for this one

35. If a string contains line breaks, what should you do?

Answer

Correct Answer: Replace any line breaks with \n

Note: This Question is unanswered, help us to find answer for this one

36. What character separates keys from values?

Answer

Correct Answer: :

Note: This Question is unanswered, help us to find answer for this one

37. With what character should key/value pairs be separated?

Answer

Correct Answer: Colon

Note: This Question is unanswered, help us to find answer for this one

38. Which code is valid JSON equivalent of the key/value pair shown that also preserves the data type?

Answer

Correct Answer: "variance": "-0.0823"

Note: This Question is unanswered, help us to find answer for this one

39. Which data format is a JSON schema written in?

Answer

Correct Answer: JSON

Note: This Question is unanswered, help us to find answer for this one

40. Which key name is used to specify data type in a JSON schema?

Answer

Correct Answer: Type

Note: This Question is unanswered, help us to find answer for this one

41. Which reference to the Unicode character U+1F602 complies with the JSON standard?

Answer

Correct Answer: \uD83D\uDE02

Note: This Question is unanswered, help us to find answer for this one

42. Which code uses the correct JSON syntax for encoding a key/value pair with a null value?

Answer

Correct Answer: "lastVisit": "null"

Note: This Question is unanswered, help us to find answer for this one

43. How do you assign a number value in JSON?

Answer

Correct Answer: Leave the number as is.

Note: This Question is unanswered, help us to find answer for this one

44. When you need to set the value of a key in JSON to be blank, what is the correct syntax for the empty value?

Answer

Correct Answer: Null

Note: This Question is unanswered, help us to find answer for this one

45. Which is ignored by JSON but treated as significant by YAML?

Answer

Correct Answer: Whitespace

Note: This Question is unanswered, help us to find answer for this one

46. Which array is valid JSON?

Answer

Correct Answer: ["tatooine", "hoth", "dagobah"]

Note: This Question is unanswered, help us to find answer for this one

47. How is a true boolean value represented in JSON?

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

48. When building dynamic web applications using AJAX, developers originally used the _ data format, which has since been replaced by JSON.

Answer

Correct Answer: XML

Note: This Question is unanswered, help us to find answer for this one

49. Why do so many APIs use JSON?

Answer

Correct Answer: Because it's based on JavaScript.

Note: This Question is unanswered, help us to find answer for this one

50. Which element is added to the DOM to create a JSON-P request?