Java Fundamentals and Service Practices
viaLeetCode
Prompt Backend engineering breadth: modern Java plus how you run services in production.
Be ready to discuss
- Java 8+ features and why they mattered: lambdas and functional interfaces, Streams (map/filter/collect, laziness), Optional, default methods on interfaces, CompletableFuture, the new date/time API; know a couple of post-8 additions (var, records, switch expressions) for contrast.
- Abstract classes vs interfaces: state + partial implementation vs contract; when each is the right tool post-default-methods.
- Dependency injection vs factory/builder: DI inverts control for wiring and testability (constructor injection, mocking seams); factories encapsulate creation choice; builders tame telescoping constructors — where each fits and how they combine.
- Service health monitoring: the metrics that matter (latency percentiles, error rate, throughput, saturation), dashboards + alerting (e.g. Prometheus/Grafana, Datadog), health endpoints, structured logs, distributed tracing.
- Testing approach: the pyramid — fast unit tests with mocks (JUnit + Mockito), integration tests against real dependencies (Testcontainers), contract tests between services; what belongs at each level and CI gating.
asked …