11 Best JSON Interview Questions & Answers

11 Best JSON Interview Questions & Answers

1) What is JSON?

JSON is a platform independent language. It stands for JavaScript Object Notation and this text-based, lightweight open standard specially developed for human-readable data inheritance. In other words, JSON is a simple data exchange format.

2) What is a JSON object?

A JSON object is an unordered group of name/value pairs. It basically starts with left braces and ends with right braces. The name/value pair are separated by commas and all names are followed by : (colon).

 

3) What is the rule for JSON syntax rules?

JSON syntax is basically a group of the JavaScript object notation syntax.

  • Data is in name/value pairs
  • Square bracket stores arrays
  • Data must be separated by comma
  • Curly brackets stores objects

4) What is the file extension name of JSON?

The filename extension of JSON is .json.

5) How many languages are included in JSON?

The languages that are included in JSON are given below:

  • C++
  • C#
  • JavaScript
  • Perl
  • Java
  • PHP
  • C
  • Python

6)What is the difference between JSON and JSONP?

  • JSON: It is simple data format used for communication medium between various systems.
  • JSONP: JSONP is a method for utilizing that format with cross-domain ajax requests

7)What are the data types supported by JSON?

The data types that are supported by JSON Number are mentioned below:

  • Array
  • String
  • Boolean
  • Object
  • Null

8)What does JSON.stringify do?

JSON.stringify() changes an object into a JSON text and then save that JSON text in a string.

9)What are the advantages of JSON over XML?

  • JSON  is lighter r than XML
  • JSON objects are typed while XML data is typeless
  • In XML, all data are string while in JSON there are many data types such as Array, Boolean, Number and Array.

10)Which function is used to convert a JSON text into an object?

“eval” function is used to convert a JSON text into an object.

11) What are the JSON files?

  • The file types for JSON files is “.json”
  • The MIME type for JSON text is “application/json”

Leave a Comment

%d bloggers like this: