JSON MCQs – Introduction to JSON

JSON (JavaScript Object Notation) is a lightweight and easy-to-use data format that has become the backbone of modern web development. It’s widely used for transferring data between a server and a client, storing configuration settings, and as the primary data format for APIs. Understanding the fundamentals of JSON is essential for software developers preparing for interviews, as questions on JSON are commonly asked to evaluate technical skills. Practicing these MCQs on “Introduction to JSON” will not only prepare you for interviews but also strengthen your practical knowledge of JSON, helping you excel in real-world scenarios.

1.) What does JSON stand for?

A) JavaScript Object Notation
B) JavaScript Online Network
C) Java Syntax Object Notation
D) Java Online Syntax Network

Answer: Option A

Explanation: JSON stands for JavaScript Object Notation. It is a lightweight data format used to exchange data.

2.) JSON is ___.

A) Case-insensitive
B) Case-sensitive
C) Partially case-sensitive
D) None of the above

Answer: Option B

Explanation: JSON is case-sensitive, meaning keys and values must match their defined case.

3.) Which of the following best describes JSON?

A) A markup language like XML
B) A programming language
C) A lightweight data format
D) A database system

Answer: Option C

Explanation: JSON is a data format used to represent structured data, not a language or database.

4.) What is JSON primarily used for?

A) Styling web pages
B) Data exchange between a client and a server
C) Creating animations
D) Sending emails

Answer: Option B

Explanation: JSON is commonly used to transfer data between clients and servers.

5.) From which programming language is JSON derived?

A) Java
B) Python
C) JavaScript
D) C++

Answer: Option C

Explanation: JSON is based on JavaScript’s object notation but is language-independent.

6.) 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}

Answer: Option D

Explanation: JSON keys must be enclosed in double quotes, and key-value pairs are separated by colons.

7.) What symbol is used to enclose a JSON array?

A) {}
B) []
C) ()
D) <>

Answer: Option B

Explanation: JSON arrays are enclosed in square brackets [].

8.) Which of the following is NOT a supported data type in JSON?

A) String
B) Number
C) Undefined
D) Boolean

Answer: Option C

Explanation: JSON does not support undefined. Instead, it uses null.

9.) Which of these is a valid JSON string?

A) “Hello, World!”
B) ‘Hello, World!’
C) Hello, World!
D) (Hello, World!)

Answer: Option A

Explanation: JSON strings must always be enclosed in double quotes. JavaScript allows both single and double quotes, but JSON has stricter rules and only accepts double quotes.

10.) What is the MIME type for JSON?

A) text/json
B) application/json
C) application/javascript
D) text/plain

Answer: Option B

Explanation: The correct MIME type for JSON is application/json.

Leave a Reply

Your email address will not be published. Required fields are marked *