Edition 1 · PDF · 386 pages

Java Interview Pack

208 interview questions, 59 output drills, a 332-item cheatsheet and a 185-term glossary, for freshers and developers with up to three years of experience. Every snippet was compiled and run on Java 21.0.13 (Eclipse Temurin / OpenJDK). The output you see in the pack came from that run.

Launch price: ₹199 for the first 50 buyers

Regular price: ₹299

Apply coupon above, then buy — Razorpay opens after that

Pay, then download the PDF straight away. We also email you a copy. About 2.9 MB.

See a sample question ↓

For your own study only. Please don't share the file. Refund policy

Cover of the Schoolabe Java Interview Pack, Edition 1. The cover lists 208 interview questions, 59 output drills, 332 cheatsheet items and 185 glossary terms, and says all code was run on Java 21.0.13 (OpenJDK, Eclipse Temurin).
  • 386 pages
  • 208 questions
  • 20 topics
  • 36 DSA coding questions
  • 59 output drills
  • 332 cheatsheet items
  • 185 glossary terms
  • 46 advanced follow-ups
  • Run on Java 21 (Eclipse Temurin)

What's inside the Java pack

The questions start with types and strings, then move through OOP, collections, modern Java 21 features, concurrency, the JVM, and coding problems. After the questions come the drills, a cheatsheet and a glossary. You do not need to read it in one go. Treat it like a revision notebook.

TopicQuestionsCount
Java basics and typesQ1–Q1515
Strings and immutabilityQ16–Q2510
OOP: classes, inheritance and polymorphismQ26–Q4015
Interfaces, abstract classes and sealed typesQ41–Q488
equals and hashCodeQ49–Q546
CollectionsQ55–Q7016
GenericsQ71–Q788
ExceptionsQ79–Q8810
Lambdas and functional interfacesQ89–Q968
StreamsQ97–Q10812
OptionalQ109–Q1135
RecordsQ114–Q1185
Switch and pattern matchingQ119–Q1257
Text blocks, var and other modern syntaxQ126–Q1305
Files, dates and I/OQ131–Q1355
ConcurrencyQ136–Q15217
JVM memory and garbage collectionQ153–Q1608
Class loadingQ161–Q1644
Common trapsQ165–Q1728
Coding questions (DSA style)Q173–Q20836
  • How to use this pack and a 7-day revision plan, at the front.
  • Output prediction drills (P1–P59). Short snippets, a box for your guess, and "Answer on page N" under each one. All answers, with the "why", are together at the end of that section. Some drills end with an exception or do not compile; those answers show the first line of the real error.
  • Cheatsheet: everyday Java reference — 332 items in 22 groups, from String and collections to streams, java.time and concurrency. Each row has a one-line description, a tiny example, and its real output.
  • Glossary — 185 terms, in alphabetical order, each explained in a sentence or two. The letters K, Q and X have no terms.
  • This pack does not cover Spring Boot. Spring Boot is a separate pack, later in the same series.

Sample pages

These are real pages from the Edition 1 PDF, shown so you can judge the layout and the writing. They are not a free chapter.

One question, as it appears in the pack

This is Q1 from Java basics and types, copied from the PDF. The rest of the pack follows the same shape.

Q1 · Java basics and types

What is the difference between the JDK, the JRE and the JVM?

The JVM (Java Virtual Machine) runs compiled Java bytecode. The JRE (Java Runtime Environment) is the JVM plus the standard class library, which is everything you need to run a program. The JDK (Java Development Kit) is the JRE plus tools for developers, such as the compiler javac, jshell and jar. Since Java 11 you normally just install a JDK.

In simple words: The JVM runs the code, the JRE is what you need to run it, and the JDK is what you need to write it.

Why it works

Java source code is not turned straight into machine code for your processor. javac first compiles .java files into .class files that contain bytecode, a compact set of instructions for an imaginary machine. The JVM reads that bytecode and runs it, first by interpreting it and then, for code that runs often, by compiling it to real machine code while the program runs. That second step is called JIT compilation (just-in-time). This is why the same .class file runs on Linux, Windows and macOS: each platform has its own JVM.

Older Java versions shipped a separate JRE download for people who only wanted to run programs. From Java 11 onwards, vendors such as Oracle, Eclipse Temurin and Amazon Corretto ship the JDK, and you can build a small custom runtime with the jlink tool if you need one. So in interviews you can say "JRE" for the idea (the runtime part) even though it is rarely a separate product now.

Since Java 11 you can also run a single source file directly with java Hello.java. The launcher compiles it in memory and runs it. Almost every snippet in this pack was run that way. The few that end in a NullPointerException were compiled with javac -g and then run with java, because -g keeps local variable names in the class file, so the error message can name the variable that was null.

class Main {
    public static void main(String[] args) {
        Runtime.Version v = Runtime.version();
        System.out.println("Feature release: " + v.feature());
        System.out.println("Spec version: "
                + System.getProperty("java.specification.version"));
        System.out.println("Bytecode class version for Java 21: "
                + (44 + 21));
    }
}

Output, real run on Java 21.0.13:

Feature release: 21
Spec version: 21
Bytecode class version for Java 21: 65

The last line is a small fact worth knowing: class file version 65 means Java 21. If you run a class compiled for a newer Java on an older JVM, you get an UnsupportedClassVersionError that mentions these numbers.

Common mistakes

  • Saying "Java is interpreted". The JVM starts by interpreting bytecode but compiles hot code to machine code with the JIT compiler, so long-running Java code runs at native speed.
  • Mixing up javac (compiler, in the JDK) and java (launcher that starts a JVM).
  • Saying the JVM understands .java files. It only runs bytecode; the single-file launcher compiles the source for you first.

