JSON Online Test - MCQ Questions

Welcome to the JSON Online Test! We will present 15 MCQs (Multiple-Choice Questions) to test your knowledge of the JSON basics.

You can select the correct answer for each question and submit the test. You will get your online test score after finishing the complete test.

1. What does JSON stand for?

a) JavaScript Object Notation
b) Java Source Open Network
c) JavaScript Output Naming
d) Java Simple Object Notation

2. Which of these is a valid JSON object?

a) {name: "John", age: 30}
b) {"name": "John", "age": 30}
c) {"name": John, "age": 30}
d) {name: 'John', age: '30'}

3. What is the primary data format used for asynchronous browser/server communication?

a) XML
b) JSON
c) HTML
d) CSV

4. In JSON, what data type is the value {"x": [1,2,3]}?

a) Object
b) Array
c) String
d) Number

5. How does JSON represent high-precision or very large numbers?

a) JSON supports arbitrary-precision numerics.
b) JSON does not support numbers larger than 53 bits of precision.
c) JSON represents them as strings.
d) JSON rounds them to the nearest integer.

6. What characters are used to begin and end arrays in JSON?

a) {} (curly brackets)
b) [] (square brackets)
c) () (parentheses)
d) "" (double quotes)

7. Which of the following is not allowed in JSON?

a) Functions
b) Strings
c) Numbers
d) Booleans

8. What should JSON strings be enclosed in?

a) Single quotes (' ')
b) Double quotes (" ")
c) Backticks ( )
d) No quotes are necessary

9. Can JSON keys (names) be numbers?

a) Yes, but the number must be quoted.
b) No, they must always be strings.
c) Yes, without quotes.
d) No, keys must be JSON objects.

10. What does the following JSON array represent? [1, "hello", true]

a) A collection of objects
b) A collection of different data types
c) A syntax error
d) An object of arrays

11. What is the correct way to parse a JSON string in JavaScript?

a) JSON.parse()
b) JSON.stringify()
c) JSON.decode()
d) JSON.convert()

12. Which method is used to convert a JavaScript object into a JSON string?

a) JSON.toObject()
b) JSON.fromString()
c) JSON.stringify()
d) JSON.encode()

13. What data types does JSON support?

a) Objects, arrays, strings, numbers, booleans, and null
b) Only strings and numbers
c) Objects, arrays, functions, and undefined
d) All JavaScript data types

14. What is the most common use of JSON on the web?

a) To store configuration settings on the server
b) To send data between clients and servers
c) To write server-side code
d) To configure CSS styles

15. Which of the following is true about JSON?

a) It is a binary format.
b) It is dependent on JavaScript.
c) It is a lightweight text-based interchange format.
d) It is used primarily for writing application code.

Comments