JSON Interview Questions And Answers

We have provided a complete detail of JSON (JavaScript Object Notation) interview question and answers in our site. To clear the interview, one must prepare well for the interview. There are many leading companies that offer JSON (JavaScript Object Notation) jobs in various position Systems Analyst, Mobile Application Developer, and many other roles too.

1. What does JSON stand for?
JSON stands for “JavaScript Object Notation”.

2. What is JSON?
JSON is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA.

3. Who is known as the father of JSON?
Douglas Crockford is known as the father of JSON. Douglas Crockford was the person who originally defined the JSON format back in 2000.

4. What programming languages supported by JSON?
JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, PHP, Python, and many others.

5. Is JSON is a language?
JSON is a data format. It could be classified as a language, but not a programming language. Its relationship to JavaScript is that it shares its syntax (more or less) with a subset of JavaScript literals.

6. What are the properties of JSON?
These properties make JSON an ideal data-interchange language.
JSON is built on two structures:
•  A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
•  An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
These are universal data structures. Virtually all modern programming languages support them in one form or another. It makes sense that a data format that is interchangeable with programming languages also be based on these structures.

7. Why do we use JSON?
The JSON format is often used for serializing and transmitting structured data over a network connection. It is used primarily to transmit data between a server and web application, serving as an alternative to XML.

8. What is meant by JSON objects?
An object is defined as a set of key-value pairs. A JSON starts with a left brace “{“ and ends with another right brace “}”. Every key is followed by a colon “:” and the key-value pairs are separated from each other by using a comma “,”. So, basically, the JSON object is a collection of keys along with their values arranged in a pre-specified JSON format.

9. What is JSON data?
JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. In JSON data is nothing but a information. It is used primarily to transmit data between a server and web application, as an alternative to XML.

10. What is the difference between XML and JSON?
The fundamental difference, which no other answer seems to have mentioned, is that XML is a markup language (as it actually says in its name), whereas JSON is a way of representing objects (as also noted in its name). This is what makes markup languages so useful for representing documents.

11. Why JSON format is better than XML?
JSON and XML used different formats. When compared both JSON is easy to write and use it applications then XML. The XML format can also be determined by the XML DTD or XML Schema (XSL) and can be tested.
The JSON a data-exchange format which is getting more popular as the JavaScript applications possible format. Basically this is an object notation array. JSON has a very simple syntax so can be easily learned.

12. Is JSON markup language?
JSON is like XML in that it is used to structure data in a text format and is commonly used to exchange data over the Internet. JSON is not a markup language. JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.

13. What is JSON Text?
A JSON text is a sequence of tokens formed from Unicode code points that conforms to the JSON value grammar. The set of tokens includes six structural tokens, strings, numbers, and three literal name tokens.
The six structural tokens:
[ – left square bracket
{ – left curly bracket
] – right square bracket
} – right curly bracket
: – colon
, – comma
These are the three literal name tokens:
true U+0074 U+0072 U+0075 U+0065
false U+0066 U+0061 U+006C U+0073 U+0065
null U+006E U+0075 U+006C U+006C
Insignificant whitespace is allowed before or after any token. Whitespace is any sequence of one or more of the following code points: character tabulation (U+0009), line feed (U+000A), carriage return (U+000D), and space (U+0020). Whitespace is not allowed within any token, except that space is allowed in strings.

14. What is JSON Syntax?
JSON syntax is derived from JavaScript object notation syntax. Data is in name/value pairs. Data is separated by commas. Curly braces hold objects. Square brackets hold arrays.

15. What is JSON Value?
In JSON, value holds some data. A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.
Values in JSON must be one of the following data types:
• a string
• a number
• an object (JSON object)
• an array
• a boolean
• null

16. Does Whitespace Matter In Json?
Yes, only within strings.

17. In Modern Websites What Is The Common Usage For Json?
To send and receive bits of data.

18. What is JSON Array?
An array structure is a pair of square bracket tokens surrounding zero or more values. An array is an ordered collection of values. An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by , (comma).
The values are separated by commas. The JSON syntax does not define any specific meaning to the ordering of the values. However, the JSON array structure is often used in situations where there is some semantics to the ordering.

19. Which Is Proper A Json Array?

{ "letters" : [ "a", "b", "c" ] }

20. What is Number in JSON?
JSON Numbers – A number is very much like a C or Java number, except that the octal and hexadecimal formats are not used. A number is a sequence of decimal digits with no superfluous leading zero.
It may have a preceding minus sign (U+002D). It may have a fractional part prefixed by a decimal point (U+002E). It may have an exponent, prefixed by e (U+0065) or E (U+0045) and optionally + (U+002B) or – (U+002D). The digits are the code points U+0030 through U+0039.
Numeric values that cannot be represented as sequences of digits (such as Infinity and NaN) are not permitted.

21. What is JSON String?
A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.
A string is a sequence of Unicode code points wrapped with quotation marks (U+0022). All code points may be placed within the quotation marks except for the code points that must be escaped: quotation mark (U+0022), reverse solidus (U+005C), and the control characters U+0000 to U+001F. There are two-character escape sequence representations of some characters.
\” represents the quotation mark character (U+0022).
\\ represents the reverse solidus character (U+005C).
\/ represents the solidus character (U+002F).
\b represents the backspace character (U+0008).
\f represents the form feed character (U+000C).
\n represents the line feed character (U+000A).
\r represents the carriage return character (U+000D).
\t represents the character tabulation character (U+0009).

22. Which Is A Valid Json String?

"meals" : [ "breakfast" , "lunch" , "dinner" ]

23. Which Code Will Return A Valid Json Object?

JSON.parse('{"FirstName": "John", "LastName":"Doe"}');

