json-quiz
Q1. By convention, what name is used for the first key in a JSON schema?
schema
[β ] $schema
JsonSchema
JSONschema
Q2. Which code is the closest JSON equivalent of the data shown?
[ ]
[_]
[β ]
[ ]
Q3. Which JavaScript method converts a JavaScript value to Json?
JSON.parse()
[β ] JSON.stringify()
JSON.toString()
JSON.objectify()
Q4. Which data type is NOT part of JSON standard?
string
number
[β ] date
array
Q5. Which term is commonly used to refer to converting data to JSON?
unpacking
[β ] serialization
deserialization
parsing
Q6. Which code uses the correct JSON syntax to encode the key/value pair shown?
accountNum: '000605802'
[β ] βaccountNumβ: β000605802β
accountNum: β000605802β
βaccountNumβ: 000605802
accountNum: 000605802
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?
/
[β ]
\
:
{
Q8. Which date type is part of the JSON standard?
[β ] Boolean
map
promise
function
Q9. Which key name is used to specify properties that must be included for JSON to be valid?
important
base
core
[β ] required
Q10. Which is the valid JSON equivalent of the data shown?
[ ]
[ ]
[β ]
[ ]
Q11. How do you store several paragraphs of text as a string in JSON?
[β ] Escape all whitespaces expect space characters.
Escape line breaks.
Escape paragraphs.
Remove all whitespaces
Q12. What data type is represented by the value of the key/value pair shown?
loggedIn: true
string
[β ] Boolean
number
object
Q13. If you need to store the loggedIn status of a user in JSON as a boolean, what is the correct syntax?
βloggedInβ: (true)
loggedIn: βtrueβ
[β ] βloggedInβ: true
loggedIn: {true}
Q14. What does JSON with padding (JSON-P) use to make a request?
an
<origin>
elementa header request
[β ] the
<script>
elementthe XMLHttpRequest object
Q15. Which value is supported in the JSON specifications?
undefined
infinity
NaN
[β ] null
Q16. Which JavaScript method converts JSON to a JavaScript value?
[β ] JSON.parse()
JSON.stringify()
JSON.toString()
JSON.objectify()
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.POST 2.DELETE 3.OPTIONS 4.HEADER 5.GET 6.PUT
1.POST 2.PUT 3.HEADER 4.OPTIONS 5.GET 6.DELETE
1.POST 2.DELETE 3.OPTIONS 4.HEADER 5.GET 6.PUT
[β ] 1.POST 2.PUT 3.HEADER 4.OPTIONS 5.GET 6.DELETE
Q18. Which code uses valid JSON syntax for the text βCentennial Olympics?
[ ]
[ ]
[ ]
[β ]
Q19. Can trailing commas be used in objects and arrays?
yes
only if there is more than one item
[β ] no
only when arrays and objects contain more than 10 items
Q20. Which whitespace characters should be escaped within a string?
All whitespace is allowed.
double quotes, slashes new lines, and carriage returns
[β ] new lines and carriage returns only
double quotes only
Q21. Which is supported by YAML but not supported by JSON?
nested
[β ] comments
arrays
null values
Q22. Which is an invalid JSON value?
ββ|=()(X 72()|/||*ββ
β|=()(X 72()|/||*β
β|=()(X" "72()|/||*β
[β ] β()(X 72()|/||*β
Q23. How do you encode a date in JSON?
Convert the date to UTC and enclose in quotes.
[β ] Encode the date as string using the ISO-8601 date format.
Wrap the date in double quotes.
Add a βdateβ key to your object and include the date as string.
Q24. Whatβs wrong with this JavaScript?
JSON.parse({"first": "Sarah", "last": "Connor"}) ;
JSON should be wrapped with curly braces.
JSON.parse() is missing an argument.
[β ] The value supplied to JSON.parse() is not a string.
Nothing is wrong with it.
Q25. What does this JavaScript code print?
[β ] A
B
C
D
Q26. What tool might you use to validate your JSON?
[β ] JSONLint
ValidateJSON
JSONFiddle
TextEdit
Q27. What characters denote strings in JSON?
[β ] double quotes
smart (curly) quotes
single or double quotes
single quotes
Q28. Which code is a valid JSON equivalent of the key/value pair shown that also preserves the data type? constant: 6.022E23
[β ]
"constant": "6.022E23"
"constant": "6\.022\E23"
constant: 6.022E23
constant: "6.022E23"
Explanation: Scientific Notation is a valid JSON number. You can use e
or E
. (Reference)
Q29. Which element is added to the DOM to create a JSON-P request?
<object>
[β ]
<script>
<json>
<meta>
Q30. Why do so many APIs use JSON?
Because itβs object-based.
Because itβs a simple and adaptable format for sharing data.
[β ] Because itβs based on JavaScript.
Because it is derived from SGML.
Q31. You need to assemble a list of members, but your JSON is not parsing correctly. How do you change it?
[β ] A
B
C
D
Q32. When building dynamic web applications using AJAX, developers originally used the _ data format, which has since been replaced by JSON.
[β ] XML
GRAPHQL
REST
SOAP
Q33. How is a true boolean value represented in JSON?
TRUE
βtrueβ
1
[β ] true
Q34. Which array is valid JSON?
[βtatooineβ, βhothβ, βdagobahβ]
[tatooine, hoth, dagobah]
[βtatooineβ, βhothβ, βdagobahβ,]
[β ] [βtatooineβ, βhothβ, βdagobahβ]
Q35. What data type is encoded in the outermost component of the JSON shown?
object
[β ] array
number
string
Q36. Which is ignored by JSON but treated as significant by YAML?
trailing commas
trailing decimals
whitespace
[β ] leading zeroes
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?
FALSE
0
ββ
[β ] null
Q38. How do you assign a number value in JSON?
Escape the number with a backslash.
Enclose the number in double quotes.
Enclose the number in single quotes.
[β ] Leave the number as is.
Q39. Which code uses the correct JSON syntax for encoding a key/value pair with a null value?
[β ] βlastVisitβ: βnullβ
lastVisit: null
βlastVisitβ: 0
βlastVisitβ: undefined
Note: None of the above options appear to be correct. A correct answer would be "lastVisit": null
Q40. Which reference to the Unicode character U+1F602 complies with the JSON standard?
128514
d83dde02
[β ] 83D
😂
Q41. Which code uses the correct JSON syntax for a key/Value pair containing a string?
[β ] βlargestβ: βblue whaleβ
largest: βblue whaleβ
βlargestβ: βblue whaleβ
largest: βblue whaleβ
Q42. Which key name is used to specify data type in a JSON schema?
data
schemadata
schematype
[β ] type
Q43. Which code is a valid JSON equivalent of the key/value pair shown that also preserves the original value?
βUPCβ: \043875
UPC: β043875β
βUPCβ: 043875
UPC: β043875β
NONE OF THESE ARE CORRECT A CORRECT ANSWER WOULD LOOK LIKE "UPC": "043875"
Q44. Which data format is a JSON schema written in?
markdown
YAML
XML
[β ] JSON
Q45. Which code is valid JSON equivalent of the key/value pair shown that also preserves the data type?
[β ] βvarianceβ: β-0.0823β
variance: β-0.0823β
βvarianceβ: β-0.0823β
variance: -0.0823
Q46. With what character should key/value pairs be separated?
[β ] colon
space
semicolon
comma
Q47. What character separates keys from values?
[β ] :
->
::
.
Q48. If a string contains line breaks, what should you do?
Wrap line breaks in single quotation marks
Make no changes, because whitespace is allowed
Replace any line breaks with
[β ] Replace any line breaks with
Q49. Which number types are available in javascript but not supported in json?
Fractional and Transcendental
Infinity or Rational
Rational and Irrational
[β ] Infinity or NaN
Q50. How should a date value be stored in JSON?
As a string with quotes
As a string without quotes
As a string in ISO 8583 format
[β ] As a string in ISO 8601 format
Q51. Is the JSON code shown here valid?
No, emojis must be escaped with a backslash.
No, JSON strings are not allowed to use emojis.
No, emojis should never be enclosed with double quotes.
[β ] Yes, emojis are valid characters because JSON strings are unicode.
Q52. What data structure do you use to encode ordered information?
list
[β ] array
struct
indexed hash
Q53. What are valid values in JSON?
arrays, strings, numbers, true/false
hashes, arrays, strings, numbers, booleans, null
arrays, objects, lists, strings, numbers, booleans
[β ] objects, arrays, strings, numbers, booleans, null
Q54. Which key format is valid JSON?
key: βvalueβ
[β ] βkeyβ: βvalueβ
key, βvalueβ
βkeyβ: βvalueβ
Q55. What data type is encoded in the outermost component of the JSON shown?
number
array
string
[β ] object
Q56. Whatβs wrong with this JSON object?
Key/value pairs should be separated by semicolons.
[β ] Keys should be enclosed with double quotes.
Key/value pairs should always have a trailing comma.
Keys and values should be enclosed with single quotes.
Wrap the comments in single quotes and place it at the bottom of the file.
Wrap the comments in double parentheses.
Escape comments by placing two slashes at the start of the comment.
[β ] JSON does not support comments.
Q58. How would you make the following string valid in JSON?
name: βbb-8β
βnameβ: 'bb-8'
[β ] βnameβ: βbb-8β
βnameβ: bb-8
Q59. How are values separated in JSON?
with brackets
with colons
[β ] with commas
with parentheses
Q60. With which programming language is JSON best used?
[β ] any language, as JSON is language agnostic.
Ruby
JavaScript
Python
Q61. What values can arrays contain?
only numbers
[β ] any valid JSON value
only strings and numbers
only strings
Q62. What technique can be used to represent complex objects with JSON?
reserialization
[β ] nesting
memorization
minimization
Q63. What characters are used to enclose an array?
[β ] []
{}
ββ
()
Q64. What is the official MIME type for JSON?
text/json
text/javascript
[β ] application/json
data/json
Q65. What character cannot be part of string within JSON without additional formatting?
/
[β ] β
-
:
Q66. Which data type is part of the JSON standard?
function
promise
[β ] Boolean
map
Q67. Which data type is not part of the JSON standard?
number
string
array
[β ] date
Q68. Which character separates keys from values?
[β ] :
->
::
.
Q69. What is the purpose of JSON?
[β ] to provide a simple way to serialize and deserialize data between different sources
to provide a way to store data for machine learning
to provide an archival solution for data warehousing
to provide a way for JavaScript to run other languages
Q70. Can you assume the order of keys in an object?
[β ] No, but you can sort the keys with
JSON.sort()
.Yes, object keys are always ordered alphabetically.
Yes, but only when the object is first parsed.
No, you can never assume object keys will be in order.
Q71. With what character should object keys be enclosed?
*
#
^
[β ]
"
Q72. What is the maximum number of key/value pairs that JSON supports?
10,000
1000
[β ] There is no defined limit.
1 million
Q73. What is the recommended term used to refer to multiple resources?
a swarm
[β ] multiple resources
a collection
a group
Q74. Does JSON support signed numbers?
yes, but only if they are enclosed in quotes
only with integers
[β ] no
yes
Q75. What two nonnumerical characters can numbers contain?
[β ] dash and dot
dash and comma
comma and exclamation point
dot and comma
Q76. What JavaScript method is used to load JSON data?
JSON.ingest()
JSON.convert()
JSON.read()
[β ] JSON.parse()
Q77. How are the values in an array separated?
with right arrows
with colons
with semicolons
[β ] with commas
Q78. What is the minimum number of values in an array?
[β ] zero
one
two
three
Q79. In JSON, a set of brackets ([]) is used to denote _, whereas curly braces ({}) denote _.
[β ] arrays; objects
objects; functions
arrays; functions
key/value pairs; arrays
Q80. How does JSON represent truth, falsity and nullness?
[β ] true, false, null
true, false
TRUE, FALSE, NULL
true, false, null
Q81. Which character cannot be part of string data within JSON without additional formatting?
/
[β ] β
:
-
Q82. If an object key contains spaces, how can you access its value in JavaScript?
Remove spaces from the key before accessing the value.
Use dot notation to access the value.
Use object key index to access the value.
[β ] Use bracket notation to access the value.
Q83. When parsing JSON, βcachingβ is a method used to _.
remove duplicate data from a server
[β ] temporarily store data for faster access
store excess information in chunks to be reviewed later
clog up a web browser with useless information
Q84. What is the only valid whitespace character within a string that does not require an escape character?
line break
[β ] space
tab
return
Q85. What technique can you use to safely encode very large numbers?
[β ] Store the number as a string
Convert the number into an exponent.
Round the number to the nearest 10-digit number.
Split the number into smaller parts.
Last updated