SC105 Open Data Formats JSON Practice Exam, Exams of Technology

This practice exam tests practical skills in working with JSON across software systems. Candidates must understand nested structures, data validation, JSONPath querying, formatting, serialization, integration with APIs, and troubleshooting malformed data. Hands-on tasks mirror real engineering problems such as building configuration files, interacting with REST services, consuming JSON in scripts, and ensuring compatibility with schema standards.

Typology: Exams

2025/2026

Available from 01/12/2026

shilpi-jain-1
shilpi-jain-1 🇮🇳

4.2

(5)

29K documents

1 / 90

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SC105 Open Data Formats JSON Practice
Exam
**Question 1. Which character must be used to enclose a JSON object’s key name?**
A) Single quotes (')
B) Double quotes (")
C) Backticks (`)
D) No quotes are required
Answer: B
Explanation: JSON requires that all object keys be doublequoted strings; single quotes are not
valid.
**Question 2. In a JSON document, which of the following is a valid number representation?**
A) 0123
B) 1.2.3
C) -3.14e+2
D) 5,000
Answer: C
Explanation: JSON numbers may include a sign, a decimal point, and an exponent (e or E) with
optional +/; leading zeros are not allowed except for zero itself, and commas are illegal.
**Question 3. Which escape sequence represents a line feed in a JSON string?**
A) \r
B) \n
C) \t
D) \b
Answer: B
Explanation: \n is the escape for a newline (line feed) in JSON strings.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a

Partial preview of the text

Download SC105 Open Data Formats JSON Practice Exam and more Exams Technology in PDF only on Docsity!

Exam

Question 1. Which character must be used to enclose a JSON object’s key name? A) Single quotes (') B) Double quotes (") C) Backticks (`) D) No quotes are required Answer: B Explanation: JSON requires that all object keys be double‑quoted strings; single quotes are not valid. Question 2. In a JSON document, which of the following is a valid number representation? A) 0123 B) 1.2. C) - 3.14e+ D) 5, Answer: C Explanation: JSON numbers may include a sign, a decimal point, and an exponent (e or E) with optional +/‑; leading zeros are not allowed except for zero itself, and commas are illegal. Question 3. Which escape sequence represents a line feed in a JSON string? A) \r B) \n C) \t D) \b Answer: B Explanation: \n is the escape for a newline (line feed) in JSON strings.

Exam

Question 4. What is the correct JSON representation of an empty array? A) {} B) [] C) null D) "" Answer: B Explanation: An empty array is denoted by square brackets with nothing inside. Question 5. Which of the following is NOT a valid JSON primitive type? A) string B) number C) undefined D) boolean Answer: C Explanation: JSON defines only string, number, boolean, null, object, and array; undefined is not a JSON type. Question 6. Which statement about whitespace in JSON is true? A) Whitespace must be placed only between tokens. B) Whitespace is ignored by parsers and may appear anywhere outside strings. C) Whitespace is mandatory after each comma. D) Whitespace cannot appear inside arrays. Answer: B

Exam

Answer: C Explanation: JSON booleans are the literals true and false, all lowercase, without quotes. Question 10. Which of the following correctly nests an object within another object? A) {"parent": {"child": "value"}} B) {"parent": ["child": "value"]} C) {"parent": ("child":"value")} D) {"parent": {"child" = "value"}} Answer: A Explanation: Objects are enclosed in curly braces, and nesting is done by placing an object as a value of a key. Question 11. In JSON, which of these is a valid way to write a string that contains a double quote? A) "He said, "Hello"" B) "He said, "Hello"" C) 'He said, "Hello"' D) "He said, \“Hello\”" Answer: A Explanation: Inside a JSON string, a double quote must be escaped with a backslash. Question 12. Which JSONPath expression selects all values of the property “price” anywhere in the document? A) $.price B) $..price C) $[*].price

Exam

D) $..price Answer: B Explanation: The double‑dot operator performs a recursive descent, selecting all “price” members at any depth. Question 13. What does the JSON schema keyword “required” specify? A) The data type of a property. B) That a property must be present in the JSON instance. C) The default value for a property. D) That a property can be omitted. Answer: B Explanation: “required” is an array of property names that must exist in the validated JSON document. Question 14. Which JSON fragment will cause a parser error due to a trailing comma? A) {"a":1, "b":2} B) {"a":1, "b":2,} C) {"a":1 "b":2} D) {"a":1, "b":2, "c":3} Answer: B Explanation: JSON does not permit a comma after the final name/value pair in an object. Question 15. Which JSONPath filter selects array elements whose “age” is greater than 21? A) $[?(@.age > 21)] B) $[?(@.age >= 21)]

Exam

C) Using \U followed by eight hex digits. D) They cannot be represented. Answer: B Explanation: JSON uses \uXXXX escape sequences; characters outside the Basic Multilingual Plane are encoded as surrogate pairs. Question 19. Which JSONPath syntax accesses the third element of an array named “items”? A) $.items[2] B) $.items[3] C) $['items'].third D) $.items[?(@==3)] Answer: A Explanation: JSON arrays are zero‑based; index 2 refers to the third element. Question 20. Which of these is a correct way to represent a decimal number with scientific notation in JSON? A) 1.23e B) 1.23e+ C) 1.23E D) All of the above Answer: D Explanation: JSON numbers may use e or E with optional + or – signs for exponents. Question 21. In a JSON schema, what does the keyword “type”: "array" enforce? A) That the instance must be an object.

Exam

B) That the instance must be a string. C) That the instance must be an array. D) That the instance can be any type. Answer: C Explanation: The “type” keyword restricts the instance to the specified JSON data type. Question 22. Which JSONPath expression returns the values of all keys that start with “id_”? A) $..['id_'] B) $..[?(@key =~ /^id_/)] C) $..id_ D) $..id_ Answer: B Explanation: The filter uses a regular‑expression match on the key name; JSONPath implementations that support =~ allow this pattern. Question 23. Which of the following is a valid JSON representation of a string that includes a backslash? A) "C:\Program Files\App" B) "C:\Program Files\App" C) "C:/Program Files/App" D) "C:\Program Files\App" Answer: A Explanation: Backslashes must be escaped as \ inside JSON strings. Question 24. Which of these statements about JSON arrays is true?

Exam

A) Allows extra properties of any type. B) Disallows any properties not listed in “properties”. C) Sets default values for missing properties. D) Marks all properties as required. Answer: B Explanation: Setting additionalProperties to false rejects any property not explicitly defined. Question 28. Which JSONPath token is used to denote the root element? A) @ B) # C) $ D) & Answer: C Explanation: The dollar sign $ references the root of the JSON document. Question 29. Which of the following numbers is NOT valid in JSON? A) 0 B) - 0. C) + D) 6e- 1 Answer: C Explanation: JSON numbers cannot have a leading plus sign; only an optional minus is allowed. Question 30. Which JSON fragment correctly represents a nested array inside an object? A) {"data": [1, 2, [3,4]]}

Exam

B) {"data": (1,2,[3,4])} C) {"data": {1,2,[3,4]}} D) {"data": "1,2,3,4"} Answer: A Explanation: Square brackets denote arrays; nesting is allowed as shown. Question 31. Which JSONPath expression selects all elements in any array that have a property “type” equal to “fruit”? A) $..[?(@.type == 'fruit')] B) $..*[@.type='fruit'] C) $..[type='fruit'] D) $..[?(@type == 'fruit')] Answer: A Explanation: The filter syntax ?(@.type == 'fruit') tests each array element’s type property. Question 32. In JSON, which of the following escape sequences is used for a tab character? A) \n B) \t C) \b D) \r Answer: B Explanation: \t represents a horizontal tab in JSON strings. Question 33. Which statement about JSON and XML is true? A) JSON supports comments natively; XML does not.

Exam

