Sitemap

Member-only story

JAVA Interview Questions

21 min read2 days ago

--

From Core Java fundamentals to String Pool internals, immutability, StringBuilder, StringBuffer, JVM optimization, Unicode, tricky output questions, and production-level scenarios.

Level: Intermediate to Advanced Target audience: Java developers with 3–5 years of experience Format: 50 interview questions with answers, code examples, explanations, and practical trade-offs.

Introduction: What Interviewers Expect From a Java Developer With 3–5 Years of Experience

For an entry-level Java interview, knowing that String is immutable and that StringBuilder is faster than StringBuffer might be enough.

For a developer with 3–5 years of experience, interviewers typically expect more:

  • You should understand why String is immutable, not merely memorize the definition.
  • You should predict the output of code involving String literals, constructors, concatenation, and intern().
  • You should understand ==, equals(), and the hashCode() contract.
  • You should explain StringBuilder and StringBuffer, including their trade-offs.
  • You should know how concatenation can affect allocation and performance.
  • You should understand UTF-16, Unicode code points, and character encoding.
  • You should know how to handle strings safely in REST APIs, databases, logs, and concurrent applications.

--

--