linkedin-skill-assessments-quizzes

JSON

Q1. By convention, what name is used for the first key in a JSON schema?

Reference

Q2. Which code is the closest JSON equivalent of the data shown?

[
    'red',
    'blue',
    'green'
]
["red", "green", "blue"]
["red", "blue", "green"]
{
  "color": "red",
  "color": "blue",
  "color": "green"
}
{
  "red": "red",
  "blue": "blue"
}

Q3. Which JavaScript method converts a JavaScript value to Json?

Reference

Q4. Which data type is NOT part of JSON standard?

Reference

Q5. Which term is commonly used to refer to converting data to JSON?

Q6. Which code uses the correct JSON syntax to encode the key/value pair shown?

accountNum: '000605802'

Reference

Q7. What character do you specify before a JSON control character when you want to use that control characters as a literal part of a string?

Reference

Q8. Which data type is part of the JSON standard?

Reference

Q9. Which key name is used to specify properties that must be included for JSON to be valid?

Q10. Which is the valid JSON equivalent of the data shown?

{
	photo: {
	width: 1600,
	height: 900,
	binaries: {
	url: 'https://www.example.com/images/34097349843',
	thumbnail: 'https://www.example.com/images/thumbs/34097349843'
	},
	animated: false,
	tags: [116, 943, 234, 38793],
	}
}
{
  "photo": {
    "width": 1600,
    "height": 900,
    "binaries": {
      "url": "https://www.example.com/images/34097349843",
      "thumbnail": "https://www.example.com/images/thumbs/34097349843"
    },
    "animated": "false",
    "tags": [116, 943, 234, 38793]
  }
}
{
  "photo": {
    "width": 1600,
    "height": 900,
    "binaries": {
      "url": "https://www.example.com/images/34097349843",
      "thumbnail": "https://www.example.com/images/thumbs/34097349843"
    },
    "animated": false,
    "tags": [116, 943, 234, 38793]
  }
}
{
  "photo": {
    "width": 1600,
    "height": 900,
    "binaries": {
      "url": "https://www.example.com/images/34097349843",
      "thumbnail": "https://www.example.com/images/thumbs/34097349843"
    },
    "animated": true,
    "tags": [116, 943, 234, 38793]
  }
}
{
  "photo": {
    "width": "1600",
    "height": "900",
    "binaries": {
      "url": "https://www.example.com/images/34097349843",
      "thumbnail": "https://www.example.com/images/thumbs/34097349843"
    },
    "animated": "false",
    "tags": ["116", "943", "234", "38793"]
  }
}

Reference

Q11. How do you store several paragraphs of text as a string in JSON?

Q12. What data type is represented by the value of the key/value pair shown?

loggedIn: true

Reference

Q13. If you need to store the loggedIn status of a user in JSON as a boolean, what is the correct syntax?

Reference

Q14. What does JSON with padding (JSON-P) use to make a request?

Q15. Which value is supported in the JSON specifications?

Reference

Q16. Which JavaScript method converts JSON to a JavaScript value?

Reference

Q17. Transferring JSON information from client to server and back again often includes HTTP requests. Match each method with the best choice describing its use.

1.Sends data to specific server to create or update information.
2.Sends data to specific server to create or update information without the risk of creating the resource more than once.
3.Previews what the GET request response might be without the body of the text.
4.Learns the communication channels used by the target source.
5.Requests information from a specific source.
6.Removes information.

Q18. Which code uses valid JSON syntax for the text “Centennial Olympics?

{
"host": "Atlanta",
"year": 1996
/_ Centennial Olympics _/
}
{
  "host": "Atlanta",
  "year": 1996
  // Centennial Olympics
}
{
  "host": "Atlanta",
  "year": 1996,
  "comment": "Centennial Olympics"
}
{
  "host": "Atlanta",
  "year": 1996,
  \"Centennial Olympics\"
}
{
  "host": "Atlanta",
  "year": 1996,
  "comment": "\"Centennial Olympics"
}

Reference

