All fields

“Java Networking & HTTP Client” in Information Technology

19 questions across 1 technology.

Information Technology

19 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is the modern java.net.http.HttpClient (introduced in Java 11), and how does it improve on the older HttpURLConnection for making HTTP requests? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientBeginner
2What is the java.net.Socket and ServerSocket class pair, and how would you implement a basic TCP client-server communication using them at a lower level than HttpClient? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientIntermediate
3How would you implement a WebSocket client using java.net.http.WebSocket for real-time, bidirectional communication, and how does its event-driven Listener interface work? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientAdvanced
4How would you configure HttpClient with custom timeouts, a proxy, and connection pooling behavior, and what's the difference between a connection timeout and a request/response timeout? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientIntermediate
5How would you implement retry logic with exponential backoff for HTTP requests made via HttpClient, given the client doesn't provide built-in retry support natively? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientAdvanced
6How does HttpClient handle automatic following of HTTP redirects (3xx responses), and how would you configure or disable this behavior? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientIntermediate
7How would you configure HttpClient to trust a custom or self-signed SSL/TLS certificate for testing against an internal service, and what security risks does disabling certificate validation entirely introduce? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientAdvanced
8How would you make an asynchronous, non-blocking HTTP request using HttpClient's sendAsync() method, and how does the returned CompletableFuture integrate with the rest of an asynchronous pipeline? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientIntermediate
9How would you send a POST request with a JSON request body using HttpClient, and correctly parse a JSON response using a library like Jackson? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientIntermediate
10How would you send URL-encoded form data (application/x-www-form-urlencoded) using HttpClient, as opposed to a JSON request body? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientIntermediate
11How would you implement connection-level HTTP/2 server push handling using HttpClient's PushPromiseHandler, and in what scenario would a server proactively push additional resources? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientAdvanced
12How would you implement a simple HTTP server (not just a client) using the lightweight com.sun.net.httpserver.HttpServer class bundled with the JDK, without a full framework like Spring? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientAdvanced
13How would you add custom HTTP headers (like an Authorization bearer token) to an outgoing request using HttpRequest.Builder? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientBeginner
14How would you implement a custom BodySubscriber or BodyHandler to stream a very large HTTP response body incrementally, rather than buffering the entire response into memory at once? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientAdvanced
15How would you use InetAddress to perform DNS resolution (converting a hostname to an IP address) programmatically, and what's the difference between InetAddress.getByName() and getAllByName()? Java › Java Networking & HTTP ClientJavaJava Networking & HTTP ClientIntermediate
16What is the difference between a Java text block (introduced as a standard feature in Java 15) and a traditional String literal, and what specific syntax rules govern indentation handling? Java › Java Fundamentals: Syntax, Data Types & OperatorsJavaJava Fundamentals: Syntax, Data Types & OperatorsIntermediate
17What is the difference between LocalDate, LocalTime, LocalDateTime, and ZonedDateTime, and when would you use each? Java › Java Date & Time API (java.time)JavaJava Date & Time API (java.time)Intermediate
18What are the modern java.nio.file utility classes (Path, Files) introduced in Java 7 (NIO.2), and how do they improve on the older java.io.File class? Java › I/O & NIOJavaI/O & NIOIntermediate
19How does java.nio's Channel and Buffer abstraction differ fundamentally from the classic java.io Stream model, and what specific capability does this enable for non-blocking I/O? Java › I/O & NIOJavaI/O & NIOAdvanced