Question 36. What does the JSONPath expression $..book[?(@.price < 20)].title return? A) Titles of all books priced under 20, regardless of location. B) Titles of the first book only. C) An array of price values. D) An error because title is not a valid operator. Answer: A Explanation: The recursive descent .. finds all book objects, the filter selects those with price < 20, and .title extracts their titles. Question 37. Which of these is a correct way to write a JSON string that includes a newline? A) "Line1\nLine2" B) "Line Line2" C) "Line1\nLine2" D) "Line1\rLine2" Answer: A Explanation: The escape sequence \n inserts a newline character inside the string. Question 38. In JSON Schema, how would you specify that a property “email” must match a regular expression pattern? A) "email": {"format": "email"} B) "email": {"pattern": "^[\w.%+-]+@[\w.-]+\.[A-Za-z]{2,}$"} C) "email": {"type": "regex"} D) "email": {"enum": ["regex"]} Answer: B

Exam

Explanation: The “pattern” keyword defines a regular expression that the string must satisfy. Question 39. Which JSONPath operator selects all members of an object, regardless of key names? A) .* B) ..* C) * D) $* Answer: B Explanation: The recursive wildcard ..* traverses the whole document and selects every value. Question 40. Which of the following is NOT a valid JSON value type? A) Date B) Number C) Boolean D) Null Answer: A Explanation: JSON does not have a native Date type; dates must be represented as strings or numbers. Question 41. Which JSON fragment correctly includes a forward slash character without escaping? A) "url": "http://example.com/api" B) "url": "http://example.com/api" C) "url": "http://example.com/api/" D) All of the above are valid.

Exam

D) That a property can be omitted. Answer: A Explanation: “enum” lists permissible literal values for the instance. Question 45. Which JSONPath expression would retrieve the value of the property “status” located directly under the root object? A) $.status B) $..status C) $['status'] D) Both A and C Answer: D Explanation: Both $.status and $['status'] directly access the root’s “status” property. Question 46. Which of the following is a valid JSON representation of a negative integer? A) "-5" B) - 5 C) – 5 (en dash) D) + Answer: B Explanation: Numbers are not quoted; a leading minus sign is allowed, but a plus sign is not. Question 47. In a JSON document, which character separates a key from its value? A) = B) : C) ;

Exam

D) ,

Answer: B Explanation: The colon character is the delimiter between a key and its associated value. Question 48. Which JSON schema construct allows you to require that exactly one of several properties be present? A) "anyOf" B) "oneOf" C) "allOf" D) "not" Answer: B Explanation: “oneOf” validates that exactly one of the provided subschemas matches. Question 49. Which JSONPath syntax would you use to select all elements of an array named “orders” that have a “total” field greater than 100? A) $.orders[?(@.total > 100)] B) $..orders[?(@total > 100)] C) $.orders[?(@total > 100)] D) $[?(@.orders.total > 100)] Answer: A Explanation: The filter is applied to each element of the orders array, checking the total property. Question 50. Which of the following JSON fragments is syntactically correct for representing an empty object? A) []

Exam

A) $[*]

B) $..*

C) $.**

D) $...*

Answer: A Explanation: $[*] selects all elements of the root array. Question 54. Which of the following JSON fragments correctly includes a Unicode escape for the character “Ω”? A) "\u03A9" B) "\u03a9" C) "\u03A" D) "\U000003A9" Answer: A Explanation: JSON uses \u followed by exactly four hexadecimal digits; “Ω” is U+03A9. Question 55. Which JSON schema keyword is used to specify that a string must follow the RFC 3339 date‑time format? A) "format": "date-time" B) "type": "datetime" C) "pattern": "^\d{4}-\d{2}-\d{2}T..." D) "dateTime": true Answer: A Explanation: The “format” keyword with value “date-time” signals RFC‑3339 compliance.

Exam

Question 56. In JSON, which of the following is a correct way to represent the boolean value true inside an array? A) ["true"] B) [true] C) ["True"] D) [True] Answer: B Explanation: Booleans are unquoted literals; true (lowercase) is correct. Question 57. Which JSONPath filter expression selects array members whose “status” field is not null? A) $[?(@.status != null)] B) $[?(@.status <> null)] C) $[?(@.status !== null)] D) $[?(@.status != undefined)] Answer: A Explanation: JSONPath uses the != operator to compare against the literal null. Question 58. Which of these JSON fragments would cause a parser error because of an unescaped control character? A) {"text": "Line1\nLine2"} B) {"text": "Line Line2"} C) {"text": "Line1\nLine2"} D) {"text": "Line1\rLine2"} Answer: B