Skip to content
Sharp

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)

  1. How can Jackson's ObjectMapper be configured to serialize a Java record into a JSON string?Multiple choiceMedium
  2. Which Jackson annotation can be used to rename a JSON property during deserialization?Multiple choiceMedium
  3. When using Jackson's ObjectMapper to deserialize JSON, what should you consider regarding unknown properties?Multiple choiceMedium
  4. Which method can be used to convert a JSON string back into a Java class using Jackson?Multiple choiceMedium
  5. Why does calling join on a CompletableFuture change runtime behavior?Multiple choiceMedium
  6. When using Jackson, how can you handle a situation where a field should be serialized only if it's not null?Multiple choiceHard
  7. Why does using @JsonProperty on a field in a Java class change runtime behavior?Multiple choiceMedium
  8. Why do teams use HttpClient over older HTTP handling methods in Java in production code?Multiple choiceMedium
  9. Which feature of HttpClient helps mitigate risks when connecting to untrusted HTTPS endpoints?Multiple choiceHard
  10. Which method on CompletableFuture can be used to combine results of two independent asynchronous computations?Multiple choiceMedium
  11. In a high-concurrency environment, what is a potential risk of not setting timeouts for HTTP requests?Multiple choiceHard
  12. Which exception should be caught to handle timeouts specifically in HTTP client operations?Multiple choiceMedium
  13. In Java socket programming, what is the role of a two-way communication endpoint?Multiple choiceHard
  14. Why does a Socket in Java networking matter in practice?Multiple choiceEasy
  15. When using Jackson's ObjectMapper to deserialize JSON, how can you handle unknown JSON properties without throwing an exception?Multiple choiceMedium
  16. Why do teams use Jackson's ObjectMapper in a Java application in production code?Multiple choiceEasy
  17. Why does the Content-Type header in HTTP requests matter in practice?Multiple choiceEasy
  18. Why can not properly configuring HTTP timeouts become a problem in practice?Multiple choiceMedium
  19. Which of the following is the correct way to deserialize a JSON string into a Java object using Jackson?Multiple choiceMedium
  20. Why do teams use Jackson's ObjectMapper when handling JSON in Java in production code?Multiple choiceMedium
  21. How does the Jackson ObjectMapper handle unknown properties by default?Multiple choiceEasy
  22. Which method on the HttpClient.Builder allows setting the connect timeout?Multiple choiceEasy
  23. Why does TLS in HTTP communications matter in this design?Multiple choiceMedium
  24. Which method would you use to set a custom timeout for an HttpClient in Java?Multiple choiceMedium
  25. What might happen if you don't configure timeouts in an HttpClient and a server becomes unresponsive?Multiple choiceHard
  26. Why does setting a connection timeout in an HTTP client help in practice?Multiple choiceEasy
  27. Which JSON structure is typically used to represent a collection of named values?Multiple choiceEasy
  28. Why might you use CompletableFuture in an HTTP client implementation?Multiple choiceHard
  29. How would you explain a typical use case for using CompletableFuture in Java's HttpClient in an interview?Multiple choiceMedium
  30. Which method of HttpClient is used to set a timeout for requests?Multiple choiceMedium
  31. Which class in Java is primarily used for HTTP requests and responses?Multiple choiceEasy
  32. How can Jackson's ObjectMapper handle unknown properties in a JSON string?Multiple choiceMedium
  33. How would you explain a key characteristic of a JSON object in an interview?Multiple choiceEasy
  34. In Java's HttpClient, which exception is specifically thrown for timeout situations?Multiple choiceEasy
  35. How does HTTP versioning help in maintaining API compatibility?Multiple choiceHard
  36. Why is using Jackson's ObjectMapper preferred over manual parsing for JSON data?Multiple choiceEasy
  37. Why can using a simple retry mechanism without backoff in HTTP requests become a problem in practice?Multiple choiceHard
  38. Why should teams implement retry logic in HTTP client requests?Multiple choiceEasy
  39. Why do teams use CompletableFuture with HTTP requests in Java in production code?Multiple choiceMedium
  40. In Java's CompletableFuture, which method can be used to combine multiple asynchronous tasks?Multiple choiceMedium
  41. Why might you choose a backoff strategy over simple retries for handling transient network errors?Multiple choiceMedium
  42. Why is retrying a GET for shipping rates usually safer than retrying a POST that charges a card?Multiple choiceMedium
  43. How would you explain a potential risk of not implementing retries for HTTP requests in an interview?Multiple choiceMedium
  44. How would you explain a key benefit of using structured JSON key-value formatting in an interview?Multiple choiceMedium
  45. How would you explain a common use case for using the Java HttpClient in an interview?Multiple choiceEasy
  46. Which method is commonly used to convert a Java object to JSON using Jackson?Multiple choiceEasy
  47. Why do timeouts matter in production HTTP clients?Multiple choiceMedium
  48. What potential issue should you consider when using CompletableFuture with HTTP requests?Multiple choiceHard
  49. Which method is used to configure a read timeout in Java's HttpClient?Multiple choiceMedium
  50. How can CompletableFuture improve the performance of HTTP requests in a Java application?Multiple choiceHard