Java Interview Guide
How to Build Confidence With a Solid Understanding
of Core Java Principles
By Anthony DePalma
Copyright © 2015 by Anthony DePalma
All rights reserved.
Editors: Ayesha Khan; Jon Hall
eBook formatting/conversion:
www.fromprinttoebook.com
Table of Contents
Introduction
The Purpose of this Guide
The Java Programming Language
The History of Java
The Java Virtual Machine
Procedural Programming vs Object-Oriented Programming
Questions
Object-Oriented Concepts
Abstraction
Encapsulation
Polymorphism
Mutability
Coupling
Cohesion
Questions
Object-Oriented Programming (Part I)
Classes &
Objects
Primitive Types
Arrays
Strings
Enums
Packages
Questions
Object-Oriented Programming (Part II)
Methods
Pass-by-Reference vs Pass-by-Value
The Final Keyword
The Static Keyword
Access Modifiers
Annotations
Questions
The Object Superclass
Clone
Equals
HashCode
ToString
GetClass
Finalize
Wait, Notify, NotifyAll
Questions
Composition & Inheritance
Composition
Inheritance
Method Overriding vs Method Overloading
Composition vs Inheritance
Questions
Abstract Classes & Interfaces
Abstract Classes
Interfaces
Abstract
Classes vs Interfaces
Anonymous Classes
Questions
Exceptions
Unchecked Exceptions
Checked Exceptions
Unchecked Exceptions vs Checked Exceptions
Errors
Try/Catch/Finally
Try-With-Resources
Questions
Generics
Compile-Time Errors vs Runtime Errors
Generics
Generic Wildcards
Type Erasure
Questions
Concurrency
Thread Lifecycle
Synchronization
The Synchronize Keyword
The Volatile Keyword
Concurrent Data Structures
The Executor Framework
ThreadLocal
Storage
Atomic Variables
Questions
Memory Management
Heap Memory
Garbage Collection
Strong References
Memory Leaks
Soft References
Weak References
Reference Queue
Phantom References
Questions
Java Database Connectivity
Connection
Statements
ResultSets
SQL Injection
Object-Relational Mapping
Questions
Web Applications
The
Servlet API
Servlets
JavaServer Pages
Filters
Model-View-Controller
Questions
Web Services
Service-Oriented Architecture
Web Services
SOAP
REST
SOAP vs REST
Introduction
The Purpose of this Guide
This guide will prepare you for an interview to an entry-level or a senior-level
position as a Java software developer. It’s intended to be a high-level resource
and it’s assumed that you are already familiar with the Java language and know
how to write basic applications.
The book is divided into chapters of related concepts that are presented
in interview-sized chunks. At the end of each chapter is a series of potential
interview questions. Read through each chapter and research any topics that are
unfamiliar until you are able to answer every question confidently. All of the
questions are listed again at the end of the book.
In order to get the most out of this guide, make sure that you are able to answer
every question in your own words. From the
perspective of an interviewer, it’s
always better to hear a candidate explain something uniquely, because it proves
that you understand the underlying concepts. It will also prepare you for
variations of the same questions. The stronger you understand the concepts,
the more confident you’ll appear in your interview. Are you ready?