Q19. Can trailing commas be used in objects and arrays?

Reference

Q20. Which whitespace characters should be escaped within a string?

Reference

Q21. Which is supported by YAML but not supported by JSON?

Reference

Q22. Which is an invalid JSON value?

Q23. How do you encode a date in JSON?

Reference

Q24. What’s wrong with this JavaScript?

JSON.parse({"first": "Sarah", "last": "Connor"}) ;

Reference

Q25. What does this JavaScript code print?

printNullness(JSON.parse('{ "lemmings": [] }'));
printNullness(JSON.parse('{ "lemmings": null }'));
printNullness(JSON.parse('{ "lemmings": "null" }'));

function printNullness(testMe) {
  if (testMe.lemmings == null) console.log('null');
  else console.log('not null');
}
not null
null
not null
null
null
not null
not null
null
null
null
null
null

Q26. What tool might you use to validate your JSON?

Reference

Q27. What characters denote strings in JSON?

Reference

Q28. Which code is a valid JSON equivalent of the key/value pair shown that also preserves the data type? constant: 6.022E23

Reference Explanation: Scientific Notation is a valid JSON number. You can use e or E.

Q29. Which element is added to the DOM to create a JSON-P request?

Q30. Why do so many APIs use JSON?

Reference

Q31. You need to assemble a list of members, but your JSON is not parsing correctly. How do you change it?

{
  "avengers": [
    "iron man",
    "hulk",
    "thor",
    "black widow",
    "ant man",
    "spider man'
  ]
}
{
  "avengers": ["iron man", "hulk", "thor", "black widow", "ant man", "spider man"]
}
{
  'avengers': [
  {'iron man',
  'hulk',
  'thor',
  'black widow',
  'ant man',
  'spider man'}
  ]
}
{
  "avengers": ["iron man", "hulk", "thor", "black widow", "ant man", "spider man"]
}
{
  "avengers": {[
    "iron man",
    "hulk",
    "thor",
    "black widow",
    "ant man",
    "spider man"
  ]}
}

Q32. When building dynamic web applications using AJAX, developers originally used the _ data format, which has since been replaced by JSON.

Q33. How is a true boolean value represented in JSON?

Reference

Q34. Which array is valid JSON?

Reference

Q35. What data type is encoded in the outermost component of the JSON shown?

[
  {
    "year": 2024
  },
  {
    "location": "unknown"
  }
]

Reference

Q36. Which is ignored by JSON but treated as significant by YAML?

Reference

Q37. When you need to set the value of a key in JSON to be blank, what is the correct syntax for the empty value?

Reference

Q38. How do you assign a number value in JSON?

Q39. Which code uses the correct JSON syntax for encoding a key/value pair with a null value?

Reference

Q40. Which reference to the Unicode character U+1F602 complies with the JSON standard?

Q41. Which code uses the correct JSON syntax for a key/Value pair containing a string?

Reference

Q42. Which key name is used to specify data type in a JSON schema?

Reference

Q43. Which code is a valid JSON equivalent of the key/value pair shown that also preserves the original value?

Reference

Q44. Which data format is a JSON schema written in?

Q45. Which code is valid JSON equivalent of the key/value pair shown that also preserves the data type?

Reference

Q46. With what character should key/value pairs be separated?

Reference

Q47. What character separates keys from values?

Reference

Q48. If a string contains line breaks, what should you do?

Q49. Which number types are available in javascript but not supported in json?

Q50. How should a date value be stored in JSON?

Reference

Q51. Is the JSON code shown here valid?

JSON object with key "Vehicles" containing an array of emojis

Q52. What data structure do you use to encode ordered information?

Reference

Q53. What are valid values in JSON?

Q54. Which key format is valid JSON?

Reference

Q55. What data type is encoded in the outermost component of the JSON shown?

{
  "result": [
    {
      "year": 2024
    },
    {
      "location": "unknown"
    }
  ]
}

Q56. What’s wrong with this JSON object?

{
  "series": "Star Trek",
  "episodes": "The Trouble with Tribbles",
  "season": 3
}

