Java Full Stack Developer Interview Guide
Core Java
CORE JAVA CHEAT SHEET & SHORT NOTES
1. OOP Concepts:
- Encapsulation: Wrapping data and code into a single unit (class).
- Inheritance: Acquiring properties of a parent class.
- Polymorphism: One method, many forms (overloading/overriding).
- Abstraction: Hiding internal details, showing only necessary parts.
2. String:
- Immutable, stored in String pool.
- `==` compares references, `.equals()` compares values.
3. Exception Handling:
- Checked: Checked at compile time (IOException).
- Unchecked: Runtime exceptions (NullPointerException).
- `throw` vs `throws`, try-catch-finally, try-with-resources.
4. Collection:
- List (ArrayList, LinkedList), Set (HashSet, TreeSet), Map (HashMap, TreeMap).
- HashMap uses hashCode() and equals().
5. Concurrency:
- Thread, Runnable, Callable.
- Synchronization prevents race conditions.
- Executors manage thread pools.
6. Java 8:
- Lambda: (a, b) -> a + b
- Stream API: stream().filter().map().collect()
- Optional to avoid null checks.
Java Full Stack Developer Interview Guide
7. Memory:
- Stack: Local variables, method calls.
- Heap: Objects, instance variables.
Java Full Stack Developer Interview Guide
Core Java
CORE JAVA CHEAT SHEET & SHORT NOTES
1. OOP Concepts:
- Encapsulation: Wrapping data and code into a single unit (class).
- Inheritance: Acquiring properties of a parent class.
- Polymorphism: One method, many forms (overloading/overriding).
- Abstraction: Hiding internal details, showing only necessary parts.
2. String:
- Immutable, stored in String pool.
- `==` compares references, `.equals()` compares values.
3. Exception Handling:
- Checked: Checked at compile time (IOException).
- Unchecked: Runtime exceptions (NullPointerException).
- `throw` vs `throws`, try-catch-finally, try-with-resources.
4. Collection:
- List (ArrayList, LinkedList), Set (HashSet, TreeSet), Map (HashMap, TreeMap).
- HashMap uses hashCode() and equals().
5. Concurrency:
- Thread, Runnable, Callable.
- Synchronization prevents race conditions.
- Executors manage thread pools.
6. Java 8:
- Lambda: (a, b) -> a + b
- Stream API: stream().filter().map().collect()
- Optional to avoid null checks.
Java Full Stack Developer Interview Guide
7. Memory:
- Stack: Local variables, method calls.
- Heap: Objects, instance variables.
Java Full Stack Developer Interview Guide
J2EE
J2EE (Java 2 Platform, Enterprise Edition) CHEAT SHEET & SHORT NOTES
1. J2EE Architecture:
- Multitiered architecture: Client, Web, Business, and EIS tier.
- Uses Servlets, JSPs, EJBs for component development.
2. Servlet Basics:
- Lifecycle: init(), service(), destroy()
- `HttpServlet` handles HTTP requests (GET, POST).
- Annotations: @WebServlet("/path")
3. JSP (Java Server Pages):
- Used for dynamic web content.
- Directives: <%@ page %>, Scriptlets: <% code %>, Expressions: <%= value %>
- Implicit Objects: request, response, session, application, out
4. JDBC (Java Database Connectivity):
- Connect to database, execute queries.
- Classes: DriverManager, Connection, Statement, ResultSet
- Example:
```java
Connection con = DriverManager.getConnection(url, user, pass);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM table");
```
5. EJB (Enterprise Java Beans):
- For distributed, transactional apps.
- Types: Session Beans, Entity Beans, Message-Driven Beans
Java Full Stack Developer Interview Guide
6. JNDI (Java Naming and Directory Interface):
- Lookup services using naming conventions.
7. MVC in J2EE:
- JSP as View, Servlet as Controller, JavaBeans or EJB as Model.
Java Full Stack Developer Interview Guide
Spring
SPRING FRAMEWORK CHEAT SHEET & SHORT NOTES
1. Core Concepts:
- Dependency Injection (DI) & Inversion of Control (IoC)
- Bean lifecycle: instantiation -> property population -> init -> destruction
2. Annotations:
- @Component, @Service, @Repository, @Controller
- @Autowired, @Qualifier, @Value
3. Spring Configuration:
- XML config or Java-based using @Configuration + @Bean
4. AOP (Aspect-Oriented Programming):
- Cross-cutting concerns like logging, security.
- Annotations: @Aspect, @Before, @After, @Around
5. Spring JDBC & ORM:
- JdbcTemplate for DB operations.
- Integrates with Hibernate/JPA.
6. Transaction Management:
- @Transactional for method-level transactions.