Upwork JSON Test 2016.
40 Answered Test Questions:
1. Which of the following properties form part of the response to a JSON-RPC method invocation?
Answers:
a. result
a. error
a. params
a. id
a. method
2. Which of the following properties are contained in the request for a JSON-RPC method invocation?
Answers:
a. result
a. method
a. params
a. error
3. Which of the following statements is/are not correct about the JSON-RPC?
Answers:
a. It wraps an object, allowing you to call methods on that object and get the return values.
a. It does not allow multiple calls to be sent to a peer which may be answered out of order.
a. It does not provide the idea of getting error responses.
a. It allows for bidirectional communication between the service and the client.
4. Which of the following methods is/are provided by JSONRequest?
Answers:
a. src
a. get
a. cancel
a. style
5. Which of the following parameters can be passed in the JSONRequest.post request?
Answers:
a. src
a. done
a. id
a. send
6. Which of the following parameters can be passed in the JSONRequest.get request?
Answers:
a. url
a. done
a. send
a. src
7. Which of the following is/are true with regard to JSONRequest?
Answers:
a. It is a two way data interchange between any page and any server.
a. It can combine programs and data services from multiple sources on a single page.
a. It accumulates random delays before acting on new requests when previous requests have failed.
a. It can be used to retrieve JSON-encoded values and other text formats.
8. Which of the following statements is/are true about modules with reference to JSON?
Answers:
a. Every node in the module’s parent chain must also have a CSS display property of dynamic.
a. Modules cannot have negative CSS margins.
a. The CSS display property of a module must be static.
a. Modules can be clipped by the CSS clip property.
9. Which of the following JSONPath syntaxes will you use in order to filter all books where price is less than $10?
Answers:
a. $.book[@.price<10)]
a. $..book[?(@.price<10)]
a. //book[price<10]
a. $.book[,(@.price<10)]
10. Which of the following statements is correct about JSON?
Answers:
a. It is a lightweight data interchange format.
a. It is a superset of JavaScript.
a. It is a language independent text format.
a. It is a general serialization format.
11. Which of the following is the correct syntax for declaring a tag in JSON?
Answers:
a.
a.
a.
a.
12. What is the significance of the arrow before the following code in JSON?
–> { “method”: “echo”, “params”: [“Hello JSON-RPC”], “id”: 1}
Answers:
a. It shows the data sent to the service.
a. It shows the data coming from the service.
a. It shows the notification message from the service.
a. It shows the root element set for the message transfer.
13. In order to find the authors of all the books in the store, which of the JSONPath codes will you use?
Answers:
a. $.store.book[*].author
a. $..author
a. /store.book.author
a. $store.book.author
14. What will be the output of the code shown above?
Answers:
a. OpenDoc 3
a. CloseDoc 4
a. CreateDoc 2
a. Syntax Error
15. In order to find the price of everything in the store, which of the JSONPath codes will you use?
Answers:
a. $.store.price
a. $store..price[*]
a. $.store..price
a. //store.price[*]
16. Which of the following is a valid JSONPath expression?
Answers:
a. /.store.book[0].title/*
a. $.store.book[0].title
a. //.store.book[0].title//*
a. $..store.book[0].title
17. Which of the following statements correctly describes the following syntax?
1. Which of the following properties form part of the response to a JSON-RPC method invocation?
Answers:
a. result
a. error
a. params
a. id
a. method
2. Which of the following properties are contained in the request for a JSON-RPC method invocation?
Answers:
a. result
a. method
a. params
a. error
3. Which of the following statements is/are not correct about the JSON-RPC?
Answers:
a. It wraps an object, allowing you to call methods on that object and get the return values.
a. It does not allow multiple calls to be sent to a peer which may be answered out of order.
a. It does not provide the idea of getting error responses.
a. It allows for bidirectional communication between the service and the client.
4. Which of the following methods is/are provided by JSONRequest?
Answers:
a. src
a. get
a. cancel
a. style
5. Which of the following parameters can be passed in the JSONRequest.post request?
Answers:
a. src
a. done
a. id
a. send
6. Which of the following parameters can be passed in the JSONRequest.get request?
Answers:
a. url
a. done
a. send
a. src
7. Which of the following is/are true with regard to JSONRequest?
Answers:
a. It is a two way data interchange between any page and any server.
a. It can combine programs and data services from multiple sources on a single page.
a. It accumulates random delays before acting on new requests when previous requests have failed.
a. It can be used to retrieve JSON-encoded values and other text formats.
8. Which of the following statements is/are true about modules with reference to JSON?
Answers:
a. Every node in the module’s parent chain must also have a CSS display property of dynamic.
a. Modules cannot have negative CSS margins.
a. The CSS display property of a module must be static.
a. Modules can be clipped by the CSS clip property.
9. Which of the following JSONPath syntaxes will you use in order to filter all books where price is less than $10?
Answers:
a. $.book[@.price<10)]
a. $..book[?(@.price<10)]
a. //book[price<10]
a. $.book[,(@.price<10)]
10. Which of the following statements is correct about JSON?
Answers:
a. It is a lightweight data interchange format.
a. It is a superset of JavaScript.
a. It is a language independent text format.
a. It is a general serialization format.
11. Which of the following is the correct syntax for declaring a tag in JSON?
Answers:
a.
a.
a.
a.
12. What is the significance of the arrow before the following code in JSON?
–> { “method”: “echo”, “params”: [“Hello JSON-RPC”], “id”: 1}
Answers:
a. It shows the data sent to the service.
a. It shows the data coming from the service.
a. It shows the notification message from the service.
a. It shows the root element set for the message transfer.
13. In order to find the authors of all the books in the store, which of the JSONPath codes will you use?
Answers:
a. $.store.book[*].author
a. $..author
a. /store.book.author
a. $store.book.author
14. What will be the output of the code shown above?
Answers:
a. OpenDoc 3
a. CloseDoc 4
a. CreateDoc 2
a. Syntax Error
15. In order to find the price of everything in the store, which of the JSONPath codes will you use?
Answers:
a. $.store.price
a. $store..price[*]
a. $.store..price
a. //store.price[*]
16. Which of the following is a valid JSONPath expression?
Answers:
a. /.store.book[0].title/*
a. $.store.book[0].title
a. //.store.book[0].title//*
a. $..store.book[0].title
17. Which of the following statements correctly describes the following syntax?
{“state”:{optional:true},”town”:{“required”:”state”,optional:true}}
Answers:
a. An instance includes a state property and a town property which is optional.
a. An instance may or may not include a state property which is optional. If a town property is not included, the state property is optional.
a. An instance must include a state property if a town property is included. If a town property is not included, the state property is optional.
a. The declaration syntax is incorrect. You can not declare optional values in an array.
18. Which of the following elements of JSONPath can be used to apply the filter(script) expression?
Answers:
a. [,]
a. ?()
a. //
a. [.]
19. State whether true or false.
Answers:
a. An instance includes a state property and a town property which is optional.
a. An instance may or may not include a state property which is optional. If a town property is not included, the state property is optional.
a. An instance must include a state property if a town property is included. If a town property is not included, the state property is optional.
a. The declaration syntax is incorrect. You can not declare optional values in an array.
18. Which of the following elements of JSONPath can be used to apply the filter(script) expression?
Answers:
a. [,]
a. ?()
a. //
a. [.]
19. State whether true or false.
JSONRequest allows the connection when the Content-Type in both directions is an application/jsonrequest.
Answers:
a. True
a. False
20. JSON does not allow you to create an empty object.
Answers:
a. True
a. False
21. Which of the following correctly describes the disallow property of the JSON Schema?
Answers:
a. It indicates that the property will be used for volatile values that should not be persisted with.
a. It indicates that the instance property should not be changed.
a. It specifies that an instance property is an internal property that should not be made visible to the users.
a. This attribute may take the same values as the “type” attribute.
22. Which of the following correctly describes the function of the JSON.stringify method in JSON?
Answers:
a. It accepts a string and revives it into an object.
a. It converts a JavaScript object into a JSON string.
a. It converts a JSON object into a text.
a. It converts a JSON string into a JavaScript object.
23. Which of the following properties should be declared first in order to define a schema from an instance?
Answers:
a. $schema
a. $ref
a. $default
a. &id
24. Which of the following schema properties takes schema as value in JSON?
Answers:
a. extends
a. pattern
a. options
a. transient
25. While using JSONRequest.cancel, what will happen to the request if it is still in the outgoing message queue?
Answers:
a. It will be deleted from the queue.
a. It will abort.
a. It will call the done function of the request with an exception message of “cancelled”.
a. None of the above
26. Which of the following JSONPath elements represents the root object/element?
Answers:
a. /
a. $
a. @
a. .
27. What does the [start:end:step] element of JSONPath signify?
Answers:
a. It represents a subscript operator.
a. It represents recursive descent.
a. It represents attribute access.
a. It represents an array slice operator.
28. In order to find the last book, which of the JSONPath codes will you use?
Answers:
a. //book[(,length-1)] $..book[-1]
a. $..book[(@.length-1)] $.book[-1:]
a. $..book[(@length-1)] $.book[-1]
a. $..book[(@.length-1)] $..book[-1:]
29. Which of the following parameter values cannot be serialized in JSONRequest?
Answers:
a. timeout
a. done
a. url
a. send
30. Which of the following schema properties does not need to be validated by JSON validators?
Answers:
a. format
a. pattern
a. enum
a. transient
31. Which of the following schema properties always has a unique value for all its instances in JSON?
Answers:
a. requires
a. identity
a. readonly
a. disallow
32. Which of the following features of JSON has the property of exemption from the same origin policy?
Answers:
a. JSONRequest
a. Module
a. JSONT
a. JSLint
33. In the above code snippet, what is the purpose of declaring the JSONRequest.post?
Answers:
a. It will queue the request and call the done function.
a. It will queue the request and return the request number.
a. It will queue the request and return the request number and authentication information.
a. None of the above
34. Which of the following serialization formats is/are supported by JSON?
Answers:
a. Recurring structures
a. Invisible structures
a. Functions
a. None of the above
35. If a schema property is declared false, which of the following attributes can not be used to extend the schema?
Answers:
a. pattern
a. transient
a. format
a. additionalProperties
36. Which of the following correctly describes the term tuple typing in JSON Schema?
Answers:
a. Properties should be an object type with property definitions corresponding to instance object properties.
a. It provides an enumeration of possible values that are valid for the instance property. It should be an array, and each item in the array should represent a possible value for the instance value.
a. Items should be a schema or an array of schemas and the instance value should be an array with all the items in the array conforming to this schema.
a. It indicates the format of the data from among predefined formats. This property does not need to be validated by validators.
37. Which syntax is correct for the jsonPath() function during the implementation of JSONPath?
Answers:
a. jsonPath(src, expr [, args])
a. jsonPath(obj, expr [, args],URL)
a. jsonPath(obj, expr [, args])
a. jsonPath(obj, expr [, args],src)
38. In the code snippet below, which line contains an error?
Answers:
a. True
a. False
20. JSON does not allow you to create an empty object.
Answers:
a. True
a. False
21. Which of the following correctly describes the disallow property of the JSON Schema?
Answers:
a. It indicates that the property will be used for volatile values that should not be persisted with.
a. It indicates that the instance property should not be changed.
a. It specifies that an instance property is an internal property that should not be made visible to the users.
a. This attribute may take the same values as the “type” attribute.
22. Which of the following correctly describes the function of the JSON.stringify method in JSON?
Answers:
a. It accepts a string and revives it into an object.
a. It converts a JavaScript object into a JSON string.
a. It converts a JSON object into a text.
a. It converts a JSON string into a JavaScript object.
23. Which of the following properties should be declared first in order to define a schema from an instance?
Answers:
a. $schema
a. $ref
a. $default
a. &id
24. Which of the following schema properties takes schema as value in JSON?
Answers:
a. extends
a. pattern
a. options
a. transient
25. While using JSONRequest.cancel, what will happen to the request if it is still in the outgoing message queue?
Answers:
a. It will be deleted from the queue.
a. It will abort.
a. It will call the done function of the request with an exception message of “cancelled”.
a. None of the above
26. Which of the following JSONPath elements represents the root object/element?
Answers:
a. /
a. $
a. @
a. .
27. What does the [start:end:step] element of JSONPath signify?
Answers:
a. It represents a subscript operator.
a. It represents recursive descent.
a. It represents attribute access.
a. It represents an array slice operator.
28. In order to find the last book, which of the JSONPath codes will you use?
Answers:
a. //book[(,length-1)] $..book[-1]
a. $..book[(@.length-1)] $.book[-1:]
a. $..book[(@length-1)] $.book[-1]
a. $..book[(@.length-1)] $..book[-1:]
29. Which of the following parameter values cannot be serialized in JSONRequest?
Answers:
a. timeout
a. done
a. url
a. send
30. Which of the following schema properties does not need to be validated by JSON validators?
Answers:
a. format
a. pattern
a. enum
a. transient
31. Which of the following schema properties always has a unique value for all its instances in JSON?
Answers:
a. requires
a. identity
a. readonly
a. disallow
32. Which of the following features of JSON has the property of exemption from the same origin policy?
Answers:
a. JSONRequest
a. Module
a. JSONT
a. JSLint
33. In the above code snippet, what is the purpose of declaring the JSONRequest.post?
Answers:
a. It will queue the request and call the done function.
a. It will queue the request and return the request number.
a. It will queue the request and return the request number and authentication information.
a. None of the above
34. Which of the following serialization formats is/are supported by JSON?
Answers:
a. Recurring structures
a. Invisible structures
a. Functions
a. None of the above
35. If a schema property is declared false, which of the following attributes can not be used to extend the schema?
Answers:
a. pattern
a. transient
a. format
a. additionalProperties
36. Which of the following correctly describes the term tuple typing in JSON Schema?
Answers:
a. Properties should be an object type with property definitions corresponding to instance object properties.
a. It provides an enumeration of possible values that are valid for the instance property. It should be an array, and each item in the array should represent a possible value for the instance value.
a. Items should be a schema or an array of schemas and the instance value should be an array with all the items in the array conforming to this schema.
a. It indicates the format of the data from among predefined formats. This property does not need to be validated by validators.
37. Which syntax is correct for the jsonPath() function during the implementation of JSONPath?
Answers:
a. jsonPath(src, expr [, args])
a. jsonPath(obj, expr [, args],URL)
a. jsonPath(obj, expr [, args])
a. jsonPath(obj, expr [, args],src)
38. In the code snippet below, which line contains an error?
Line1: {
Line2: “id”:”person”,
Line3: “type”:”object”,
Line4: “properties”:{
Line5: “name”:{“type”:”string”},
Line6: “age”:{“type”:”integer”}
Line7: }
Line8: }
Line9: {
Line10:”id”:”marriedperson”,
Line11: “extends”:{“ref”:”person”},
Line12: “properties”:{
Line13: “age”:{“type”:”integer”,
Line14: “minimum”:17},
Line15: }
Line16: }
Answers:
a. Line 3
a. Line 6
a. Line 11
a. Line 12
39. Which of the following correctly describes the JSON Schema?
Answers:
a. It is intended to provide validation and interaction control of the JSON data.
a. It is a JSON Object that defines the various attributes of the instance.
a. It does not support the serialization/deserialization tools.
a. It is a JSON extension wherein a prefix is specified as an input argument of the call itself. This prefix is typically the name of a callback function.
40. Which of the following parameters of JSONRequest hold/s the information of implicit authentication and cookies during post operation?
Answers:
a. src
a. done
a. send
a. url
Line2: “id”:”person”,
Line3: “type”:”object”,
Line4: “properties”:{
Line5: “name”:{“type”:”string”},
Line6: “age”:{“type”:”integer”}
Line7: }
Line8: }
Line9: {
Line10:”id”:”marriedperson”,
Line11: “extends”:{“ref”:”person”},
Line12: “properties”:{
Line13: “age”:{“type”:”integer”,
Line14: “minimum”:17},
Line15: }
Line16: }
Answers:
a. Line 3
a. Line 6
a. Line 11
a. Line 12
39. Which of the following correctly describes the JSON Schema?
Answers:
a. It is intended to provide validation and interaction control of the JSON data.
a. It is a JSON Object that defines the various attributes of the instance.
a. It does not support the serialization/deserialization tools.
a. It is a JSON extension wherein a prefix is specified as an input argument of the call itself. This prefix is typically the name of a callback function.
40. Which of the following parameters of JSONRequest hold/s the information of implicit authentication and cookies during post operation?
Answers:
a. src
a. done
a. send
a. url
No comments:
Post a Comment