Loading

Quipoin Menu

Learn • Practice • Grow

spring / JSON Processing with Jackson
mcq
Direction: Choose the correct option

Q1.

What is Jackson in Spring?
A. A JSON processing library used by Spring
B. A data binding library
C. A streaming parser
D. All of the above
Direction: Choose the correct option

Q2.

How does Spring automatically handle JSON conversion?
A. Using HttpMessageConverter (MappingJackson2HttpMessageConverter)
B. Using @ResponseBody and @RequestBody
C. Both A and B
D. None
Direction: Choose the correct option

Q3.

Which annotation ignores null fields during serialization?
A. @JsonInclude(Include.NON_NULL)
B. @JsonIgnore
C. @JsonProperty
D. @JsonFormat
Direction: Choose the correct option

Q4.

What does @JsonIgnore do?
A. Prevents a field from being serialized/deserialized
B. Ignores unknown properties
C. Renames a property
D. Formats a date
Direction: Choose the correct option

Q5.

How do you rename a JSON property using Jackson?
A. @JsonProperty('new_name')
B. @JsonAlias
C. @JsonName
D. @JsonRename
Direction: Choose the correct option

Q6.

What is the purpose of @JsonFormat?
A. To specify format for dates/times
B. To format numbers
C. To format strings
D. All
Direction: Choose the correct option

Q7.

How do you handle unknown properties during deserialization?
A. @JsonIgnoreProperties(ignoreUnknown = true)
B. @JsonIgnore
C. @JsonProperty
D. @JsonInclude
Direction: Choose the correct option

Q8.

What is the use of @JsonView?
A. To control which fields are serialized based on view
B. To provide multiple views
C. To filter data
D. All
Direction: Choose the correct option

Q9.

How do you configure Jackson globally in Spring Boot?
A. Via application properties (spring.jackson.*)
B. Using Jackson2ObjectMapperBuilder
C. Creating a custom ObjectMapper bean
D. All of the above
Direction: Choose the correct option

Q10.

What exception does Jackson throw when JSON parsing fails?
A. JsonParseException
B. JsonMappingException
C. HttpMessageNotReadableException
D. All