Services for Javas
Java services are applications that expose functionality over HTTP, typically a REST API, and are packaged to run on a server or in a container. This final unit in the Build and Test stage covers handling requests and JSON, configuration, and producing an executable JAR from a finished Java project.
Stage: Build and Test · Part of the Java roadmap · Last reviewed 19 November 2026
What to learn in Services
- Build a small REST endpoint that accepts and returns JSON
- Map HTTP verbs and status codes correctly to create, read, update and delete actions
- Externalise configuration through properties files or environment variables
- Package an application as an executable JAR with its dependencies
- Write a Dockerfile that runs the packaged JAR on a slim JDK or JRE image
Services interview questions
What is the difference between a JAR and a fat JAR?
A plain JAR contains only your compiled classes and resources, and needs its dependencies on the classpath. A fat or uber JAR bundles dependencies inside as well and declares a main class, so it runs with a single java -jar command. This is the usual way to ship a service.
Which HTTP status code should a REST API return when creating a resource?
Return 201 Created, ideally with a Location header pointing to the new resource. Use 200 for plain successful reads, 400 for invalid input, 404 when the resource is missing and 409 for conflicts. Consistent codes make your API predictable for clients.
Where Services fits in the Java roadmap
Services belongs to the Build and Test stage (advanced level), which takes about 32 hours. Ship Java.