Q57. How should comments be formatted in JSON?

Q58. How would you make the following string valid in JSON?

"name": 'bb-8'

Q59. How are values separated in JSON?

Q60. With which programming language is JSON best used?

Q61. What values can arrays contain?

Q62. What technique can be used to represent complex objects with JSON?

Q63. What characters are used to enclose an array?

Q64. What is the official MIME type for JSON?

Q65. Which character cannot be part of string within JSON without additional formatting?

Q66. What is the purpose of JSON?

Q67. Can you assume the order of keys in an object?

Q68. With what character should object keys be enclosed?

Q69. What is the maximum number of key/value pairs that JSON supports?

Q71. Does JSON support signed numbers?

Q72. What two nonnumerical characters can numbers contain?

Q73. What JavaScript method is used to load JSON data?

Q74. How are the values in an array separated?

Q75. What is the minimum number of values in an array?

Q76. In JSON, a set of brackets ([]) is used to denote _, whereas curly braces ({}) denote _.

Q77. How does JSON represent truth, falsity and nullness?

Q78. If an object key contains spaces, how can you access its value in JavaScript?

Q79. When parsing JSON, “caching” is a method used to _.

Q80. What is the only valid whitespace character within a string that does not require an escape character?

Q81. What technique can you use to safely encode very large numbers?

Q82. Which code is a valid JSON equivalent of the key/value pair shown that also preserves the data type?

variance: -0.0823

Reference

Q83. Based on the JSON object shown, which JavaScript code would you use to find out what is in this vehicle’s glove box while assigning the glove box contents to a new variable?

myVehicleContents = {
  van: {
    inside: {
      'glove box': 'maps',
      'passenger seat': 'crumbs',
    },
    exterior: {
      trunk: 'jack',
    },
  },
};
myVehicleContents.van.inside['glove box'] = gloveBoxContents;
var gloveBoxContents = myVehicleContents.van.inside['glove box'];
gloveBoxContents;
var gloveBoxContents = myVehicleContents.van.glove box.contents;
gloveBoxContents;
myVehicleContents.van.inside['inside'] = gloveBoxContents;

Source

Q84. What characters are used to define an object?

Q85. The JSON structure features nested objects and arrays. Sometimes the data containing these features exists in relational databases. How is the relational structure different that JSON?

Q86. What is supported by YAML but not supported by JSON?

YAML supports # comments but not JSON

Q87. Which is an invalid JSON value? (same as previous question, but different possible answers)

Q88. How can you change this array to make it valid?

{"rey",'leia',"ashoka",}

Q89. If a non-zero number starts with a zero, what character should immediately follow the zero?

Q90. Who would you modify the array below to store additional attributes for each student?

{
  "students": ["Tess", "Erin", "June"]
}

Q91. Which is not a valid JSON number

Q92. What is the maximum string length in JSON?

Q93. What method is used to export a JavaScript object into JSON notation?

Q94. How would you update this JSON to indicate that Jane is now available for part-time work ?

{
  "name": "Jane",
  "job": "developer",
  "skills": ["ruby", "rails", "javascript"],
  "available": false
}
{
  "name": "Jane",
  "job": "developer",
  "skills": ["ruby", "rails", "javascript"],
  "available": true,
  "seeking": "part-time"
}
{
  "name": "Jane",
  "job": "developer",
  "skills": ["ruby", "rails", "javascript"],
  "available": "true",
  "seeking": "part-time"
}
{
  "name": "Jane",
  "job": "developer",
  "skills": ["ruby", "rails", "javascript"],
  "available": false,
  "seeking": "part-time"
}
{
  "name": "Jane",
  "job": "developer",
  "skills": ["ruby", "rails", "javascript"],
  "available": "true",
  "seeking": "part-time"
}

Hint: true needs to be a boolean and part-time a string so in double quotes.

Q95. When you need to set the value of a key in JSON to be blank, what is the correct syntax for the empty value?