24. Which Is True About Json Namespace?
JSON doesn’t have namespaces. Through every object is inherently a namespace.

25. What is JSON-RPC? List some Features of JSON-RPC-Java
JSON-RPC: JSON-RPC is a simple remote procedure call protocol similar to XML-RPC although it uses the lightweight JSON format instead of XML.
JSON-RPC-Java is a Java implementation of the JSON-RPC protocol.Below is list of some of its features
• Dynamically call server-side Java methods from JavaScript DHTML web applications. No Page reloading.
• Asynchronous communications.
• Transparently maps Java objects to JavaScript objects.
• Lightweight protocol similar to XML-RPC although much faster.
• Leverages J2EE security model with session specific exporting of objects.
• Supports Internet Explorer, Mozilla, Firefox, Safari, Opera, and Konqueror.

26. What is a JSON parser?
JSON parser to parse JSON object and MAINTAIN comments. By using JSON, when receiving data from a web server, the data should be always in a string format. We use JSON.parse() to parse the data and it becomes a JavaScript object.
The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned.

27. Which browser provides native JSON support?
All modern browsers support native JSON encoding/decoding (Internet Explorer 8+, Firefox 3.1+, Safari 4+, and Chrome 3+). Basically, JSON.parse(str) will parse the JSON string in str and return an object, and JSON.stringify(obj) will return the JSON representation of the object obj.

28. What is the difference between JSON parse and JSON Stringify?
JSON.stringify() is to create a JSON string out of an object/array. They are the inverse of each other. JSON.stringify() serializes a JS object into a JSON string, whereas JSON.parse() will deserialize a JSON string into a JS object.

29. What is the MIME type of JSON?
The MIME media type for JSON text is application/json . The default encoding is UTF-8.

30. What is the use of JSON Stringify?
The JSON.stringify() method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.

31. What does JSON parse do?
The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned.

32. What is serialization in Javascript?
The serialize() method creates a URL encoded text string by serializing form values. You can select one or more form elements (like input and/or text area), or the form element itself. The serialized values can be used in the URL query string when making an AJAX request.

33. What is Polyfill?
The JSON object is not supported in older browsers. We can work around this by inserting a piece of code at the beginning of your scripts, allowing use of JSON object in implementations which do not natively support it (like Internet Explorer 6) is called Polyfill.

34. What is toJSON() method in JOSN?
The toJSON() method returns a string representation of the Date object.

35. What is JSONP?
JSONP stands for JSON with Padding. JSONP is a method for sending JSON data without worrying about cross-domain issues. JSONP does not use the XMLHttpRequest object. JSONP uses the <script> tag instead.

36. What is the difference between JSON and JSONP?
• JSON: JSON is a simple data format used for communication medium between different systems
• JSONP: It is a methodology for using that format with cross-domain ajax requests while not being affected by same origin policy issue.

37. What is serialization and deserialization in JSON?
JSON is a format that encodes objects in a string. Serialization means to convert an object into that string, and deserialization is its inverse operation. When transmitting data or storing them in a file, the data are required to be byte strings, but complex objects are seldom in this format.

38. What is serialization of an object?
To serialize an object means to convert its state to a byte stream so that the byte stream can be reverted back into a copy of the object.

39. What is the use of JSON in Java?
The Java API for JSON Processing provides portable APIs to parse, generate, transform, and query JSON. JSON (JavaScript Object Notation) is a lightweight, text-based, language-independent data exchange format that is easy for humans and machines to read and write.

40. Why do we use JSON in PHP?
A common use of JSON is to read data from a web server, and display the data in a web page.

41. What is JSON Formatter?
The JSON Formatter & Validator helps debugging JSON data by formatting and validating JSON data so that it can easily be read by human beings.

42. What is JSON Viewer?
JSON Viewer – Convert JSON Strings to a Friendly Readable Format.

43. What is JSON Validator?
The JSON Validator helps debugging JSON data by formatting and validating JSON data so that it can easily be read by human beings.

44. Why do we use JSON in Android?
JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML.
Android provides four different classes to manipulate JSON data. These classes are JSONArray,JSONObject,JSONStringer and JSONTokenizer.

45. Why do we use JSON in Python?
Python programming language is used to encode and decode JSON objects.
•  Python encode() function encodes the Python object into a JSON string representation.
•  Python decode() function decodes a JSON-encoded string into a Python object.

46. What is JSON in JavaScript?
JSON is derived from the JavaScript programming language, it is a natural choice to use as a data format in JavaScript. JSON, short for JavaScript Object Notation.

47. What is JSON Schema?
JSON Schema is a specification for JSON based format for defining the structure of JSON data.

48. What is the extension of the JSON file?
A JSON file has an extension of “.json”. Being in a text-based format, a JSON file can be viewed or edited using any text editor like notepad or notepad++.

49. What are the advantages of JOSN?
• It is used while writing JavaScript based applications that includes browser extensions and websites.
• JSON format is used for serializing and transmitting structured data over network connection.
• It is primarily used to transmit data between a server and web applications.
• Web services and APIs use JSON format to provide public data.
• It can be used with modern programming languages.

50. What are the limitations of JSON?
JSON is one of the most popular data interchange format available in today’s scenario. It has several advantages over the other formats but at the same time, it also has its own set of limitations too. They are:
• As the data gets complex with several nested or hierarchical structures, it becomes complex for human readability.
• JSON is not suitable for handling very complex large data.
• JSON doesn’t have support for handling multimedia formats such as rich text or images.
• It doesn’t support comments.

Sign-up for our email newsletter and get free job alerts, current affairs and GK updates regularly.
Subscribe Here (or)

Leave a Reply

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

× 4 = eight

Popup Dialog Box Powered By : XYZScripts.com
  • RSS
  • Facebook
  • Google+
  • Twitter