Networking interview questions
Asynchronous HTTP, HttpClient Basics, Jackson ObjectMapper, JSON Serialization, Socket Programming, Timeouts and Retries
127 questions with answers and explanations · 127 flashcards
Questions (page 2 of 3)
- How can Jackson's ObjectMapper be configured to serialize a Java record into a JSON string?Multiple choiceMedium
- Which Jackson annotation can be used to rename a JSON property during deserialization?Multiple choiceMedium
- When using Jackson's ObjectMapper to deserialize JSON, what should you consider regarding unknown properties?Multiple choiceMedium
- Which method can be used to convert a JSON string back into a Java class using Jackson?Multiple choiceMedium
- Why does calling join on a CompletableFuture change runtime behavior?Multiple choiceMedium
- When using Jackson, how can you handle a situation where a field should be serialized only if it's not null?Multiple choiceHard
- Why does using @JsonProperty on a field in a Java class change runtime behavior?Multiple choiceMedium
- Why do teams use HttpClient over older HTTP handling methods in Java in production code?Multiple choiceMedium
- Which feature of HttpClient helps mitigate risks when connecting to untrusted HTTPS endpoints?Multiple choiceHard
- Which method on CompletableFuture can be used to combine results of two independent asynchronous computations?Multiple choiceMedium
- In a high-concurrency environment, what is a potential risk of not setting timeouts for HTTP requests?Multiple choiceHard
- Which exception should be caught to handle timeouts specifically in HTTP client operations?Multiple choiceMedium
- In Java socket programming, what is the role of a two-way communication endpoint?Multiple choiceHard
- Why does a Socket in Java networking matter in practice?Multiple choiceEasy
- When using Jackson's ObjectMapper to deserialize JSON, how can you handle unknown JSON properties without throwing an exception?Multiple choiceMedium
- Why do teams use Jackson's ObjectMapper in a Java application in production code?Multiple choiceEasy
- Why does the Content-Type header in HTTP requests matter in practice?Multiple choiceEasy
- Why can not properly configuring HTTP timeouts become a problem in practice?Multiple choiceMedium
- Which of the following is the correct way to deserialize a JSON string into a Java object using Jackson?Multiple choiceMedium
- Why do teams use Jackson's ObjectMapper when handling JSON in Java in production code?Multiple choiceMedium
- How does the Jackson ObjectMapper handle unknown properties by default?Multiple choiceEasy
- Which method on the HttpClient.Builder allows setting the connect timeout?Multiple choiceEasy
- Why does TLS in HTTP communications matter in this design?Multiple choiceMedium
- Which method would you use to set a custom timeout for an HttpClient in Java?Multiple choiceMedium
- What might happen if you don't configure timeouts in an HttpClient and a server becomes unresponsive?Multiple choiceHard
- Why does setting a connection timeout in an HTTP client help in practice?Multiple choiceEasy
- Which JSON structure is typically used to represent a collection of named values?Multiple choiceEasy
- Why might you use CompletableFuture in an HTTP client implementation?Multiple choiceHard
- How would you explain a typical use case for using CompletableFuture in Java's HttpClient in an interview?Multiple choiceMedium
- Which method of HttpClient is used to set a timeout for requests?Multiple choiceMedium
- Which class in Java is primarily used for HTTP requests and responses?Multiple choiceEasy
- How can Jackson's ObjectMapper handle unknown properties in a JSON string?Multiple choiceMedium
- How would you explain a key characteristic of a JSON object in an interview?Multiple choiceEasy
- In Java's HttpClient, which exception is specifically thrown for timeout situations?Multiple choiceEasy
- How does HTTP versioning help in maintaining API compatibility?Multiple choiceHard
- Why is using Jackson's ObjectMapper preferred over manual parsing for JSON data?Multiple choiceEasy
- Why can using a simple retry mechanism without backoff in HTTP requests become a problem in practice?Multiple choiceHard
- Why should teams implement retry logic in HTTP client requests?Multiple choiceEasy
- Why do teams use CompletableFuture with HTTP requests in Java in production code?Multiple choiceMedium
- In Java's CompletableFuture, which method can be used to combine multiple asynchronous tasks?Multiple choiceMedium
- Why might you choose a backoff strategy over simple retries for handling transient network errors?Multiple choiceMedium
- Why is retrying a GET for shipping rates usually safer than retrying a POST that charges a card?Multiple choiceMedium
- How would you explain a potential risk of not implementing retries for HTTP requests in an interview?Multiple choiceMedium
- How would you explain a key benefit of using structured JSON key-value formatting in an interview?Multiple choiceMedium
- How would you explain a common use case for using the Java HttpClient in an interview?Multiple choiceEasy
- Which method is commonly used to convert a Java object to JSON using Jackson?Multiple choiceEasy
- Why do timeouts matter in production HTTP clients?Multiple choiceMedium
- What potential issue should you consider when using CompletableFuture with HTTP requests?Multiple choiceHard
- Which method is used to configure a read timeout in Java's HttpClient?Multiple choiceMedium
- How can CompletableFuture improve the performance of HTTP requests in a Java application?Multiple choiceHard