Follow-ups

  • What does "write once, run anywhere" mean? The same bytecode runs on any platform that has a JVM, so you do not recompile for each operating system.
  • What is the JIT compiler? The part of the JVM that compiles frequently used bytecode into machine code at run time, using what it learned while the program ran.
  • What are HotSpot and GraalVM? (Advanced) HotSpot is the JVM inside most OpenJDK builds. GraalVM is another JDK distribution with its own JIT compiler and an option to compile programs ahead of time into native executables.

Who this pack is for

This pack is for freshers and developers with up to three years of experience who already write some Java and want to revise for interviews.

It will help if you are preparing for a first job, an internship, or a backend role where the interviewer will ask about OOP, collections, equals and hashCode, streams, concurrency, and a few coding problems.

It is not a first Java tutorial, and it is not a Spring Boot guide. Spring Boot is a later pack in this series. If you are still learning Java itself, learn the language first, then use this pack when you are practising interview answers.

How to use the pack

  • You do not need to read 386 pages in one sitting. A useful session is a handful of questions, said out loud.
  • Read the question and say your answer out loud before you read the short answer, as if someone is sitting in front of you. Speaking is a different skill from knowing.
  • Before you look at the output of a code block, write down what you think it will print. Then check. The gap between your guess and the real output is what you need to revise.
  • Type the code into a file and run it with java Main.java (Java 11 and later can run a single source file without a separate javac step). Then change one thing, such as making a field final or removing an equals method, and see what breaks. Five minutes of this beats an hour of reading.
  • Tick the box next to each question in the contents when you can answer it without looking. On Day 7, come back to every question you have not ticked.
  • In the real interview, start with the short answer. Stop. Let the interviewer decide whether to go deeper. A good answer has three parts: what it is, why it behaves that way, and when you would use it in real code. For coding questions, say the simple idea first, then improve it, and state the time and space cost.

A 7-day revision plan

The pack assumes about three hours a day: two for the topic questions, one for coding and output drills. If you have less time, do the must-know questions first. Every day ends with a few coding questions, so you practise problem solving all week instead of cramming it on the last day.

DayTopicsCodingDrillsMust-know first
1Java basics and types (Q1–Q15), Strings (Q16–Q25)Q173–Q176P1–P8Q5, Q4, Q9, Q17, Q16
2OOP (Q26–Q40), Interfaces and sealed types (Q41–Q48), equals and hashCode (Q49–Q54)Q177–Q180P9–P17Q30, Q31, Q41, Q49, Q36
3Collections (Q55–Q70), Generics (Q71–Q78)Q181–Q186P18–P28Q58, Q56, Q62, Q64, Q73
4Exceptions (Q79–Q88), Lambdas (Q89–Q96), Streams (Q97–Q108), Optional (Q109–Q113)Q187–Q192P29–P43Q79, Q82, Q90, Q98, Q101, Q109
5Records (Q114–Q118), Switch and patterns (Q119–Q125), Modern syntax (Q126–Q130), Files and dates (Q131–Q135)Q193–Q197P44–P53Q114, Q44, Q122, Q127, Q132
6Concurrency (Q136–Q152)Q198–Q202P54–P56Q139, Q140, Q142, Q144, Q145, Q146
7JVM memory and GC (Q153–Q160), Class loading (Q161–Q164), Common traps (Q165–Q172), then every question you have not tickedQ203–Q208P57–P59, then every drill you got wrongQ153, Q155, Q164, Q167, Q206

On Day 7, the pack suggests finishing with a 30-minute mock interview with a friend: they pick random question numbers, you answer out loud, then you solve one coding question while explaining your thinking.

Each day also has cheatsheet groups to skim. Day 7 is a slow pass over every group, the evening before your interview.

Licence and refunds

The same personal-study licence as the Python pack applies. You may read the PDF on your own devices, print one copy for yourself, and copy the code examples into your own practice files. You may not share it, upload it, resell it, or remove the Schoolabe name.

If a friend would find this pack useful, please send them to schoolabe.com instead of sending them the file.

Refunds follow Schoolabe's refund policy. That page says digital products that have been fully accessed or downloaded are generally non-refundable. Please read the policy before you buy.

Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates. This pack is not made or endorsed by Oracle.

Questions about the Java pack

How many questions are in the Java Interview Pack?

208 interview questions across 20 topics, including 36 DSA-style coding questions. There are also 59 output-prediction drills, a 332-item cheatsheet, a 185-term glossary, and 46 advanced follow-ups. The PDF is 386 pages.

Was the code in the pack actually run?

Yes. Every snippet was compiled and run on Java 21.0.13, the Eclipse Temurin build of OpenJDK. The output was copied from that run by a script, not typed by hand. Snippets that are meant to fail show the real compiler message or exception. A few results, such as default garbage collectors, are JVM-specific; the pack says so when that matters.

Does this pack cover Spring Boot?

No. This pack is core Java, collections, modern Java 21 language features, concurrency, the JVM, and DSA. Spring Boot is a separate pack, planned later in this series.

Which Java version should I practise on?

Java 21, which is a long-term support release. Every feature used in the pack is final in Java 21; nothing needs --enable-preview.

I am new to Java. Should I buy this?

Only if you already write some Java and are preparing for interviews. This is a revision pack, not a first tutorial.

How do I get the file, and can I print it?

After you pay, you download the PDF straight away, and we email you a copy. The licence allows one printed copy for your own use.

Can I share it with my classmates?

No. The licence is for the person who bought it. Please point classmates to schoolabe.com.

What is the refund policy?

See Schoolabe's refund policy. Digital products that have been fully accessed or downloaded are generally non-refundable under that policy.

Free practice stays at /interview-prep.