Now, a days majority of APIs use JSON as a format of data exchange. It has become necessary for an interviewee to prepare for JSON interview questions. Practice the below interview questions to ace your interview easily. If you want to learn more about JSON, then visit JSON Tutorial
JSON stands for JavaScript Object Notation.
It is a text-based format and designed for the exchange of data between two different systems. It is lightweight data-interchange format as compare to XML. It uses JavaScript syntax. JSON data can be read and use by any programming language.
JSON is used for communication between server side technologies and mobile app or website.
The file extension of JSON is .json.
There are six types of data types in JSON -
MIME type is application/json.
For encoding, json_encode() function is used. This function takes PHP value like array as input and returns JSON representation of it. For decoding, json_decode() function is used. This function takes JSON string as input and returns associative array.
JSON.stringify() function is used to convert a JavaScript value(Object) into a JSON string.
This function is used to convert JSON string into a JavaScript object.