CV & Interviews

Thirty Java Interview Questions to Practise With Context

Huwell Consultancy editorial2 min read

Use these questions to rehearse explanations and examples rather than memorise fixed answers. For each topic, discuss the assumptions, an example from your work and a limitation or failure case.

Language and object design

1. How do equality and identity differ? 2. What must an equality implementation consider alongside hashing? 3. When would you use an immutable object? 4. How do you decide between composition and inheritance? 5. What makes an exception useful to a caller? Explain the effect on maintainability and testing, not only the syntax involved.

Collections and concurrency

6. How would you select a collection for a workload? 7. What can go wrong with a mutable map key? 8. How do you identify shared mutable state? 9. What does thread safety mean for a particular component? 10. How would you investigate a concurrency failure? Use concrete scenarios and distinguish a guarantee from an assumption.

Spring and application boundaries

11. What problem does dependency injection solve? 12. How do you choose a service boundary? 13. Where should input validation occur? 14. How would you handle configuration across environments? 15. How do you test a component without starting every dependency? Verify framework-specific behaviour in the current documentation rather than relying on an old rule of thumb.

APIs and data

16. How do you design an error response? 17. What makes a retry safe? 18. How would you investigate a slow database interaction? 19. Where should a transaction boundary sit? 20. How would you introduce a compatible API change? Explain correctness and failure behaviour alongside performance.

Distributed systems

21. How can a consumer handle duplicate messages? 22. What happens when a dependency times out? 23. When might caching create a correctness problem? 24. How do you reason about eventual consistency? 25. What would you monitor in an asynchronous workflow? State the requirement before selecting a design pattern.

Delivery and diagnosis

26. How do you distinguish unit and integration test responsibilities? 27. How would you investigate increased service latency? 28. What makes a deployment reversible? 29. How do you protect sensitive information in logs? 30. Which technical decision would you change with hindsight? Connect the answer to your experience and be clear about what you personally owned.

Put the guidance into practice

  • Choose five questions relevant to the vacancy.
  • Answer each using a scenario and a trade-off.
  • Note the implementation details you need to verify.

Are these the questions every employer will ask?

No. They are practice prompts covering common engineering concerns, not a claim about a particular employer’s assessment or a complete description of Java.

Continue reading

EXPLORE THE NEXT STEP

Discuss the work you want to do.

Browse current technology vacancies with Huwell Consultancy and ask us about the responsibilities that matter to you.

Explore opportunities
KEEP EXPLORING

More guidance for your next decision