📘 Premium Read: Access my best content on
Medium member-only articles
— deep dives into Java, Spring Boot, Microservices, backend architecture, interview preparation, career advice, and industry-standard best practices.
✅ Some premium posts are free to read — no account needed.
Follow me on Medium to stay updated and support my writing.
🎓 Top 10 Udemy Courses (Huge Discount):
Explore My Udemy Courses
— Learn through real-time, project-based development.
JSON (JavaScript Object Notation) is a widely used data interchange format known for its simplicity and ease of use. It is often used to transmit data between a server and a web application as an alternative to XML.
Let's put your JSON knowledge to the test with this JSON Quiz! Each question is multiple-choice, and after each question, you'll find the correct answer along with a detailed explanation. Let's dive in and see how well you know your JSON!
1. What does JSON stand for?
a) JavaScript Oriented Notation
b) JavaScript Object Notation
c) Java Ordered Notation
d) Java Object Notation
Answer:
b) JavaScript Object Notation
Explanation:
JSON stands for JavaScript Object Notation. It is a lightweight data-interchange format that is easy for humans to read and write and easy for machines to parse and generate.
2. What is the file extension commonly used for JSON files?
a) .xml
b) .js
c) .json
d) .html
Answer:
c) .json
Explanation:
JSON files typically have the .json file extension. They contain data in a structured format that is easy to parse and manipulate.
3. How do you represent data in JSON?
a) Key-Value pairs
b) Metadata
c) Binary Data
d) Key-Object pairs
Answer:
a) Key-Value pairs
Explanation:
In JSON, data is represented as key-value pairs. This means each value is associated with a unique key.
4. Is JSON case-sensitive?
a) Yes
b) No
Answer:
a) Yes
Explanation:
JSON is case-sensitive, which means it treats uppercase and lowercase letters as different characters.
5. Which symbol is used to enclose JSON objects?
a) []
b) ()
c) {}
d) ""
Answer:
c) {}
Explanation:
JSON objects are enclosed in curly braces {}.
6. In JSON, keys must always be of which data type?
a) String
b) Number
c) Boolean
d) Object
Answer:
a) String
Explanation:
In JSON, keys must always be strings. They are enclosed in double quotes to distinguish them from values.
7. Which symbol is used to separate key-value pairs in JSON?
a) :
b) ;
c) ,
d) =
Answer:
a) :
Explanation:
In JSON, key-value pairs are separated by a colon (:). The key represents the name of the property, and the value represents the data associated with that key.
8. Can you store functions in JSON?
a) Yes
b) No
Answer:
b) No
Explanation:
JSON is a data format. It does not support storing functions, only data.
9. What can JSON format be used for?
a) Storing data
b) Sending data to the server
c) Receiving data from the server
d) All of the above
Answer:
d) All of the above
Explanation:
JSON can be used for storing data and for data interchange between a browser and a server.
The correct way to represent a nested object in JSON is to use curly braces ({}) to define the outer object and include another object as the value of a property (address in this case).
20. What is the result of parsing the following JSON?
Parsing the given JSON will result in an array containing two objects, each representing a person with name and age properties.
Conclusion
Congratulations on completing the JSON Quiz! JSON is a powerful data interchange format, and understanding its structure and manipulation methods is essential for web developers working with APIs and data transmission.
Keep practicing and exploring JSON to become proficient in working with data effectively. Happy coding!
Comments
Post a Comment
Leave Comment