Explanation: The other options won’t work as well, as demonstrated by this StackOverflow post.

Q96. What is true about paginated reports? (Select all that apply.)

A. They are formatted to fit well on a page.

B. They shrink the report data to fit on a page.

C. They truncate the report data to fit on a single page.

D. They are both printable and shareable.

Explanation: The true statements about paginated reports are: A. They are formatted to fit well on a page. D. They are both printable and shareable. So the correct options are A and D.

Q97. As a Scrum Master you have noticed a pattern that the most interesting stories on the sprint backlog get started right away, and the least interesting stories languish or don’t get done. What should you do?

Explanation: Encourage open communication within the team and involve them in problem-solving to find a solution that works best for their specific context and helps address the issue of disinterest in certain stories.

Q98. Which is the valid JSON equivalent of the data shown?

json{photo: {width: 1600, height: 900, binaries: { url: 'https://www.example.com/images/34097349843', thumbnail: 'https://www.example.com/images/thumbs/34097349843' }, animated: false, tags: [116, 943, 234, 38793], }}

Q99. When you need to set the value of a key in JSON to be blank, what is the correct syntax for the empty value?

Q100. What does JSON with padding (JSON-P) use to make a request?

Q101. Which whitespace characters should be escaped within a string?

Q102. What’s wrong with this JavaScript?

JSON.parse({"first": "Sarah", "last": "Connor"}) ;

Q103. You need to assemble a list of members, but your JSON is not parsing correctly. How do you change it?

{"avengers": ["iron man", "hulk", "thor", "black widow", "ant man", "spider man" ]}

Q104. Which reference to the Unicode character U+1F602 complies with the JSON standard?

Q105. How should comments be formatted in JSON?

Q106. What is the purpose of JSON-P (JSON with padding) in web development, and how is it typically used?

Explanation:- JSON-P, or JSON with padding, serves the purpose of overcoming the same-origin policy limitation in web development. The same-origin policy restricts web pages from making AJAX requests to a different domain for security reasons. JSON-P works by wrapping JSON data in a JavaScript function call, allowing data to be retrieved from an external domain as if it were a script. This technique is commonly used for securely fetching data from external APIs, making it a valuable tool for cross-domain data exchange in web applications.

Q107. In a JSON document, how can you represent a key that contains special characters, such as spaces or hyphens, to ensure proper parsing and access in JavaScript?

Explanation:- When you have a key in a JSON document that contains special characters, spaces, or hyphens, it is essential to enclose the key in double quotes. JSON requires keys to be represented within double quotes to ensure proper parsing and access in JavaScript. This ensures that JavaScript can correctly interpret keys with special characters or spaces and access their associated values.

Q108. Which is ignored by JSON but treated as significant by YAML?

Q109. Which code uses valid JSON syntax for the text “Centennial Olympics?

{
"host": "Atlanta",
"year": 1996
/_ Centennial Olympics _/
}
{
  "host": "Atlanta",
  "year": 1996
  // Centennial Olympics
}
{
  "host": "Atlanta",
  "year": 1996,
  "comment": "Centennial Olympics"
}
{
  "host": "Atlanta",
  "year": 1996,
  \"Centennial Olympics\"
}
{
  "host": "Atlanta",
  "year": 1996,
  "comment": "\"Centennial Olympics"
}

Q110. What data type is encoded in the outermost component of the JSON shown?

[
  {
    "year": 2024
  },
  {
    "location": "unknown"
  }
]

Q111. Which is an invalid JSON value?

Q112. What are the valid number types in JSON?

Q114. What is the purpose of JSON Web Tokens (JWT)?

Q115. What is JSON-RPC used for?

Q116. Which of the following is a key difference between JSON and XML?

Q117. Which HTTP header is commonly used to prevent cross-site scripting (XSS) attacks when working with JSON?

Q118. What does the JSON Merge Patch format allow you to do?

Q119. Which method is used to parse a JSON string and return a JavaScript object in modern web browsers?

Q120. What is the primary purpose of JSON-LD (JSON Linked Data)?