Aarav Kulkarni
✓ Enrolled📍 Pune, India • B.Tech CSE → Java 21 & Spring Boot 3
📅 Weekend Sat–Sun (10 AM–12 PM IST)
Launch full-screen from your iPhone / iPad Home Screen
Go from Java 21 fundamentals to building, testing, containerizing, deploying, and defending production-style Spring Boot 3 & Microservices backend applications across 24 structured weekly modules, 6 mandatory projects, and 120+ DSA problems.
👨💻 100% Live Working Pro Mentorship
Sat–Sun (2h/Day • 7 AM–8 PM IST) + HD Recordings
🚀 Real GitHub + Live Client Sprint
24 Module Repos + Java Backend Developer – Industry-...
🧠 Coding, Mocks & Spoken AI Viva
LeetCode/HackerRank (Java 21 LTS & PostgreSQL SQL) + ∞ Mocks & AI
🛡️ 6-Mo Placement or 100% Refund*
100+ IT Openings + OA Coaching or Net Tuition Back*
⚡ 3 × ₹5,000 (0% Installments)
Pay ₹15,000 One-Time or in 3 Easy 0% Installments of ₹5,000 (Incl. 18% GST — No NBFC Loan or Salary Cut)
👨💻 Trainers: 100% Active Working IT Professionals
⏱️ Duration: 24 Weeks (6 Months) • Beginner to Job-Ready (600h Guided Mastery)
📅 Batch Available: Weekend Only (Sat–Sun) • 2 Hours / Day • 7:00 AM – 8:00 PM IST (choose any slot based on trainer availability)
💻 LeetCode & HackerRank: Trainer problem-solving support (Java 21 LTS & PostgreSQL SQL).
🛡️ Get Placement or 100% Fees Refund*: 100+ IT Openings + Trainer Online AI Assessment (OA) Support in 6 Mo.
Our counselor shares live demo link & issues your Student Portal ID to track every topic transparently.
Attend Sat–Sun (2h/day) live sessions with Working IT Professionals (≥85% attendance) and ship 100% original GitHub repositories.
Clear ≥90% in every Topic Mock Test & Spoken MockAttempt AI Interview with unlimited free re-attempts whenever below 90%.
Get 100+ curated IT openings in 6 months + trainer coaching for employer Online AI Assessments (OA) — or 100% net tuition refund*.
🔍 Transparent Distinction: Unconditional Career Support vs. Conditional 6-Month 100% Net Tuition Refund* ($318 )
1. Placement & Career Support (Every Graduate): All graduates receive ATS resume engineering, GitHub portfolio verification, mock technical/HR interviews, and ongoing access to curated hiring drives. 2. 6-Month 100% Net Tuition Fee Refund* Covenant: Activated when you complete (a) ≥85% live weekend attendance, (b) 100% original GitHub module repos & Live Client Project, (c) ≥90% in all 439 Topic Mocks & 439 Spoken AI Interviews (unlimited free retries included), and (d) apply to ≥95% of our 100+ curated IT openings & attend 100% of scheduled interviews within 180 days of graduation. Read our full Placement Guarantee Policy & Fee Refund Policy.
Every month concludes with measurable coding competency, a portfolio repository deliverable, and continuous DSA progression.
Java syntax, JDK 21 architecture, programming fundamentals, control structures, arrays, object-oriented programming (OOP), strings, exception handling, packages, enums, Git basics, and clean Java coding conventions.
Outcome: Write structured, modular Java 21 programs and apply object-oriented programming principles cleanly.
Deliverable: Mini-Project 1: Student Management Console Application built with Core Java, OOP, packages, input validation, and custom exception handling.
DSA Focus: Basic programming logic, mathematical reasoning, pattern logic, and 1D/2D array manipulation.
Java Collections Framework internals, Generics, Java 8–21 functional programming & Stream API, JVM memory/GC internals, multithreading & concurrency, Data Structures & Algorithms foundation, and collaborative Git/GitHub workflows.
Outcome: Solve algorithmic coding problems and build concurrent, collection-driven Java applications managed with Git branches and pull requests.
Deliverable: Mini-Project 2: Employee Management Application with GitHub repository, meaningful commit history, and 35–45 completed DSA exercises.
DSA Focus: Complexity analysis, Big O, two pointers, sliding window, prefix sum, searching, sorting, recursion, backtracking, linked lists, stacks, queues, and hashing.
Relational database architecture, PostgreSQL & MySQL fundamentals, SQL queries, joins, subqueries, normalization, indexing, ACID transactions, window functions, CTEs, JDBC connectivity, DAO pattern, JPA specification, and Hibernate ORM.
Outcome: Design normalized relational schemas, write optimized SQL queries, connect Java applications via JDBC, and implement persistence with JPA/Hibernate.
Deliverable: Mini-Project 3: Database-Driven Employee Management System with PostgreSQL constraints, department relationships, pagination, sorting, and Hibernate/JPA.
DSA Focus: Linked list pointer manipulation, monotonic stacks, circular queues/deques, and HashMap/HashSet lookup problems.
Spring Core, IoC, Dependency Injection, bean lifecycle, AOP, Spring Boot 3 auto-configuration, layered REST API engineering, DTOs, Bean Validation, global exception handling, Spring Data JPA, transactions, Spring Security filter chain, and stateless JWT authentication.
Outcome: Develop, validate, document, and secure database-backed production-style Spring Boot 3 REST APIs.
Deliverable: Major Project 4: Secure E-Commerce Backend REST API with JWT authentication, RBAC, PostgreSQL persistence, validation, Swagger/OpenAPI docs, and pagination.
DSA Focus: Recursion trees, backtracking combinations, binary trees, binary search trees (BST), tree traversals, and interview problem patterns.
Monolith vs Microservices decomposition, Bounded Contexts, OpenFeign/WebClient, Spring Cloud, Netflix Eureka service discovery, Spring Cloud Gateway, Resilience4j circuit breakers, Saga pattern, Apache Kafka event streaming, Outbox pattern, MongoDB fundamentals, and Redis caching/rate limiting.
Outcome: Design service boundaries and build resilient, event-driven distributed backend microservices.
Deliverable: Major Project 5: Distributed E-Commerce Microservices Application (User, Product, Order, Inventory, Payment & Notification services with Eureka, Gateway, Kafka, Redis & PostgreSQL).
DSA Focus: Heaps/priority queues, graph representations, BFS/DFS, greedy algorithms, and dynamic programming (memoization & tabulation) fundamentals.
JUnit 5, Mockito, MockMvc, DataJpaTest, Testcontainers integration testing, Linux CLI & process basics, Dockerfiles, Docker Compose multi-service stacks, GitHub Actions CI/CD pipelines, full-stack DSA & Java/SQL/Spring/Microservices interview revision, and the Final Industry Capstone.
Outcome: Test, containerize, automate, deploy, demonstrate, and confidently explain a portfolio-ready distributed Java backend system in technical interviews.
Deliverable: Final Industry Capstone: Job Portal Backend System with complete source code, ER diagram, OpenAPI docs, Postman collection, JUnit/Mockito suite, and Docker Compose deployment.
DSA Focus: Bit manipulation, mixed timed coding assessments, answer-space binary search, DP revision, and complexity walkthroughs for technical interviews.
Practised continuously from Month 1 to Month 6 (Easy → Medium → Selected Hard) with constraints, sample I/O, Big-O analysis, and Java 21 reference solutions inside the Student Coding Lab.
Complexity
6 Problems • M1
Arrays
6 Problems • M1
Strings
6 Problems • M1
Hashing
6 Problems • M2
Two Pointers
6 Problems • M2
Sliding Window
6 Problems • M2
Prefix Sum
6 Problems • M2
Searching
6 Problems • M2
Sorting
6 Problems • M2
Recursion
6 Problems • M2
Backtracking
6 Problems • M2
Linked List
6 Problems • M3
Stack
6 Problems • M3
Queue
6 Problems • M3
Trees
6 Problems • M4
Heap
6 Problems • M5
Graphs
6 Problems • M5
Greedy
6 Problems • M5
Dynamic Programming
6 Problems • M5
Bit Manipulation
6 Problems • M1
Published transparently so students compare scope honestly before enrolling:
Every module and topic lists its exact technical subtopics, hands-on code labs, Mock Tests, MockAttempt AI interviews, and explicit What Topic Is Next → progression so enrolled students and trainers always stay synchronized from Day 1 to Expert mastery.
Engineered to take a learner from Day-1 scratch to Senior/Production-ready expertise across 600 guided hours (~₹25/hr), 24 real GitHub repositories, ≥90% Mock + AI Viva gates, and 100+ curated IT job openings in 6 months (or 100% net tuition refund*).
Month 1 – Core Java Fundamentals (Weeks 1–4)
Month 2 – Advanced Core Java, DSA and Git (Weeks 5–8)
Month 3 – Database, SQL, JDBC and Hibernate (Weeks 9–12)
Month 4 – Spring Framework and Spring Boot (Weeks 13–16)
Month 5 – Microservices and Industry Backend Engineering (Weeks 17–20)
Month 6 – Testing, Deployment, Capstone and Placement Preparation (Weeks 21–24)
Module Learning & Hands-On Objectives
History, features, platform independence, enterprise applications, and the modern Java 21 LTS ecosystem
1.1 Introduction to Java (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Introduction to Java (Core Java 21) covers History, features, platform independence, enterprise applications, and the modern Java 21 LTS ecosystem. It is required in backend engineering to Selecting Java 21 LTS for high-throughput banking, e-commerce, and enterprise backend microservices. Under the hood, understandin...
Introduction to Java — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Introduction to Java': Document 5 real-world backend domains using Java 21 LTS and inspect installed runtime properties via System.getProperti...
Introduction to Java — Hands-On Coding Exercise
public class PlatformInfo {
public static void main(String[] args) {
System.out.println("Java Version: " + Runtime.version());
System.out.println("OS Architecture: " + System.getProperty("os.name") + " / " + System.getProperty("os.arch"));
}
}
JDK, JRE, JVM components, Write Once Run Anywhere (WORA), bytecode verifier, and runtime execution flow
1.2 Java Architecture (JDK, JRE and JVM) (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Java Architecture (JDK, JRE and JVM) (Core Java 21) covers JDK, JRE, JVM components, Write Once Run Anywhere (WORA), bytecode verifier, and runtime execution flow. It is required in backend engineering to Choosing minimal JRE/jlink container base images for production Docker deployments vs full JDK im...
Java Architecture (JDK, JRE and JVM) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Java Architecture (JDK, JRE and JVM)': Inspect JDK bin tools (`javac`, `java`, `javap`, `jar`, `jps`) and trace how each participates in build...
Java Architecture (JDK, JRE and JVM) — Hands-On Coding Exercise
// Terminal inspection:
// javac App.java -> Compiler inside JDK produces App.class bytecode
// javap -c App.class -> Disassembles JVM instructions
// java App -> JVM loads, verifies, and executes bytecode
JDK 21 LTS installation, JAVA_HOME configuration, OS PATH setup, IntelliJ IDEA & Maven workspace verification
1.3 Java Installation and Environment Setup (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Java Installation and Environment Setup (Core Java 21) covers JDK 21 LTS installation, JAVA_HOME configuration, OS PATH setup, IntelliJ IDEA & Maven workspace verification. It is required in backend engineering to Standardizing developer and CI runner environments on Java 21 LTS so Maven builds...
Java Installation and Environment Setup — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Java Installation and Environment Setup': Configure JAVA_HOME and PATH for JDK 21 LTS, initialize a Maven project in IntelliJ IDEA, and verify...
Java Installation and Environment Setup — Hands-On Coding Exercise
public class EnvCheck {
public static void main(String[] args) {
String javaHome = System.getenv("JAVA_HOME");
System.out.println("Configured JAVA_HOME = " + javaHome);
System.out.println("Runtime Specification = " + System.getProperty("java.specification.version"));
}
}
Class declaration, public static void main(String[] args) signature, System.out printing, CLI arguments, compilation and execution
1.4 First Java Program (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works First Java Program (Core Java 21) covers Class declaration, public static void main(String[] args) signature, System.out printing, CLI arguments, compilation and execution. It is required in backend engineering to Bootstrapping command-line utilities, batch jobs, and Spring Boot entry-point classes cleanly. Under the h...
First Java Program — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'First Java Program': Print formatted student profile details (roll number, name, branch, target role) accepting optional CLI arguments. Includ...
First Java Program — Hands-On Coding Exercise
public class StudentCard {
public static void main(String[] args) {
String name = args.length > 0 ? args[0] : "Aarav Sharma";
System.out.printf("Student: %s | Track: Java 21 Backend%n", name);
}
}
Source code (.java), javac compiler checks, bytecode (.class), class loader verification, interpreter and JIT execution
1.5 Java Compilation and Bytecode Execution (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Java Compilation and Bytecode Execution (Core Java 21) covers Source code (.java), javac compiler checks, bytecode (.class), class loader verification, interpreter and JIT execution. It is required in backend engineering to Diagnosing NoClassDefFoundError vs ClassNotFoundException and inspecting co...
Java Compilation and Bytecode Execution — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Java Compilation and Bytecode Execution': Compile a packaged Java class from terminal using `-d out`, inspect bytecode with `javap -c`, and ru...
Java Compilation and Bytecode Execution — Hands-On Coding Exercise
package com.mockattempt.week1;
public class BytecodeDemo {
public static int square(int value) {
return value * value;
}
public static void main(String[] args) {
System.out.println(square(12));
}
}
Local variables, instance fields, static class variables, variable scope, lifetime, and definite assignment rules
1.6 Variables in Java (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Variables in Java (Core Java 21) covers Local variables, instance fields, static class variables, variable scope, lifetime, and definite assignment rules. It is required in backend engineering to Preventing shared-state bugs in backend services by keeping request data in method-local variables rather than mutable static...
Variables in Java — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Variables in Java': Build an Employee Salary Calculator using local calculation variables, instance attributes, and a static company PF rate c...
Variables in Java — Hands-On Coding Exercise
public class SalarySlip {
private static final double PF_RATE = 0.12;
private final String employeeName;
private final double basicPay;
public SalarySlip(String employeeName, double basicPay) {
this.employeeName = employeeName;
this.basicPay = basicPay;
}
public double netPay(double hra) {
double pfDeduction = basicPay * PF_RATE;
return (basicPay + hra) - pfDeduction;
}
}
8 primitive types (byte, short, int, long, float, double, char, boolean), memory sizes, ranges, literals, and reference types
1.7 Data Types in Java (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Data Types in Java (Core Java 21) covers 8 primitive types (byte, short, int, long, float, double, char, boolean), memory sizes, ranges, literals, and reference types. It is required in backend engineering to Choosing `long` for database primary keys and epoch timestamps, and `BigDecimal` over `double` for exact moneta...
Data Types in Java — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Data Types in Java': Calculate Simple Interest and Compound Interest comparing `double` vs `BigDecimal` precision across multi-year tenures. I...
Data Types in Java — Hands-On Coding Exercise
import java.math.BigDecimal;
import java.math.RoundingMode;
public class InterestCalculator {
public static BigDecimal simpleInterest(BigDecimal principal, BigDecimal ratePct, int years) {
return principal.multiply(ratePct)
.multiply(BigDecimal.valueOf(years))
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP);
}
}
Implicit widening conversion, explicit narrowing cast, numeric promotion in expressions, truncation, and overflow risks
1.8 Type Conversion and Casting (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Type Conversion and Casting (Core Java 21) covers Implicit widening conversion, explicit narrowing cast, numeric promotion in expressions, truncation, and overflow risks. It is required in backend engineering to Safely converting external API payload numbers, percentages, and pagination counts without silent d...
Type Conversion and Casting — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Type Conversion and Casting': Build bidirectional Celsius/Fahrenheit/Kelvin temperature converters demonstrating explicit floating-point promo...
Type Conversion and Casting — Hands-On Coding Exercise
public class TemperatureConverter {
public static double celsiusToFahrenheit(int celsius) {
return ((double) celsius * 9 / 5) + 32.0;
}
public static int roundedCelsius(double fahrenheit) {
return (int) Math.round((fahrenheit - 32.0) * 5 / 9);
}
}
Arithmetic, relational, short-circuit logical, assignment, unary increment/decrement, bitwise, shift, and ternary operators
1.9 Operators in Java (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Operators in Java (Core Java 21) covers Arithmetic, relational, short-circuit logical, assignment, unary increment/decrement, bitwise, shift, and ternary operators. It is required in backend engineering to Writing guard expressions with short-circuit `&&`/`||`, checking parity/flags, and evaluating concise condi...
Operators in Java — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Operators in Java': Check even/odd numbers using both modulo (`%`) and bitwise (`& 1`), and compute shape areas (circle, rectangle, triangle)....
Operators in Java — Hands-On Coding Exercise
public class NumberAndShapeOps {
public static boolean isEven(int number) {
return (number & 1) == 0;
}
public static double circleArea(double radius) {
return radius > 0 ? Math.PI * radius * radius : 0.0;
}
}
java.util.Scanner token parsing, newline buffer pitfalls, InputStreamReader + BufferedReader fast line reading, and input validation
1.10 User Input (Scanner and BufferedReader) (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works User Input (Scanner and BufferedReader) (Core Java 21) covers java.util.Scanner token parsing, newline buffer pitfalls, InputStreamReader + BufferedReader fast line reading, and input validation. It is required in backend engineering to Reading interactive CLI inputs in console tools and parsing l...
User Input (Scanner and BufferedReader) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'User Input (Scanner and BufferedReader)': Build an interactive CLI Basic Calculator reading operands and operators safely with invalid-number...
User Input (Scanner and BufferedReader) — Hands-On Coding Exercise
import java.util.Scanner;
public class ConsoleInputDemo {
public static void main(String[] args) {
try (Scanner sc = new Scanner(System.in)) {
int rollNo = Integer.parseInt(sc.nextLine().trim());
String fullName = sc.nextLine().trim();
System.out.printf("Registered #%d: %s%n", rollNo, fullName);
}
}
}
Single-line (//), multi-line (/* */), Javadoc (/** */) tags (@param, @return, @throws), and avoiding noisy redundant comments
1.11 Comments and Javadoc Documentation (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Comments and Javadoc Documentation (Core Java 21) covers Single-line (//), multi-line (/* */), Javadoc (/** */) tags (@param, @return, @throws), and avoiding noisy redundant comments. It is required in backend engineering to Documenting public service contracts and utility APIs so IDE tooltips and Mave...
Comments and Javadoc Documentation — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Comments and Javadoc Documentation': Add concise Javadoc contracts to the shape-area and interest-calculation utility methods and generate HTM...
Comments and Javadoc Documentation — Hands-On Coding Exercise
/**
* Computes compound total for annual compounding.
*
* @param principal positive starting amount
* @param annualRate percentage rate (e.g. 8.5)
* @param years investment duration in years
* @return maturity amount
*/
public static double compoundAmount(double principal, double annualRate, int years) {
return principal * Math.pow(1 + (annualRate / 100.0), years);
}
PascalCase classes, camelCase methods/variables, UPPER_SNAKE_CASE constants, package naming, indentation, and small single-purpose methods
1.12 Java Coding Conventions and Clean Code Basics (Week 1 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Java Coding Conventions and Clean Code Basics (Core Java 21) covers PascalCase classes, camelCase methods/variables, UPPER_SNAKE_CASE constants, package naming, indentation, and small single-purpose methods. It is required in backend engineering to Passing automated Checkstyle/SonarQube pull...
Java Coding Conventions and Clean Code Basics — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Java Coding Conventions and Clean Code Basics': Refactor a messy 80-line calculator script into clean, well-named helper methods following sta...
Java Coding Conventions and Clean Code Basics — Hands-On Coding Exercise
package com.mockattempt.finance;
public final class TaxCalculator {
public static final double GST_PERCENTAGE = 18.0;
private TaxCalculator() {}
public static double calculateInclusiveTax(double totalAmount) {
return totalAmount - (totalAmount / (1 + GST_PERCENTAGE / 100.0));
}
}
Initializing local Git repo, configuring user.name/user.email, .gitignore for Java/Maven/IntelliJ, staging, committing, and pushing Week 1 labs
1.13 Week 1 Git Setup and Daily Commit Discipline (Week 1 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Week 1 Git Setup and Daily Commit Discipline (Git & GitHub) covers Initializing local Git repo, configuring user.name/user.email, .gitignore for Java/Maven/IntelliJ, staging, committing, and pushing Week 1 labs. It is required in backend engineering to Maintaining a verifiable public...
Week 1 Git Setup and Daily Commit Discipline — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Week 1 Git Setup and Daily Commit Discipline': Initialize `java-backend-journey` Git repository with a clean `.gitignore` and push all 7 Week...
Week 1 Git Setup and Daily Commit Discipline — Hands-On Coding Exercise
# .gitignore for Java 21 + Maven + IntelliJ
target/
*.class
*.jar
.idea/
*.iml
.DS_Store
Build a cleanly packaged Java 21 command-line utility suite combining Student Profile Printer, Simple/Compound Interest Calculator, Employee Net Salary Slip, Temperature Converter, and Shape Area Calculator with Scanner input validation.
Module Learning & Hands-On Objectives
if, if-else, nested if, else-if ladder, guard clauses, and boolean expression simplification
2.1 Conditional Statements (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Conditional Statements (Core Java 21) covers if, if-else, nested if, else-if ladder, guard clauses, and boolean expression simplification. It is required in backend engineering to Validating API request business rules such as credit eligibility, tax slabs, and order discount tiers cleanly. Under the hood, understan...
Conditional Statements — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Conditional Statements': Implement a progressive income-tax and scholarship-grade evaluator using guard clauses for invalid inputs. Include cl...
Conditional Statements — Hands-On Coding Exercise
public static String evaluateGrade(int score) {
if (score < 0 || score > 100) {
throw new IllegalArgumentException("Score must be between 0 and 100");
}
if (score >= 90) return "A+";
if (score >= 75) return "A";
if (score >= 60) return "B";
return "Needs Improvement";
}
Traditional switch-case fallthrough vs modern Java 14–21 arrow switch expressions (`->`), `yield`, and exhaustiveness
2.2 Switch Statements and Switch Expressions (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Switch Statements and Switch Expressions (Core Java 21) covers Traditional switch-case fallthrough vs modern Java 14–21 arrow switch expressions (`->`), `yield`, and exhaustiveness. It is required in backend engineering to Mapping payment statuses, HTTP codes, and order states cleanly without a...
Switch Statements and Switch Expressions — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Switch Statements and Switch Expressions': Build a multi-operation CLI calculator and day-type classifier using Java 21 switch expressions. In...
Switch Statements and Switch Expressions — Hands-On Coding Exercise
public static double compute(double a, double b, String op) {
return switch (op) {
case "+" -> a + b;
case "-" -> a - b;
case "*" -> a * b;
case "/" -> {
if (b == 0) throw new ArithmeticException("Division by zero");
yield a / b;
}
default -> throw new IllegalArgumentException("Unsupported operator: " + op);
};
}
Deterministic `for` loops, condition-driven `while` loops, menu-driven `do-while` loops, and infinite-loop prevention
2.3 Loops (for, while, do-while) (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Loops (for, while, do-while) (Core Java 21) covers Deterministic `for` loops, condition-driven `while` loops, menu-driven `do-while` loops, and infinite-loop prevention. It is required in backend engineering to Paginating batch database records, retrying transient operations with bounded counters, and running...
Loops (for, while, do-while) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Loops (for, while, do-while)': Write digit-reversal, prime checking, Fibonacci generation, and menu-driven console loops. Include clear method...
Loops (for, while, do-while) — Hands-On Coding Exercise
public static int reverseDigits(int num) {
int sign = num < 0 ? -1 : 1;
int current = Math.abs(num);
int reversed = 0;
while (current > 0) {
reversed = reversed * 10 + (current % 10);
current /= 10;
}
return reversed * sign;
}
Early exit with `break`, skipping iterations with `continue`, labeled breaks, and nested loop complexity awareness
2.4 Loop Control (break, continue and Nested Loops) (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Loop Control (break, continue and Nested Loops) (Core Java 21) covers Early exit with `break`, skipping iterations with `continue`, labeled breaks, and nested loop complexity awareness. It is required in backend engineering to Short-circuiting search loops immediately once a matching record...
Loop Control (break, continue and Nested Loops) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Loop Control (break, continue and Nested Loops)': Search a 2D grid with early exit and skip invalid negative entries while aggregating valid t...
Loop Control (break, continue and Nested Loops) — Hands-On Coding Exercise
public static int sumValidTransactions(int[] amounts) {
int sum = 0;
for (int amount : amounts) {
if (amount <= 0) {
continue;
}
sum += amount;
}
return sum;
}
Row-column coordinate mapping, pyramid/diamond star patterns, Floyd’s number triangle, and character matrices
2.5 Patterns (Star, Number and Character Patterns) (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Patterns (Star, Number and Character Patterns) (Core Java 21) covers Row-column coordinate mapping, pyramid/diamond star patterns, Floyd’s number triangle, and character matrices. It is required in backend engineering to Developing rock-solid mental dry-running of nested loop invariants, bou...
Patterns (Star, Number and Character Patterns) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Patterns (Star, Number and Character Patterns)': Generate pyramid stars, hollow squares, Pascal/Floyd number triangles, and alphabetic diamond...
Patterns (Star, Number and Character Patterns) — Hands-On Coding Exercise
public static String numberTriangle(int rows) {
StringBuilder sb = new StringBuilder();
int counter = 1;
for (int r = 1; r <= rows; r++) {
for (int c = 1; c <= r; c++) {
sb.append(counter++).append(' ');
}
sb.append(System.lineSeparator());
}
return sb.toString();
}
Contiguous heap allocation, zero/default initialization, `.length` property, static vs dynamic array literals, and index bounds
2.6 Arrays Introduction, Declaration and Initialization (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Arrays Introduction, Declaration and Initialization (Core Java 21) covers Contiguous heap allocation, zero/default initialization, `.length` property, static vs dynamic array literals, and index bounds. It is required in backend engineering to Storing fixed-size lookup tables, byte buff...
Arrays Introduction, Declaration and Initialization — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Arrays Introduction, Declaration and Initialization': Initialize arrays dynamically, find minimum and maximum elements in a single pass, and h...
Arrays Introduction, Declaration and Initialization — Hands-On Coding Exercise
public static int[] minAndMax(int[] nums) {
if (nums == null || nums.length == 0) {
throw new IllegalArgumentException("Array must not be empty");
}
int min = nums[0], max = nums[0];
for (int i = 1; i < nums.length; i++) {
if (nums[i] < min) min = nums[i];
if (nums[i] > max) max = nums[i];
}
return new int[]{min, max};
}
Forward/backward traversal, shifting elements for insertion and deletion, linear search, and in-place reversal
2.7 Array Operations (Traversal, Insertion, Deletion and Searching) (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Array Operations (Traversal, Insertion, Deletion and Searching) (Core Java 21) covers Forward/backward traversal, shifting elements for insertion and deletion, linear search, and in-place reversal. It is required in backend engineering to Understanding why `ArrayList` insert...
Array Operations (Traversal, Insertion, Deletion and Searching) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Array Operations (Traversal, Insertion, Deletion and Searching)': Reverse an array in-place using two indices, insert/delete at index `k`, and...
Array Operations (Traversal, Insertion, Deletion and Searching) — Hands-On Coding Exercise
public static void reverseInPlace(int[] arr) {
int left = 0, right = arr.length - 1;
while (left < right) {
int temp = arr[left];
arr[left++] = arr[right];
arr[right--] = temp;
}
}
Finding second-largest element, counting frequencies, finding duplicates, removing duplicates from sorted arrays, and rotation
2.8 One-Dimensional Arrays Manipulation (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works One-Dimensional Arrays Manipulation (Core Java 21) covers Finding second-largest element, counting frequencies, finding duplicates, removing duplicates from sorted arrays, and rotation. It is required in backend engineering to Solving frequent OA screening problems and implementing in-memory analytics...
One-Dimensional Arrays Manipulation — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'One-Dimensional Arrays Manipulation': Find the second-largest distinct element, count element frequencies, and remove duplicates in-place. Inc...
One-Dimensional Arrays Manipulation — Hands-On Coding Exercise
public static int secondLargest(int[] nums) {
int first = Integer.MIN_VALUE, second = Integer.MIN_VALUE;
for (int n : nums) {
if (n > first) {
second = first;
first = n;
} else if (n > second && n != first) {
second = n;
}
}
return second;
}
2D rectangular arrays, jagged arrays (arrays of arrays), row-major memory layout, and nested traversal
2.9 Multidimensional Arrays (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Multidimensional Arrays (Core Java 21) covers 2D rectangular arrays, jagged arrays (arrays of arrays), row-major memory layout, and nested traversal. It is required in backend engineering to Representing seating charts, tabular exports, dynamic programming tables, and adjacency matrices. Under the hood, understand...
Multidimensional Arrays — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Multidimensional Arrays': Compute row-wise sums, column-wise sums, and primary/secondary diagonal totals for rectangular and jagged 2D arrays....
Multidimensional Arrays — Hands-On Coding Exercise
public static int diagonalSum(int[][] square) {
int n = square.length, total = 0;
for (int i = 0; i < n; i++) {
total += square[i][i];
if (i != n - 1 - i) {
total += square[i][n - 1 - i];
}
}
return total;
}
Dimension compatibility validation, matrix addition/subtraction, in-place/out-of-place transpose, and `O(m*n*p)` multiplication
2.10 Matrix Operations (Addition, Subtraction, Transpose and Multiplication) (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Matrix Operations (Addition, Subtraction, Transpose and Multiplication) (Core Java 21) covers Dimension compatibility validation, matrix addition/subtraction, in-place/out-of-place transpose, and `O(m*n*p)` multiplication. It is required in backend engineering to Im...
Matrix Operations (Addition, Subtraction, Transpose and Multiplication) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Matrix Operations (Addition, Subtraction, Transpose and Multiplication)': Implement validated matrix addition, transpose, and matrix multiplic...
Matrix Operations (Addition, Subtraction, Transpose and Multiplication) — Hands-On Coding Exercise
public static int[][] multiply(int[][] a, int[][] b) {
if (a[0].length != b.length) {
throw new IllegalArgumentException("Incompatible matrix dimensions");
}
int[][] res = new int[a.length][b[0].length];
for (int i = 0; i < a.length; i++) {
for (int k = 0; k < b.length; k++) {
for (int j = 0; j < b[0].length; j++) {
res[i][j] += a[i][k] * b[k][j];
}
}
}
return res;
}
Read-only iteration syntax, readability advantages, when index-based `for` is required instead, and nested for-each over 2D arrays
2.11 Enhanced For Loop (For-Each) (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Enhanced For Loop (For-Each) (Core Java 21) covers Read-only iteration syntax, readability advantages, when index-based `for` is required instead, and nested for-each over 2D arrays. It is required in backend engineering to Writing concise, bug-free read-only aggregation loops over arrays and collections in...
Enhanced For Loop (For-Each) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Enhanced For Loop (For-Each)': Compare enhanced for-loop read aggregations against indexed mutation loops across 1D and 2D datasets. Include c...
Enhanced For Loop (For-Each) — Hands-On Coding Exercise
public static double averageScore(int[] scores) {
if (scores.length == 0) return 0.0;
long sum = 0;
for (int score : scores) {
sum += score;
}
return (double) sum / scores.length;
}
Arrays.sort, Arrays.binarySearch, Arrays.copyOf, Arrays.copyOfRange, Arrays.fill, Arrays.equals, Arrays.deepToString
2.12 Array Utilities (java.util.Arrays) (Week 2 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Array Utilities (java.util.Arrays) (Core Java 21) covers Arrays.sort, Arrays.binarySearch, Arrays.copyOf, Arrays.copyOfRange, Arrays.fill, Arrays.equals, Arrays.deepToString. It is required in backend engineering to Defensive array copying, fast Dual-Pivot Quicksort/TimSort sorting, and clean debug log...
Array Utilities (java.util.Arrays) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Array Utilities (java.util.Arrays)': Sort an array, search elements with `Arrays.binarySearch`, clone subranges with `copyOfRange`, and format...
Array Utilities (java.util.Arrays) — Hands-On Coding Exercise
import java.util.Arrays;
public class ArrayUtilsDemo {
public static int[] sortedCopy(int[] input) {
int[] copy = Arrays.copyOf(input, input.length);
Arrays.sort(copy);
return copy;
}
}
Build an interactive Java 21 array and matrix workbench supporting min/max, in-place reversal, duplicate removal, second-largest finder, frequency counter, missing-number solver, and validated 2D matrix transpose/multiplication.
Module Learning & Hands-On Objectives
Class blueprint definition, heap object instantiation with `new`, stack object references, null references, and object state vs behavior
3.1 Class and Object (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Class and Object (Java OOP) covers Class blueprint definition, heap object instantiation with `new`, stack object references, null references, and object state vs behavior. It is required in backend engineering to Modeling domain entities (`Student`, `BankAccount`, `Order`) with cohesive state and domain methods. Under the h...
Class and Object — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Class and Object': Build a Student Management domain model instantiating and managing multiple Student objects. Include clear method/schema naming...
Class and Object — Hands-On Coding Exercise
public class Student {
private final int id;
private final String name;
public Student(int id, String name) {
this.id = id;
this.name = name;
}
}
Method signatures, parameter passing (pass-by-value of primitives and object references), return types, varargs, and stack frames
3.2 Methods in Java (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Methods in Java (Java OOP) covers Method signatures, parameter passing (pass-by-value of primitives and object references), return types, varargs, and stack frames. It is required in backend engineering to Decomposing complex business workflows into small, testable, intention-revealing domain methods. Under the hood, understa...
Methods in Java — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Methods in Java': Implement deposit, withdraw, and transfer methods on a `BankAccount` class with balance validation. Include clear method/schema...
Methods in Java — Hands-On Coding Exercise
public void transferTo(BankAccount target, double amount) {
if (target == null || amount <= 0 || amount > this.balance) {
throw new IllegalArgumentException("Invalid transfer request");
}
this.balance -= amount;
target.balance += amount;
}
Default compiler constructor, parameterized constructors, constructor overloading, and invariant validation during construction
3.3 Constructors and Constructor Overloading (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Constructors and Constructor Overloading (Java OOP) covers Default compiler constructor, parameterized constructors, constructor overloading, and invariant validation during construction. It is required in backend engineering to Guaranteeing domain objects and Spring beans are always created in a vali...
Constructors and Constructor Overloading — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Constructors and Constructor Overloading': Create overloaded constructors for `Employee` supporting full-time and probation onboarding defaults. I...
Constructors and Constructor Overloading — Hands-On Coding Exercise
public class Employee {
private final long id;
private final String name;
private final String department;
public Employee(long id, String name) {
this(id, name, "Engineering");
}
public Employee(long id, String name, String department) {
this.id = id;
this.name = name;
this.department = department;
}
}
Disambiguating shadowed fields, constructor chaining via `this(...)`, and passing/returning current instance in fluent APIs
3.4 this Keyword (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works this Keyword (Java OOP) covers Disambiguating shadowed fields, constructor chaining via `this(...)`, and passing/returning current instance in fluent APIs. It is required in backend engineering to Eliminating duplicate initialization logic across overloaded constructors and building fluent query/request builders. Under the hood,...
this Keyword — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'this Keyword': Eliminate duplicate validation across 3 overloaded `BankAccount` constructors using `this(...)` chaining. Include clear method/sche...
this Keyword — Hands-On Coding Exercise
public class OrderFilter {
private String status = "OPEN";
public OrderFilter withStatus(String status) {
this.status = status;
return this;
}
}
Static fields, static utility methods, static initialization blocks, class-level memory in Metaspace/Heap, and static imports
3.5 static Keyword (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works static Keyword (Java OOP) covers Static fields, static utility methods, static initialization blocks, class-level memory in Metaspace/Heap, and static imports. It is required in backend engineering to Defining immutable constants (`public static final`) and stateless factory/utility methods (`LocalDate.of`, `Collections.emptyL...
static Keyword — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'static Keyword': Track auto-incrementing account numbers safely and create stateless currency-formatting static helpers. Include clear method/sche...
static Keyword — Hands-On Coding Exercise
public class InvoiceIdGenerator {
private static long sequence = 1000L;
public static synchronized String nextInvoiceNumber() {
return "INV-" + (++sequence);
}
}
Private state, controlled getters/setters, invariant enforcement, defensive copying, and telling objects what to do instead of exposing internals
3.6 Encapsulation (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Encapsulation (Java OOP) covers Private state, controlled getters/setters, invariant enforcement, defensive copying, and telling objects what to do instead of exposing internals. It is required in backend engineering to Protecting sensitive account balances, credit limits, and order state transitions from arbitrary external mut...
Encapsulation — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Encapsulation': Encapsulate `BankAccount` and `EmployeeSalary` classes so invalid mutations throw descriptive exceptions. Include clear method/sch...
Encapsulation — Hands-On Coding Exercise
public class Wallet {
private double balance;
public double getBalance() {
return balance;
}
public void credit(double amount) {
if (amount <= 0) throw new IllegalArgumentException("Credit must be positive");
this.balance += amount;
}
}
IS-A relationship, `extends`, single, multilevel, and hierarchical inheritance, protected visibility, and why Java disallows multiple class inheritance
3.7 Inheritance (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Inheritance (Java OOP) covers IS-A relationship, `extends`, single, multilevel, and hierarchical inheritance, protected visibility, and why Java disallows multiple class inheritance. It is required in backend engineering to Sharing base auditing fields (`createdAt`, `updatedAt`) or common vehicle/employee traits across specialize...
Inheritance — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Inheritance': Model a `Vehicle` -> `MotorVehicle` -> `ElectricCar` / `DieselTruck` hierarchy with shared and specialized behavior. Include clear m...
Inheritance — Hands-On Coding Exercise
public abstract class Vehicle {
private final String registrationNo;
protected Vehicle(String registrationNo) {
this.registrationNo = registrationNo;
}
public String getRegistrationNo() { return registrationNo; }
}
Invoking parent constructors via `super(...)`, calling overridden parent methods via `super.method()`, and constructor execution order
3.8 super Keyword (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works super Keyword (Java OOP) covers Invoking parent constructors via `super(...)`, calling overridden parent methods via `super.method()`, and constructor execution order. It is required in backend engineering to Initializing immutable parent fields in custom exception classes and specialized domain subclasses. Under the hood, unde...
super Keyword — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'super Keyword': Build `FullTimeEmployee` and `ContractEmployee` subclasses delegating base payroll fields via `super(...)`. Include clear method/s...
super Keyword — Hands-On Coding Exercise
public class FullTimeEmployee extends BaseEmployee {
private final double annualBonus;
public FullTimeEmployee(long id, String name, double basePay, double annualBonus) {
super(id, name, basePay);
this.annualBonus = annualBonus;
}
}
Same method name with distinct parameter lists (arity, types, order), type promotion rules, and ambiguity errors
3.9 Method Overloading (Compile-Time Polymorphism) (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Method Overloading (Compile-Time Polymorphism) (Java OOP) covers Same method name with distinct parameter lists (arity, types, order), type promotion rules, and ambiguity errors. It is required in backend engineering to Providing ergonomic API entry points (`search(long id)`, `search(String emai...
Method Overloading (Compile-Time Polymorphism) — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Method Overloading (Compile-Time Polymorphism)': Create overloaded `calculateTax` and `findBook` methods in a Library Management domain service. I...
Method Overloading (Compile-Time Polymorphism) — Hands-On Coding Exercise
public class BookCatalog {
public Book find(String isbn) { /* lookup by ISBN */ return null; }
public List<Book> find(String author, int publishedAfterYear) { return List.of(); }
}
@Override annotation, covariant return types, access-level & checked-exception rules, and dynamic dispatch on the runtime object
3.10 Method Overriding (Runtime Polymorphism) (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Method Overriding (Runtime Polymorphism) (Java OOP) covers @Override annotation, covariant return types, access-level & checked-exception rules, and dynamic dispatch on the runtime object. It is required in backend engineering to Customizing `calculatePay()` or `calculateArea()` per subtype while...
Method Overriding (Runtime Polymorphism) — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Method Overriding (Runtime Polymorphism)': Override `area()` and `perimeter()` across `Circle`, `Rectangle`, and `Triangle` subtypes with `@Overri...
Method Overriding (Runtime Polymorphism) — Hands-On Coding Exercise
public class Circle extends Shape {
private final double radius;
public Circle(double radius) { this.radius = radius; }
@Override
public double area() {
return Math.PI * radius * radius;
}
}
Early binding (private, static, final methods and fields) vs late virtual method invocation, upcasting, and safe pattern-matching `instanceof`
3.11 Polymorphism (Static vs Dynamic Binding) (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Polymorphism (Static vs Dynamic Binding) (Java OOP) covers Early binding (private, static, final methods and fields) vs late virtual method invocation, upcasting, and safe pattern-matching `instanceof`. It is required in backend engineering to Processing heterogeneous collections of `Notification` or...
Polymorphism (Static vs Dynamic Binding) — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Polymorphism (Static vs Dynamic Binding)': Process a `Shape[]` and `Employee[]` batch polymorphically and inspect Java 21 pattern-matching `instan...
Polymorphism (Static vs Dynamic Binding) — Hands-On Coding Exercise
public static double totalArea(Shape[] shapes) {
double sum = 0;
for (Shape shape : shapes) {
sum += shape.area(); // Dynamic dispatch at runtime
}
return sum;
}
Abstract classes, abstract vs concrete template methods, protected constructors, and partial implementation sharing
3.12 Abstraction and Abstract Classes (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Abstraction and Abstract Classes (Java OOP) covers Abstract classes, abstract vs concrete template methods, protected constructors, and partial implementation sharing. It is required in backend engineering to Implementing the Template Method pattern (e.g., `AbstractReportExporter` handling headers/footers wh...
Abstraction and Abstract Classes — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Abstraction and Abstract Classes': Build an `AbstractLoanProcessor` template class with concrete `SavingsLoan` and `EducationLoan` implementations...
Abstraction and Abstract Classes — Hands-On Coding Exercise
public abstract class AbstractPaymentProcessor {
public final String execute(double amount) {
if (amount <= 0) throw new IllegalArgumentException("Invalid amount");
return chargeGateway(amount);
}
protected abstract String chargeGateway(double amount);
}
Pure capability contracts, `implements`, multiple interface inheritance, loose coupling, and programming to interfaces
3.13 Interfaces and Multiple Interface Implementation (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Interfaces and Multiple Interface Implementation (Java OOP) covers Pure capability contracts, `implements`, multiple interface inheritance, loose coupling, and programming to interfaces. It is required in backend engineering to Decoupling Spring Boot controllers from service implementations (...
Interfaces and Multiple Interface Implementation — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Interfaces and Multiple Interface Implementation': Implement `PaymentGateway` and `Refundable` interfaces across `UpiPayment`, `CardPayment`, and...
Interfaces and Multiple Interface Implementation — Hands-On Coding Exercise
public interface PaymentGateway {
String pay(String orderId, double amount);
}
public class UpiPaymentGateway implements PaymentGateway {
@Override
public String pay(String orderId, double amount) {
return "UPI-TXN-" + orderId;
}
}
Java 8+ `default` methods for backward-compatible evolution, `static` factory methods on interfaces, `private` helper methods, and diamond conflict resolution
3.14 Modern Interface Features (Default, Static and Private Methods) (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Modern Interface Features (Default, Static and Private Methods) (Java OOP) covers Java 8+ `default` methods for backward-compatible evolution, `static` factory methods on interfaces, `private` helper methods, and diamond conflict resolution. It is required in backend engineerin...
Modern Interface Features (Default, Static and Private Methods) — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Modern Interface Features (Default, Static and Private Methods)': Enhance a `LibrarySearchable` interface with `default` pagination helpers and `p...
Modern Interface Features (Default, Static and Private Methods) — Hands-On Coding Exercise
public interface Auditable {
String actor();
default String auditStamp() {
return sanitize(actor()) + "@" + java.time.Instant.now();
}
private String sanitize(String raw) {
return raw == null ? "SYSTEM" : raw.trim();
}
}
Blank final fields, immutable value objects, preventing method overriding (`final` methods), and non-extensible `final` classes
3.15 final Keyword (Variables, Methods and Classes) (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works final Keyword (Variables, Methods and Classes) (Java OOP) covers Blank final fields, immutable value objects, preventing method overriding (`final` methods), and non-extensible `final` classes. It is required in backend engineering to Designing thread-safe immutable DTOs, security tokens, and S...
final Keyword (Variables, Methods and Classes) — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'final Keyword (Variables, Methods and Classes)': Convert mutable `Money` and `LibraryMemberCard` classes into strictly immutable `final` classes....
final Keyword (Variables, Methods and Classes) — Hands-On Coding Exercise
public final class Money {
private final String currency;
private final long minorUnits;
public Money(String currency, long minorUnits) {
this.currency = currency;
this.minorUnits = minorUnits;
}
public Money add(Money other) {
return new Money(this.currency, this.minorUnits + other.minorUnits);
}
}
java.lang.Object root methods, readable `toString()`, reflexive/symmetric/transitive `equals()`, `Objects.hash()` contract, and `getClass()`
3.16 Object Class (toString, equals, hashCode and getClass) (Week 3 • Java OOP) 1. What It Is, Why It Is Required & How It Works Object Class (toString, equals, hashCode and getClass) (Java OOP) covers java.lang.Object root methods, readable `toString()`, reflexive/symmetric/transitive `equals()`, `Objects.hash()` contract, and `getClass()`. It is required in backend engineering to Ensuring domain entities and co...
Object Class (toString, equals, hashCode and getClass) — Practical Implementation Assignment
Complete and push your working Java OOP solution for 'Object Class (toString, equals, hashCode and getClass)': Implement contract-compliant `toString()`, `equals()`, and `hashCode()` on `Book` and `St...
Object Class (toString, equals, hashCode and getClass) — Hands-On Coding Exercise
import java.util.Objects;
public final class BookId {
private final String isbn;
public BookId(String isbn) { this.isbn = Objects.requireNonNull(isbn); }
@Override
public boolean equals(Object o) {
return (this == o) || (o instanceof BookId other && isbn.equals(other.isbn));
}
@Override
public int hashCode() { return Objects.hash(isbn); }
@Override
public String toString() { return "BookId[" + isbn + "]"; }
}
Design an extensible OOP library and banking core demonstrating inheritance, interfaces (`PaymentGateway`), abstract template classes, runtime polymorphism, `final` value objects, and contract-compliant `equals`/`hashCode`/`toString`.
Module Learning & Hands-On Objectives
String literal interning in Heap String Pool vs `new String()`, immutability benefits (security, caching, thread safety), and compact strings
4.1 String Immutability and String Pool (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works String Immutability and String Pool (Core Java 21) covers String literal interning in Heap String Pool vs `new String()`, immutability benefits (security, caching, thread safety), and compact strings. It is required in backend engineering to Understanding memory footprint and hash caching when millions...
String Immutability and String Pool — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'String Immutability and String Pool': Demonstrate literal pooling vs heap allocation and benchmark loop concatenation against `StringBuilder`....
String Immutability and String Pool — Hands-On Coding Exercise
String pooledA = "JBCP";
String pooledB = "JBCP";
String heapCopy = new String("JBCP");
System.out.println(pooledA == pooledB); // true (same pooled reference)
System.out.println(pooledA.equals(heapCopy)); // true (value equality)
Reference identity (`==`) vs content equality (`equals`), null-safe constant-first comparisons, `equalsIgnoreCase`, and lexicographical `compareTo`
4.2 String Comparison (==, equals, equalsIgnoreCase, compareTo) (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works String Comparison (==, equals, equalsIgnoreCase, compareTo) (Core Java 21) covers Reference identity (`==`) vs content equality (`equals`), null-safe constant-first comparisons, `equalsIgnoreCase`, and lexicographical `compareTo`. It is required in backend engineering to Validat...
String Comparison (==, equals, equalsIgnoreCase, compareTo) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'String Comparison (==, equals, equalsIgnoreCase, compareTo)': Write null-safe email normalization and case-insensitive role matching helpers....
String Comparison (==, equals, equalsIgnoreCase, compareTo) — Hands-On Coding Exercise
public static boolean isAdminRole(String role) {
return "ADMIN".equalsIgnoreCase(role != null ? role.trim() : null);
}
length, isBlank, strip, charAt, substring, indexOf, contains, replace, split, String.join, formatted
4.3 String Methods (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works String Methods (Core Java 21) covers length, isBlank, strip, charAt, substring, indexOf, contains, replace, split, String.join, formatted. It is required in backend engineering to Sanitizing form/API inputs, parsing CSV rows, masking PII phone/card numbers, and formatting notifications. Under the hood, understanding its ex...
String Methods — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'String Methods': Parse CSV student lines, mask mobile numbers (`******7917`), and normalize whitespace. Include clear method/schema naming, ed...
String Methods — Hands-On Coding Exercise
public static String maskPhone(String phone) {
String clean = phone == null ? "" : phone.strip();
if (clean.length() < 4) return "****";
return "*".repeat(clean.length() - 4) + clean.substring(clean.length() - 4);
}
Mutable character buffer, capacity growth (`old * 2 + 2`), append, insert, delete, reverse, and single-threaded performance
4.4 StringBuilder (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works StringBuilder (Core Java 21) covers Mutable character buffer, capacity growth (`old * 2 + 2`), append, insert, delete, reverse, and single-threaded performance. It is required in backend engineering to Constructing dynamic SQL clauses, CSV exports, and formatted console tables in `O(n)` time. Under the hood, understanding i...
StringBuilder — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'StringBuilder': Build an ASCII student grade-card table generator pre-sized with `new StringBuilder(256)`. Include clear method/schema naming,...
StringBuilder — Hands-On Coding Exercise
public static String buildCsvRow(int id, String name, double marks) {
return new StringBuilder(64)
.append(id).append(',')
.append(name).append(',')
.append(marks)
.toString();
}
Synchronized thread-safe mutable strings, comparison with StringBuilder and String, and legacy API interoperability
4.5 StringBuffer (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works StringBuffer (Core Java 21) covers Synchronized thread-safe mutable strings, comparison with StringBuilder and String, and legacy API interoperability. It is required in backend engineering to Knowing why `StringBuilder` is preferred in method-local code while recognizing `StringBuffer` in JDK regex/legacy APIs. Under the ho...
StringBuffer — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'StringBuffer': Compare `String`, `StringBuilder`, and `StringBuffer` APIs and thread-safety guarantees in a short benchmark lab. Include clear...
StringBuffer — Hands-On Coding Exercise
StringBuffer sharedLog = new StringBuffer();
sharedLog.append("[BOOT] Service initialized\n");
Byte, Short, Integer, Long, Float, Double, Character, Boolean, parsing methods (`parseInt`, `valueOf`), and Integer Cache (-128 to 127)
4.6 Wrapper Classes (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Wrapper Classes (Core Java 21) covers Byte, Short, Integer, Long, Float, Double, Character, Boolean, parsing methods (`parseInt`, `valueOf`), and Integer Cache (-128 to 127). It is required in backend engineering to Representing nullable database columns (`Integer managerId`) in JPA entities and generic collections (`List...
Wrapper Classes — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Wrapper Classes': Parse string numeric inputs safely with `Integer.parseInt` and demonstrate the `[-128, 127]` `Integer.valueOf` cache. Includ...
Wrapper Classes — Hands-On Coding Exercise
Integer a = Integer.valueOf(127), b = Integer.valueOf(127);
Integer x = Integer.valueOf(200), y = Integer.valueOf(200);
System.out.println(a == b); // true (cached)
System.out.println(x.equals(y)); // Always use .equals() -> true
Automatic compiler conversion between primitives and wrappers, hidden `NullPointerException` on unboxing, and loop allocation overhead
4.7 Autoboxing and Unboxing (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Autoboxing and Unboxing (Core Java 21) covers Automatic compiler conversion between primitives and wrappers, hidden `NullPointerException` on unboxing, and loop allocation overhead. It is required in backend engineering to Avoiding silent `NullPointerException` when unboxing nullable DTO/entity fields (`Boolean is...
Autoboxing and Unboxing — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Autoboxing and Unboxing': Fix NullPointerException and boxing performance bugs in a sample grade-aggregation service. Include clear method/sch...
Autoboxing and Unboxing — Hands-On Coding Exercise
public static int safeScore(Integer nullableScore) {
return nullableScore != null ? nullableScore : 0; // Safe unboxing
}
Throwable -> Error (OutOfMemoryError, StackOverflowError) vs Exception (Checked vs RuntimeException), call-stack unwinding
4.8 Exception Handling Hierarchy (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Exception Handling Hierarchy (Core Java 21) covers Throwable -> Error (OutOfMemoryError, StackOverflowError) vs Exception (Checked vs RuntimeException), call-stack unwinding. It is required in backend engineering to Designing predictable failure boundaries so bad user requests return clean errors without c...
Exception Handling Hierarchy — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Exception Handling Hierarchy': Map 10 common JDK exceptions (`NullPointerException`, `IllegalArgumentException`, `IOException`, `SQLException`...
Exception Handling Hierarchy — Hands-On Coding Exercise
// Throwable
// ├── Error (JVM-level: OutOfMemoryError, StackOverflowError)
// └── Exception
// ├── IOException, SQLException (Checked)
// └── RuntimeException -> NullPointerException, IllegalArgumentException (Unchecked)
Specific-to-general catch ordering, multi-catch (`catch (IOException | NumberFormatException e)`), preserving root cause, and meaningful error messages
4.9 try-catch Blocks (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works try-catch Blocks (Core Java 21) covers Specific-to-general catch ordering, multi-catch (`catch (IOException | NumberFormatException e)`), preserving root cause, and meaningful error messages. It is required in backend engineering to Translating low-level parsing or I/O failures into actionable user feedback or structured...
try-catch Blocks — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'try-catch Blocks': Wrap CLI menu parsing in specific multi-catch handlers that log context and keep the console loop alive. Include clear meth...
try-catch Blocks — Hands-On Coding Exercise
public static int parsePort(String raw) {
try {
return Integer.parseInt(raw.strip());
} catch (NumberFormatException ex) {
throw new IllegalArgumentException("Invalid port value: " + raw, ex);
}
}
Guaranteed execution of `finally`, `try-with-resources` (`AutoCloseable`), suppressed exceptions, and why `return` inside `finally` is dangerous
4.10 finally Block and Resource Cleanup (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works finally Block and Resource Cleanup (Core Java 21) covers Guaranteed execution of `finally`, `try-with-resources` (`AutoCloseable`), suppressed exceptions, and why `return` inside `finally` is dangerous. It is required in backend engineering to Preventing file-descriptor, socket, and database-connection...
finally Block and Resource Cleanup — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'finally Block and Resource Cleanup': Refactor manual `finally` stream cleanup to `try-with-resources` using a custom `AutoCloseable` resource....
finally Block and Resource Cleanup — Hands-On Coding Exercise
try (var reader = new java.io.BufferedReader(new java.io.StringReader("Java 21"))) {
System.out.println(reader.readLine());
}
Explicitly throwing exceptions with `throw`, declaring checked propagation via `throws`, and exception chaining (`new CustomEx(msg, cause)`)
4.11 throw and throws (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works throw and throws (Core Java 21) covers Explicitly throwing exceptions with `throw`, declaring checked propagation via `throws`, and exception chaining (`new CustomEx(msg, cause)`). It is required in backend engineering to Failing fast at service boundaries when preconditions fail while preserving the original stack trac...
throw and throws — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'throw and throws': Implement precondition validation in `StudentService` using `throw` and chained causes. Include clear method/schema naming,...
throw and throws — Hands-On Coding Exercise
public void validateMarks(double marks) {
if (marks < 0 || marks > 100) {
throw new IllegalArgumentException("Marks out of range [0..100]: " + marks);
}
}
Designing domain-specific exceptions (`StudentNotFoundException`, `DuplicateRollNumberException`), error codes, and constructors
4.12 Custom Exceptions (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Custom Exceptions (Core Java 21) covers Designing domain-specific exceptions (`StudentNotFoundException`, `DuplicateRollNumberException`), error codes, and constructors. It is required in backend engineering to Mapping domain errors cleanly to HTTP 404 / 409 / 422 status codes in Spring Boot `@RestControllerAdvice` lat...
Custom Exceptions — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Custom Exceptions': Create `StudentNotFoundException` and `InvalidStudentDataException` for Mini-Project 1. Include clear method/schema naming...
Custom Exceptions — Hands-On Coding Exercise
public class StudentNotFoundException extends RuntimeException {
public StudentNotFoundException(int studentId) {
super("Student not found with ID: " + studentId);
}
}
Compile-time enforced recovery (`IOException`, `SQLException`, `ParseException`), handle-or-declare rule, and wrapping strategies
4.13 Checked Exceptions (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Checked Exceptions (Core Java 21) covers Compile-time enforced recovery (`IOException`, `SQLException`, `ParseException`), handle-or-declare rule, and wrapping strategies. It is required in backend engineering to Handling recoverable external resource failures (missing config file, network timeout, SQL connectivity)....
Checked Exceptions — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Checked Exceptions': Write a checked file-config loader that translates `IOException` into a meaningful startup failure. Include clear method/...
Checked Exceptions — Hands-On Coding Exercise
public static String readFirstLine(java.nio.file.Path path) throws java.io.IOException {
return java.nio.file.Files.readAllLines(path).getFirst();
}
RuntimeException subclasses (`NullPointerException`, `IllegalArgumentException`, `IllegalStateException`, `IndexOutOfBoundsException`) and defensive programming
4.14 Unchecked Exceptions (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Unchecked Exceptions (Core Java 21) covers RuntimeException subclasses (`NullPointerException`, `IllegalArgumentException`, `IllegalStateException`, `IndexOutOfBoundsException`) and defensive programming. It is required in backend engineering to Using unchecked domain exceptions in modern Spring/Hibernate transactio...
Unchecked Exceptions — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Unchecked Exceptions': Harden `StudentRepository` methods with `Objects.requireNonNull` and state checks. Include clear method/schema naming,...
Unchecked Exceptions — Hands-On Coding Exercise
public void register(Student student) {
java.util.Objects.requireNonNull(student, "student must not be null");
}
`assert condition : message;` syntax, enabling assertions via `-ea` JVM flag, and why assertions never replace public input validation
4.15 Java Assertions (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Java Assertions (Core Java 21) covers `assert condition : message;` syntax, enabling assertions via `-ea` JVM flag, and why assertions never replace public input validation. It is required in backend engineering to Verifying internal algorithm invariants during local development and test runs. Under the hood, understandi...
Java Assertions — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Java Assertions': Use `-ea` assertions to verify internal sort/grade invariants while keeping `IllegalArgumentException` for user inputs. Incl...
Java Assertions — Hands-On Coding Exercise
private static double normalizeRatio(int obtained, int total) {
assert total > 0 : "Internal invariant violated: total must be > 0";
return (double) obtained / total;
}
Reverse-domain naming (`com.mockattempt.student.*`), directory mapping, `import` vs wildcard imports, and layered package organization
4.16 Packages in Java (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Packages in Java (Core Java 21) covers Reverse-domain naming (`com.mockattempt.student.*`), directory mapping, `import` vs wildcard imports, and layered package organization. It is required in backend engineering to Structuring enterprise backends cleanly into `model`, `repository`, `service`, `exception`, and `ui`/`con...
Packages in Java — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Packages in Java': Organize Mini-Project 1 classes into `model`, `service`, `exception`, and `app` packages. Include clear method/schema namin...
Packages in Java — Hands-On Coding Exercise
package com.mockattempt.sms.service;
import com.mockattempt.sms.model.Student;
import com.mockattempt.sms.exception.StudentNotFoundException;
Class-level vs member-level visibility matrix across same class, same package, subclass in another package, and world
4.17 Access Modifiers (public, protected, default, private) (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Access Modifiers (public, protected, default, private) (Core Java 21) covers Class-level vs member-level visibility matrix across same class, same package, subclass in another package, and world. It is required in backend engineering to Keeping repository helpers package-private (`d...
Access Modifiers (public, protected, default, private) — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Access Modifiers (public, protected, default, private)': Audit and tighten visibility modifiers across all packages of the Student Management...
Access Modifiers (public, protected, default, private) — Hands-On Coding Exercise
// Visibility from strictest to widest:
// private -> same class only
// (default) -> same package
// protected -> same package + subclasses
// public -> everywhere
Type-safe constants, enum constructors, fields, methods, `values()`, `valueOf()`, and exhaustive switch expressions over enums
4.18 Enums in Java (Week 4 • Core Java 21) 1. What It Is, Why It Is Required & How It Works Enums in Java (Core Java 21) covers Type-safe constants, enum constructors, fields, methods, `values()`, `valueOf()`, and exhaustive switch expressions over enums. It is required in backend engineering to Modeling fixed domain sets (`Grade`, `OrderStatus`, `Role`, `Department`) with embedded behavior instead of fragile mag...
Enums in Java — Practical Implementation Assignment
Complete and push your working Core Java 21 solution for 'Enums in Java': Implement a `Grade` enum (`A_PLUS`, `A`, `B`, `C`, `FAIL`) with min-percentage fields and a `fromPercentage(double)` resolver...
Enums in Java — Hands-On Coding Exercise
public enum Grade {
A_PLUS(90), A(75), B(60), C(45), FAIL(0);
private final int minScore;
Grade(int minScore) { this.minScore = minScore; }
public static Grade fromScore(double score) {
for (Grade g : values()) {
if (score >= g.minScore) return g;
}
return FAIL;
}
}
Build a modular, menu-driven Core Java 21 Student Management Console Application applying strict OOP encapsulation, multi-package architecture, enum grade calculation, input validation, and custom exception handling.
Module Learning & Hands-On Objectives
Iterable -> Collection hierarchy (List, Set, Queue/Deque) and separate Map hierarchy, utility methods in java.util.Collections
5.1 Collections Introduction and Architecture (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Collections Introduction and Architecture (Java Collections) covers Iterable -> Collection hierarchy (List, Set, Queue/Deque) and separate Map hierarchy, utility methods in java.util.Collections. It is required in backend engineering to Choosing standard JDK data structures for DTO lists,...
Collections Introduction and Architecture — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Collections Introduction and Architecture': Diagram the `Iterable`/`Collection` and `Map` hierarchy and test unmodifiable wrappers (`List....
Collections Introduction and Architecture — Hands-On Coding Exercise
import java.util.*;
List<String> immutableRoles = List.of("ROLE_USER", "ROLE_ADMIN");
Ordered indexed sequence contract, positional access, duplicate allowance, `List.of`, `subList` view semantics
5.2 List Interface (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works List Interface (Java Collections) covers Ordered indexed sequence contract, positional access, duplicate allowance, `List.of`, `subList` view semantics. It is required in backend engineering to Returning ordered query results and paginated DTO slices from backend service methods. Under the hood, understanding its exact...
List Interface — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'List Interface': Program against the `List<Employee>` interface so implementations can swap seamlessly. Include clear method/schema naming...
List Interface — Hands-On Coding Exercise
List<String> steps = new ArrayList<>(List.of("VALIDATE", "CHARGE", "NOTIFY"));
steps.add("AUDIT");
Dynamic `Object[]` backing array, default capacity (10), 1.5x growth resizing, `O(1)` random access, `O(n)` middle insert/remove
5.3 ArrayList (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works ArrayList (Java Collections) covers Dynamic `Object[]` backing array, default capacity (10), 1.5x growth resizing, `O(1)` random access, `O(n)` middle insert/remove. It is required in backend engineering to Default choice for 90%+ of sequential read-heavy entity and DTO lists in Spring Boot APIs. Under the hood, understandi...
ArrayList — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'ArrayList': Build an Employee Management store using `ArrayList<Employee>` pre-sized with expected capacity. Include clear method/schema n...
ArrayList — Hands-On Coding Exercise
List<String> batch = new ArrayList<>(100);
batch.add("EMP-101");
String first = batch.getFirst();
Doubly-linked `Node<E>` (`prev`, `item`, `next`) structure, `O(1)` head/tail operations, `O(n)` indexed traversal, pointer memory overhead
5.4 LinkedList (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works LinkedList (Java Collections) covers Doubly-linked `Node<E>` (`prev`, `item`, `next`) structure, `O(1)` head/tail operations, `O(n)` indexed traversal, pointer memory overhead. It is required in backend engineering to Understanding doubly-linked node pointers and when `ArrayDeque` outperforms `LinkedList` due to CPU...
LinkedList — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'LinkedList': Benchmark indexed `get(i)` vs iterator traversal on `LinkedList` vs `ArrayList`. Include clear method/schema naming, edge-cas...
LinkedList — Hands-On Coding Exercise
LinkedList<String> history = new LinkedList<>();
history.addFirst("LOGIN");
history.addLast("VIEW_DASHBOARD");
Legacy synchronized dynamic array, 2x capacity growth, method-level lock overhead, and modern alternatives (`ArrayList`, `CopyOnWriteArrayList`)
5.5 Vector (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Vector (Java Collections) covers Legacy synchronized dynamic array, 2x capacity growth, method-level lock overhead, and modern alternatives (`ArrayList`, `CopyOnWriteArrayList`). It is required in backend engineering to Maintaining legacy enterprise codebases and answering interview comparisons between `Vector` and `ArrayList`...
Vector — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Vector': Replace a legacy `Vector` usage with `ArrayList` / `Collections.synchronizedList` and document why. Include clear method/schema n...
Vector — Hands-On Coding Exercise
// Legacy Vector synchronizes every individual call; prefer ArrayList for local state
List<String> modernList = new ArrayList<>();
LIFO (Last-In-First-Out) push, pop, peek operations, why `java.util.Stack` extends `Vector`, and why `Deque`/`ArrayDeque` is preferred
5.6 Stack (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Stack (Java Collections) covers LIFO (Last-In-First-Out) push, pop, peek operations, why `java.util.Stack` extends `Vector`, and why `Deque`/`ArrayDeque` is preferred. It is required in backend engineering to Implementing undo history, expression parsing, DFS traversal, and bracket validation. Under the hood, understanding its...
Stack — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Stack': Implement balanced-parentheses validation comparing `Stack<Character>` and `ArrayDeque<Character>`. Include clear method/schema na...
Stack — Hands-On Coding Exercise
Deque<String> undoStack = new ArrayDeque<>();
undoStack.push("EDIT_NAME");
String lastAction = undoStack.pop();
FIFO (First-In-First-Out) processing contract: `offer` vs `add`, `poll` vs `remove`, `peek` vs `element`
5.7 Queue Interface (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Queue Interface (Java Collections) covers FIFO (First-In-First-Out) processing contract: `offer` vs `add`, `poll` vs `remove`, `peek` vs `element`. It is required in backend engineering to Buffering incoming jobs, breadth-first search (BFS), and ordered request processing. Under the hood, understanding its exact execu...
Queue Interface — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Queue Interface': Simulate a customer-support ticket FIFO dispatcher using `Queue<Ticket>`. Include clear method/schema naming, edge-case...
Queue Interface — Hands-On Coding Exercise
Queue<String> jobQueue = new ArrayDeque<>();
jobQueue.offer("SEND_RECEIPT");
String nextJob = jobQueue.poll();
Binary heap internal array, natural min-heap ordering vs custom `Comparator` max-heap, `O(log n)` offer/poll, `O(1)` peek
5.8 PriorityQueue (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works PriorityQueue (Java Collections) covers Binary heap internal array, natural min-heap ordering vs custom `Comparator` max-heap, `O(log n)` offer/poll, `O(1)` peek. It is required in backend engineering to Scheduling urgent support tickets, Top-K analytics, and Dijkstra shortest-path algorithms. Under the hood, understand...
PriorityQueue — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'PriorityQueue': Build a priority-based background task queue ordering `CRITICAL` > `HIGH` > `NORMAL` tasks. Include clear method/schema na...
PriorityQueue — Hands-On Coding Exercise
PriorityQueue<Integer> maxHeap = new PriorityQueue<>(Comparator.reverseOrder());
maxHeap.offer(20); maxHeap.offer(95); maxHeap.offer(40);
int highest = maxHeap.poll(); // 95
Double-ended queue (`offerFirst`, `offerLast`, `pollFirst`, `pollLast`), circular resizable array internals, null element prohibition
5.9 Deque and ArrayDeque (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Deque and ArrayDeque (Java Collections) covers Double-ended queue (`offerFirst`, `offerLast`, `pollFirst`, `pollLast`), circular resizable array internals, null element prohibition. It is required in backend engineering to High-performance sliding-window maximums, work-stealing queues, and both LIFO stack & F...
Deque and ArrayDeque — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Deque and ArrayDeque': Implement a bounded browser back/forward history buffer using `ArrayDeque`. Include clear method/schema naming, edg...
Deque and ArrayDeque — Hands-On Coding Exercise
Deque<String> window = new ArrayDeque<>();
window.offerLast("REQ-1");
window.offerFirst("PRIORITY-REQ");
Mathematical uniqueness contract, `Set.of` immutable sets, set union (`addAll`), intersection (`retainAll`), and difference (`removeAll`)
5.10 Set Interface (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Set Interface (Java Collections) covers Mathematical uniqueness contract, `Set.of` immutable sets, set union (`addAll`), intersection (`retainAll`), and difference (`removeAll`). It is required in backend engineering to Representing unique user roles/permissions (`Set<Role>`) and computing permission diffs cleanl...
Set Interface — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Set Interface': Compute common and missing skills between job requirements and candidate skills using `Set` operations. Include clear meth...
Set Interface — Hands-On Coding Exercise
Set<String> required = new HashSet<>(Set.of("JAVA", "SQL", "SPRING"));
required.retainAll(Set.of("JAVA", "SQL", "DOCKER")); // Intersection: JAVA, SQL
Backed internally by `HashMap<E, Object>` (`PRESENT` dummy value), `O(1)` average add/contains/remove, unordered iteration, load factor (0.75)
5.11 HashSet (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works HashSet (Java Collections) covers Backed internally by `HashMap<E, Object>` (`PRESENT` dummy value), `O(1)` average add/contains/remove, unordered iteration, load factor (0.75). It is required in backend engineering to Deduplicating email batches, checking blacklisted JWT IDs, and fast membership checks. Under the hood...
HashSet — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'HashSet': Remove duplicate employee records from an import batch using `HashSet<Employee>`. Include clear method/schema naming, edge-case...
HashSet — Hands-On Coding Exercise
Set<String> seenEmails = new HashSet<>();
boolean isNew = seenEmails.add("ravi@mockattempt.com");
Hash table + doubly-linked list across entries, preserving predictable insertion order with `O(1)` lookup performance
5.12 LinkedHashSet (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works LinkedHashSet (Java Collections) covers Hash table + doubly-linked list across entries, preserving predictable insertion order with `O(1)` lookup performance. It is required in backend engineering to Deduplicating UI filter tags or SQL column lists while preserving exact user-specified order. Under the hood, understand...
LinkedHashSet — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'LinkedHashSet': Deduplicate an audit trail of visited endpoints while preserving exact chronological first-visit order. Include clear meth...
LinkedHashSet — Hands-On Coding Exercise
Set<String> breadcrumbs = new LinkedHashSet<>(List.of("/home", "/courses", "/home", "/checkout"));
// Iteration order: /home, /courses, /checkout
Backed by `TreeMap` (Red-Black self-balancing BST), `O(log n)` operations, `NavigableSet` range queries (`headSet`, `tailSet`, `subSet`, `floor`, `ceiling`)
5.13 TreeSet (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works TreeSet (Java Collections) covers Backed by `TreeMap` (Red-Black self-balancing BST), `O(log n)` operations, `NavigableSet` range queries (`headSet`, `tailSet`, `subSet`, `floor`, `ceiling`). It is required in backend engineering to Maintaining sorted leaderboards, price brackets, and nearest-slot time lookups (`ceiling`/`fl...
TreeSet — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'TreeSet': Maintain sorted unique exam cutoff scores and query nearest higher/lower cutoffs with `ceiling()` and `floor()`. Include clear m...
TreeSet — Hands-On Coding Exercise
NavigableSet<Integer> slots = new TreeSet<>(Set.of(900, 1100, 1400, 1700));
Integer nextAvailable = slots.ceiling(1130); // 1400
Key-value associations, `put`, `getOrDefault`, `putIfAbsent`, `computeIfAbsent`, `merge`, `keySet`, `values`, and `entrySet`
5.14 Map Interface (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Map Interface (Java Collections) covers Key-value associations, `put`, `getOrDefault`, `putIfAbsent`, `computeIfAbsent`, `merge`, `keySet`, `values`, and `entrySet`. It is required in backend engineering to Indexing entities by ID, counting event frequencies with `merge`, and building grouped lookup caches. Under the h...
Map Interface — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Map Interface': Count word frequencies in a log file cleanly using `map.merge(word, 1, Integer::sum)`. Include clear method/schema naming,...
Map Interface — Hands-On Coding Exercise
Map<String, Integer> freq = new HashMap<>();
for (String word : List.of("java", "spring", "java")) {
freq.merge(word, 1, Integer::sum);
}
Node<K,V>[] table, hash spreading `(h = key.hashCode()) ^ (h >>> 16)`, index `(n - 1) & hash`, collisions, treeification at 8 nodes, resizing at `capacity * 0.75`
5.15 HashMap Internals (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works HashMap Internals (Java Collections) covers Node<K,V>[] table, hash spreading `(h = key.hashCode()) ^ (h >>> 16)`, index `(n - 1) & hash`, collisions, treeification at 8 nodes, resizing at `capacity * 0.75`. It is required in backend engineering to Fast `O(1)` in-memory lookups and explaining has...
HashMap Internals — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'HashMap Internals': Trace bucket collision handling with a custom key class and build a fast `O(1)` employee-by-code lookup service. Inclu...
HashMap Internals — Hands-On Coding Exercise
Map<String, String> empByCode = HashMap.newHashMap(128);
empByCode.put("EMP-01", "Neha Verma");
Insertion-order vs access-order (`accessOrder = true`) doubly-linked entries and overriding `removeEldestEntry` for bounded LRU caches
5.16 LinkedHashMap (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works LinkedHashMap (Java Collections) covers Insertion-order vs access-order (`accessOrder = true`) doubly-linked entries and overriding `removeEldestEntry` for bounded LRU caches. It is required in backend engineering to Building lightweight bounded LRU (Least Recently Used) in-memory caches and deterministic JSON payload...
LinkedHashMap — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'LinkedHashMap': Implement a 5-entry LRU cache extending `LinkedHashMap<K, V>` with `removeEldestEntry`. Include clear method/schema naming...
LinkedHashMap — Hands-On Coding Exercise
Map<String, String> lruCache = new LinkedHashMap<>(16, 0.75f, true) {
@Override
protected boolean removeEldestEntry(Map.Entry<String, String> eldest) {
return size() > 3;
}
};
Red-Black tree sorted keys, `O(log n)` get/put, `NavigableMap` (`firstEntry`, `lastEntry`, `floorEntry`, `subMap`)
5.17 TreeMap (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works TreeMap (Java Collections) covers Red-Black tree sorted keys, `O(log n)` get/put, `NavigableMap` (`firstEntry`, `lastEntry`, `floorEntry`, `subMap`). It is required in backend engineering to Tax-slab bracket lookups (`floorEntry(income)`), time-series range queries, and canonical request-header signing. Under the hood, under...
TreeMap — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'TreeMap': Build an income-tax slab lookup engine using `TreeMap.floorEntry(annualIncome)`. Include clear method/schema naming, edge-case v...
TreeMap — Hands-On Coding Exercise
NavigableMap<Long, Integer> taxSlabs = new TreeMap<>();
taxSlabs.put(0L, 0); taxSlabs.put(400_000L, 5); taxSlabs.put(1_200_000L, 15);
int ratePct = taxSlabs.floorEntry(850_000L).getValue(); // 5%
Legacy synchronized dictionary, no null keys or null values, coarse object-wide locking vs `ConcurrentHashMap`
5.18 Hashtable (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Hashtable (Java Collections) covers Legacy synchronized dictionary, no null keys or null values, coarse object-wide locking vs `ConcurrentHashMap`. It is required in backend engineering to Understanding `Properties` (which extends `Hashtable`) and why `ConcurrentHashMap` replaced `Hashtable` in concurrent servers. Under th...
Hashtable — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Hashtable': Compare `Hashtable`, `Collections.synchronizedMap`, and `ConcurrentHashMap` locking semantics. Include clear method/schema nam...
Hashtable — Hands-On Coding Exercise
// Prefer ConcurrentHashMap in multi-threaded apps instead of legacy Hashtable
Map<String, Integer> counters = new java.util.concurrent.ConcurrentHashMap<>();
`hasNext()`, `next()`, safe `iterator.remove()`, `modCount` tracking, and avoiding `ConcurrentModificationException`
5.19 Iterator and Fail-Fast Behaviour (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Iterator and Fail-Fast Behaviour (Java Collections) covers `hasNext()`, `next()`, safe `iterator.remove()`, `modCount` tracking, and avoiding `ConcurrentModificationException`. It is required in backend engineering to Safely pruning expired sessions or inactive items while traversing a mutable collec...
Iterator and Fail-Fast Behaviour — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Iterator and Fail-Fast Behaviour': Remove resigned employees during traversal safely using `Iterator.remove()` and `Collection.removeIf(.....
Iterator and Fail-Fast Behaviour — Hands-On Coding Exercise
List<Integer> scores = new ArrayList<>(List.of(45, 82, 39, 91));
Iterator<Integer> it = scores.iterator();
while (it.hasNext()) {
if (it.next() < 50) it.remove();
}
Bidirectional traversal (`hasPrevious`, `previous`), index inspection (`nextIndex`), in-place `set(e)` replacement and `add(e)` insertion
5.20 ListIterator (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works ListIterator (Java Collections) covers Bidirectional traversal (`hasPrevious`, `previous`), index inspection (`nextIndex`), in-place `set(e)` replacement and `add(e)` insertion. It is required in backend engineering to Walking ordered workflows forward/backward and replacing normalized elements in-place. Under the hood,...
ListIterator — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'ListIterator': Traverse a transaction ledger forward and backward while normalizing statuses in-place via `ListIterator.set()`. Include cl...
ListIterator — Hands-On Coding Exercise
List<String> tags = new ArrayList<>(List.of("java", "spring"));
ListIterator<String> li = tags.listIterator();
while (li.hasNext()) {
li.set(li.next().toUpperCase());
}
`Comparable<T>` interface, `compareTo(T other)` contract (sign symmetry, transitivity), and `Integer.compare` / `Long.compare` overflow safety
5.21 Comparable (Natural Ordering) (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Comparable (Natural Ordering) (Java Collections) covers `Comparable<T>` interface, `compareTo(T other)` contract (sign symmetry, transitivity), and `Integer.compare` / `Long.compare` overflow safety. It is required in backend engineering to Defining default natural sort order on domain models (`Em...
Comparable (Natural Ordering) — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Comparable (Natural Ordering)': Implement `Comparable<Employee>` ordering employees naturally by `employeeId`. Include clear method/schema...
Comparable (Natural Ordering) — Hands-On Coding Exercise
public record RankedCandidate(int id, int score) implements Comparable<RankedCandidate> {
@Override
public int compareTo(RankedCandidate other) {
return Integer.compare(other.score, this.score); // Descending score
}
}
`Comparator.comparing`, `comparingDouble`, `reversed()`, `thenComparing`, `nullsLast`, and decoupling sort policies from domain classes
5.22 Comparator (Custom Multi-Field Sorting) (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works Comparator (Custom Multi-Field Sorting) (Java Collections) covers `Comparator.comparing`, `comparingDouble`, `reversed()`, `thenComparing`, `nullsLast`, and decoupling sort policies from domain classes. It is required in backend engineering to Supporting dynamic API sort options (`sort=salary,...
Comparator (Custom Multi-Field Sorting) — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'Comparator (Custom Multi-Field Sorting)': Sort employees by salary descending, then joining date ascending, then name case-insensitively....
Comparator (Custom Multi-Field Sorting) — Hands-On Coding Exercise
Comparator<EmployeeDto> bySalaryDescThenName = Comparator
.comparingDouble(EmployeeDto::salary).reversed()
.thenComparing(EmployeeDto::name, String.CASE_INSENSITIVE_ORDER);
Why equal objects MUST produce identical hash codes, hash collision handling via `equals`, immutable key fields, and JPA entity equality nuances
5.23 equals and hashCode Contract in Collections (Week 5 • Java Collections) 1. What It Is, Why It Is Required & How It Works equals and hashCode Contract in Collections (Java Collections) covers Why equal objects MUST produce identical hash codes, hash collision handling via `equals`, immutable key fields, and JPA entity equality nuances. It is required in backend engineering to Preventing duplicate business key...
equals and hashCode Contract in Collections — Practical Implementation Assignment
Complete and push your working Java Collections solution for 'equals and hashCode Contract in Collections': Write a test proving how breaking `hashCode()` causes `HashSet.contains()` to return `false`...
equals and hashCode Contract in Collections — Hands-On Coding Exercise
public record DepartmentKey(String companyCode, String deptCode) {
// Java 21 record automatically generates canonical immutable equals() & hashCode()
}
Implement an in-memory Employee & Priority Task engine using `ArrayList`, `HashSet` deduplication, `HashMap` word/department indexing, `Comparator` multi-field sorting, and `PriorityQueue` urgent task dispatch.
Module Learning & Hands-On Objectives
Compile-time type safety, type parameters (`<T, R>`), generic `ApiResponse<T>` wrappers, type erasure at runtime
6.1 Generics (Classes, Interfaces and Methods) (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Generics (Classes, Interfaces and Methods) (Modern Java 21) covers Compile-time type safety, type parameters (`<T, R>`), generic `ApiResponse<T>` wrappers, type erasure at runtime. It is required in backend engineering to Building reusable `PagedResponse<T>` and `Result<T&...
Generics (Classes, Interfaces and Methods) — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Generics (Classes, Interfaces and Methods)': Create a generic `Pair<K, V>` and `PageResult<T>` container with generic static factory methods...
Generics (Classes, Interfaces and Methods) — Hands-On Coding Exercise
public record PageResult<T>(java.util.List<T> items, int page, long totalElements) {
public static <E> PageResult<E> empty() {
return new PageResult<>(java.util.List.of(), 0, 0L);
}
}
Upper bounds (`<T extends Number & Comparable<T>>`), restricting type parameters to domain capabilities
6.2 Bounded Generics (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Bounded Generics (Modern Java 21) covers Upper bounds (`<T extends Number & Comparable<T>>`), restricting type parameters to domain capabilities. It is required in backend engineering to Writing reusable numeric aggregation or `AuditableEntity` repository helpers with compile-time guarantees. Under the...
Bounded Generics — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Bounded Generics': Write a generic `maxElement(List<T> items)` method bounded by `<T extends Comparable<? super T>>`. Include clear method/s...
Bounded Generics — Hands-On Coding Exercise
public static <T extends Number> double sumAsDouble(java.util.List<T> values) {
double sum = 0.0;
for (T v : values) sum += v.doubleValue();
return sum;
}
Unbounded `?`, covariance `? extends T` (Producer Extends), contravariance `? super T` (Consumer Super), and invariance of `List<T>`
6.3 Wildcards (?, extends and super — PECS) (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Wildcards (?, extends and super — PECS) (Modern Java 21) covers Unbounded `?`, covariance `? extends T` (Producer Extends), contravariance `? super T` (Consumer Super), and invariance of `List<T>`. It is required in backend engineering to Designing flexible library/service utility methods l...
Wildcards (?, extends and super — PECS) — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Wildcards (?, extends and super — PECS)': Implement a generic `transferElements(List<? extends T> src, List<? super T> dest)` method applyin...
Wildcards (?, extends and super — PECS) — Hands-On Coding Exercise
public static <T> void copyAll(java.util.List<? extends T> src, java.util.List<? super T> dst) {
for (T item : src) dst.add(item);
}
`@FunctionalInterface`, concise `(params) -> expression` syntax, target typing, and effectively final variable capture
6.4 Lambda Expressions (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Lambda Expressions (Modern Java 21) covers `@FunctionalInterface`, concise `(params) -> expression` syntax, target typing, and effectively final variable capture. It is required in backend engineering to Passing concise filtering, transformation, and callback strategies without verbose anonymous inner classes. Und...
Lambda Expressions — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Lambda Expressions': Refactor 4 verbose anonymous inner classes (`Runnable`, `Comparator`, custom validator) into clean lambdas. Include cle...
Lambda Expressions — Hands-On Coding Exercise
java.util.List<String> names = new java.util.ArrayList<>(java.util.List.of("Zoya", "Aman", "Kiran"));
names.sort((a, b) -> a.compareToIgnoreCase(b));
`java.util.function` contracts: `test(T)`, `apply(T)`, `accept(T)`, `get()`, and composition (`and`, `or`, `negate`, `andThen`)
6.5 Core Functional Interfaces (Predicate, Function, Consumer, Supplier) (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Core Functional Interfaces (Predicate, Function, Consumer, Supplier) (Modern Java 21) covers `java.util.function` contracts: `test(T)`, `apply(T)`, `accept(T)`, `get()`, and composition (`and`, `or`, `negate`, `andThen`). It is required in backend engineering to Compo...
Core Functional Interfaces (Predicate, Function, Consumer, Supplier) — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Core Functional Interfaces (Predicate, Function, Consumer, Supplier)': Compose dynamic employee eligibility rules using `Predicate.and()` an...
Core Functional Interfaces (Predicate, Function, Consumer, Supplier) — Hands-On Coding Exercise
import java.util.function.Predicate;
Predicate<Double> minSalary = s -> s >= 50_000;
Predicate<Double> maxSalary = s -> s <= 150_000;
boolean inBand = minSalary.and(maxSalary).test(85_000.0);
Two-argument functional contracts (`BiPredicate`, `BiFunction`, `BiConsumer`, `BinaryOperator`) and `Map.forEach` / `Map.compute` usage
6.6 Bi-Arity Functional Interfaces (BiPredicate, BiFunction, BiConsumer) (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Bi-Arity Functional Interfaces (BiPredicate, BiFunction, BiConsumer) (Modern Java 21) covers Two-argument functional contracts (`BiPredicate`, `BiFunction`, `BiConsumer`, `BinaryOperator`) and `Map.forEach` / `Map.compute` usage. It is required in backend engineering...
Bi-Arity Functional Interfaces (BiPredicate, BiFunction, BiConsumer) — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Bi-Arity Functional Interfaces (BiPredicate, BiFunction, BiConsumer)': Apply `BiFunction` to compute department-adjusted bonuses and `BiCons...
Bi-Arity Functional Interfaces (BiPredicate, BiFunction, BiConsumer) — Hands-On Coding Exercise
java.util.function.BiFunction<Double, Double, Double> applyTax = (price, gstPct) -> price * (1 + gstPct / 100.0);
Static (`Integer::parseInt`), bound instance (`logger::info`), unbound instance (`String::toLowerCase`), and constructor (`ArrayList::new`) references
6.7 Method References (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Method References (Modern Java 21) covers Static (`Integer::parseInt`), bound instance (`logger::info`), unbound instance (`String::toLowerCase`), and constructor (`ArrayList::new`) references. It is required in backend engineering to Making Stream pipelines (`map(Employee::department)`, `map(UserDto::fromEntity)`) se...
Method References — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Method References': Convert Stream lambdas into all 4 kinds of method references across an employee dataset. Include clear method/schema nam...
Method References — Hands-On Coding Exercise
var normalized = java.util.List.of(" java ", " spring ").stream()
.map(String::strip)
.map(String::toUpperCase)
.toList();
`collection.stream()`, `Stream.of`, `Arrays.stream`, `IntStream.rangeClosed`, lazy evaluation, non-mutating source semantics, single-use stream rule
6.8 Stream API Architecture and Creation (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Stream API Architecture and Creation (Modern Java 21) covers `collection.stream()`, `Stream.of`, `Arrays.stream`, `IntStream.rangeClosed`, lazy evaluation, non-mutating source semantics, single-use stream rule. It is required in backend engineering to Expressing declarative in-memory data transforma...
Stream API Architecture and Creation — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Stream API Architecture and Creation': Create streams from lists, arrays, and numeric ranges and demonstrate lazy pipeline execution. Includ...
Stream API Architecture and Creation — Hands-On Coding Exercise
int sumOfEvens = java.util.stream.IntStream.rangeClosed(1, 20)
.filter(n -> n % 2 == 0)
.sum();
`filter`, `map`, `mapToDouble`, `flatMap`, `sorted`, `distinct`, `limit`, `skip`, and `peek`
6.9 Stream Intermediate Operations (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Stream Intermediate Operations (Modern Java 21) covers `filter`, `map`, `mapToDouble`, `flatMap`, `sorted`, `distinct`, `limit`, `skip`, and `peek`. It is required in backend engineering to Filtering active employees by salary, flattening nested order line-items with `flatMap`, and paginating in-memory sl...
Stream Intermediate Operations — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Stream Intermediate Operations': Filter employees by salary threshold and flatten `List<Department>` -> `List<Skill>` using `flatMap`. Inclu...
Stream Intermediate Operations — Hands-On Coding Exercise
var uniqueSkills = departments.stream()
.flatMap(dept -> dept.employees().stream())
.flatMap(emp -> emp.skills().stream())
.distinct()
.sorted()
.toList();
`toList()`, `collect`, `reduce`, `count`, `min`, `max`, `findFirst`, `anyMatch`, `allMatch`, `noneMatch`, `forEach`
6.10 Stream Terminal Operations (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Stream Terminal Operations (Modern Java 21) covers `toList()`, `collect`, `reduce`, `count`, `min`, `max`, `findFirst`, `anyMatch`, `allMatch`, `noneMatch`, `forEach`. It is required in backend engineering to Finding the highest-paid employee (`max`), checking policy compliance (`allMatch`), and aggregating...
Stream Terminal Operations — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Stream Terminal Operations': Find the highest-paid employee, total payroll outlay via `reduce`, and verify salary floor compliance via `allM...
Stream Terminal Operations — Hands-On Coding Exercise
var highestPaid = employees.stream()
.max(java.util.Comparator.comparingDouble(Employee::salary));
`Collectors.toMap` (with merge function!), `groupingBy` + downstream `counting`/`averagingDouble`/`mapping`, `partitioningBy`, and `joining`
6.11 Collectors (groupingBy, partitioningBy, joining, mapping) (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Collectors (groupingBy, partitioningBy, joining, mapping) (Modern Java 21) covers `Collectors.toMap` (with merge function!), `groupingBy` + downstream `counting`/`averagingDouble`/`mapping`, `partitioningBy`, and `joining`. It is required in backend engineering to Grouping orde...
Collectors (groupingBy, partitioningBy, joining, mapping) — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Collectors (groupingBy, partitioningBy, joining, mapping)': Group employees by department with downstream headcount and average salary using...
Collectors (groupingBy, partitioningBy, joining, mapping) — Hands-On Coding Exercise
Map<String, Double> avgSalaryByDept = employees.stream()
.collect(java.util.stream.Collectors.groupingBy(
Employee::department,
java.util.stream.Collectors.averagingDouble(Employee::salary)
));
`Optional.of`, `Optional.ofNullable`, `Optional.empty`, `map`, `flatMap`, `filter`, `orElse`, `orElseGet`, `orElseThrow`
6.12 Optional for Null-Safe Return Contracts (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Optional for Null-Safe Return Contracts (Modern Java 21) covers `Optional.of`, `Optional.ofNullable`, `Optional.empty`, `map`, `flatMap`, `filter`, `orElse`, `orElseGet`, `orElseThrow`. It is required in backend engineering to Handling `JpaRepository.findById(id).orElseThrow(() -> new NotFoun...
Optional for Null-Safe Return Contracts — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Optional for Null-Safe Return Contracts': Refactor nullable lookup chains into fluent `Optional.map(...).orElseThrow(...)` pipelines. Includ...
Optional for Null-Safe Return Contracts — Hands-On Coding Exercise
public String resolveManagerEmail(Long empId) {
return findEmployee(empId)
.map(Employee::managerEmail)
.filter(email -> !email.isBlank())
.orElse("hr@mockattempt.com");
}
Immutable `LocalDate`, `LocalTime`, `LocalDateTime`, `Instant`, `ZonedDateTime`, `Duration`, `Period`, and `DateTimeFormatter`
6.13 Date and Time API (java.time) (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Date and Time API (java.time) (Modern Java 21) covers Immutable `LocalDate`, `LocalTime`, `LocalDateTime`, `Instant`, `ZonedDateTime`, `Duration`, `Period`, and `DateTimeFormatter`. It is required in backend engineering to Storing UTC `Instant` timestamps in PostgreSQL and converting to `Asia/Kolkata` (`Z...
Date and Time API (java.time) — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Date and Time API (java.time)': Compute employee tenure (`Period`), SLA deadlines across time zones (`ZonedDateTime`), and ISO-8601 formatti...
Date and Time API (java.time) — Hands-On Coding Exercise
import java.time.*;
Instant nowUtc = Instant.now();
ZonedDateTime istTime = nowUtc.atZone(ZoneId.of("Asia/Kolkata"));
Period tenure = Period.between(LocalDate.of(2023, 6, 1), LocalDate.now());
Evolving functional and domain interfaces with `default` combinators and `static` factories without breaking lambdas
6.14 Interface Default and Static Enhancements (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Interface Default and Static Enhancements (Modern Java 21) covers Evolving functional and domain interfaces with `default` combinators and `static` factories without breaking lambdas. It is required in backend engineering to Understanding how JDK added `.stream()`, `.forEach()`, and `Comparato...
Interface Default and Static Enhancements — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Interface Default and Static Enhancements': Create a `@FunctionalInterface` `SalaryRule` with `default` chaining methods. Include clear meth...
Interface Default and Static Enhancements — Hands-On Coding Exercise
@FunctionalInterface
public interface PricePolicy {
double apply(double amount);
default PricePolicy then(PricePolicy next) {
return amt -> next.apply(this.apply(amt));
}
}
Immutable `record` DTOs & compact constructors, `sealed` class hierarchies (`permits`), multi-line SQL/JSON text blocks (`\"\"\"`), and `switch` pattern matching
6.15 Modern Java 17/21 Features (Records, Sealed Classes, Text Blocks, Pattern Matching) (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works Modern Java 17/21 Features (Records, Sealed Classes, Text Blocks, Pattern Matching) (Modern Java 21) covers Immutable `record` DTOs & compact constructors, `sealed` class hierarchies (`permits`), multi-line SQL/JSON text blocks (`\"\"\&qu...
Modern Java 17/21 Features (Records, Sealed Classes, Text Blocks, Pattern Matching) — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'Modern Java 17/21 Features (Records, Sealed Classes, Text Blocks, Pattern Matching)': Model `PaymentOutcome` as a `sealed interface` with `r...
Modern Java 17/21 Features (Records, Sealed Classes, Text Blocks, Pattern Matching) — Hands-On Coding Exercise
public sealed interface PaymentResult permits PaymentSuccess, PaymentFailure {}
public record PaymentSuccess(String txnId, double amount) implements PaymentResult {}
public record PaymentFailure(String reason) implements PaymentResult {}
public static String describe(PaymentResult result) {
return switch (result) {
case PaymentSuccess(var id, var amt) -> "Paid ₹" + amt + " [" + id + "]";
case PaymentFailure(var reason) -> "Failed: " + reason;
};
}
`java.nio.file.Path`, `Files.readString`, `Files.writeString`, `Files.lines` (try-with-resources!), buffered readers/writers, and CSV persistence
6.16 File I/O and NIO.2 (Path, Files and Streams) (Week 6 • Modern Java 21) 1. What It Is, Why It Is Required & How It Works File I/O and NIO.2 (Path, Files and Streams) (Modern Java 21) covers `java.nio.file.Path`, `Files.readString`, `Files.writeString`, `Files.lines` (try-with-resources!), buffered readers/writers, and CSV persistence. It is required in backend engineering to Exporting/importing CSV employee r...
File I/O and NIO.2 (Path, Files and Streams) — Practical Implementation Assignment
Complete and push your working Modern Java 21 solution for 'File I/O and NIO.2 (Path, Files and Streams)': Persist and reload `List<Employee>` to/from a UTF-8 CSV file using `Path` and `Files` with fu...
File I/O and NIO.2 (Path, Files and Streams) — Hands-On Coding Exercise
import java.nio.file.*;
import java.io.IOException;
public static long countErrorLines(Path logFile) throws IOException {
try (var lines = Files.lines(logFile)) {
return lines.filter(line -> line.contains("ERROR")).count();
}
}
Build a declarative Java 21 Stream analytics service grouping employees by department, finding top earners, handling missing values safely via `Optional`, modeling sealed results with `record`s, and persisting CSV reports via `java.nio.file.Files`.
Module Learning & Hands-On Objectives
ClassLoader subsystem, Runtime Data Areas, Execution Engine (Interpreter + JIT + GC), Native Method Interface (JNI)
7.1 JVM Architecture Overview (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works JVM Architecture Overview (JVM & Concurrency) covers ClassLoader subsystem, Runtime Data Areas, Execution Engine (Interpreter + JIT + GC), Native Method Interface (JNI). It is required in backend engineering to Sizing container memory (`-Xms`, `-Xmx`) and diagnosing production latency spikes in Spri...
JVM Architecture Overview — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'JVM Architecture Overview': Inspect live JVM runtime memory (`Runtime.getRuntime().maxMemory()`) and JVM flags (`-Xms`, `-Xmx`). Include...
JVM Architecture Overview — Hands-On Coding Exercise
Runtime rt = Runtime.getRuntime();
System.out.printf("Processors: %d | Max Heap MB: %d%n", rt.availableProcessors(), rt.maxMemory() / (1024 * 1024));
Bootstrap, Platform, and Application ClassLoaders, Parents-Delegation model, Loading -> Linking (Verify, Prepare, Resolve) -> Initialization
7.2 Class Loading Subsystem (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Class Loading Subsystem (JVM & Concurrency) covers Bootstrap, Platform, and Application ClassLoaders, Parents-Delegation model, Loading -> Linking (Verify, Prepare, Resolve) -> Initialization. It is required in backend engineering to Troubleshooting classpath conflicts and Spring Boot fat-JAR `L...
Class Loading Subsystem — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Class Loading Subsystem': Print the ClassLoader hierarchy of `String.class`, `DriverManager.class`, and your own application class. Inclu...
Class Loading Subsystem — Hands-On Coding Exercise
System.out.println("App loader: " + BytecodeDemo.class.getClassLoader());
System.out.println("JDK String loader: " + String.class.getClassLoader()); // null -> Bootstrap
Young Gen (Eden, Survivor S0/S1), Old Gen, per-thread JVM Stacks & frames, Native Metaspace, StackOverflowError vs OutOfMemoryError
7.3 JVM Memory Management (Heap, Stack and Metaspace) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works JVM Memory Management (Heap, Stack and Metaspace) (JVM & Concurrency) covers Young Gen (Eden, Survivor S0/S1), Old Gen, per-thread JVM Stacks & frames, Native Metaspace, StackOverflowError vs OutOfMemoryError. It is required in backend engineering to Recognizing why unbou...
JVM Memory Management (Heap, Stack and Metaspace) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'JVM Memory Management (Heap, Stack and Metaspace)': Trace exact stack-frame vs heap object references for a multi-method order calculatio...
JVM Memory Management (Heap, Stack and Metaspace) — Hands-On Coding Exercise
// Thread Stack: local primitives + object reference pointers (thread-isolated)
// Shared Heap : all `new` object instances & arrays (GC-managed)
// Metaspace : class metadata, method bytecode, constant pool
Reachability analysis from GC Roots, Mark-Sweep-Compact, Minor vs Major/Mixed GC, Stop-The-World pauses, G1GC (default) & ZGC overview
7.4 Garbage Collection Fundamentals (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Garbage Collection Fundamentals (JVM & Concurrency) covers Reachability analysis from GC Roots, Mark-Sweep-Compact, Minor vs Major/Mixed GC, Stop-The-World pauses, G1GC (default) & ZGC overview. It is required in backend engineering to Preventing memory leaks caused by unclosed listeners,...
Garbage Collection Fundamentals — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Garbage Collection Fundamentals': Enable JVM GC logging (`-Xlog:gc*`) on a sample allocation workload and read Eden/Old collection lines....
Garbage Collection Fundamentals — Hands-On Coding Exercise
// Run with: java -Xmx128m -Xlog:gc SampleAllocationApp
// Never rely on System.gc(); bound caches with TTL/size limits instead.
HotSpot profiling, C1 (client/fast compile) & C2 (tiered server optimization), method inlining, escape analysis
7.5 JIT Compiler (Just-In-Time Compilation) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works JIT Compiler (Just-In-Time Compilation) (JVM & Concurrency) covers HotSpot profiling, C1 (client/fast compile) & C2 (tiered server optimization), method inlining, escape analysis. It is required in backend engineering to Understanding why Java backend throughput improves after JVM...
JIT Compiler (Just-In-Time Compilation) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'JIT Compiler (Just-In-Time Compilation)': Observe cold vs warmed-up execution latency across repeated loop runs. Include clear method/sch...
JIT Compiler (Just-In-Time Compilation) — Hands-On Coding Exercise
long start = System.nanoTime();
// Warmed-up hot loops are compiled to native machine code by HotSpot C1/C2 JIT
OS Process isolation vs lightweight shared-heap threads, context switching, concurrency vs parallelism, Java 21 platform vs virtual threads intro
7.6 Thread Fundamentals (Process vs Thread) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Thread Fundamentals (Process vs Thread) (JVM & Concurrency) covers OS Process isolation vs lightweight shared-heap threads, context switching, concurrency vs parallelism, Java 21 platform vs virtual threads intro. It is required in backend engineering to Understanding how embedded Tomc...
Thread Fundamentals (Process vs Thread) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Thread Fundamentals (Process vs Thread)': Inspect active thread names, IDs, and CPU core count inside a running Java program. Include cle...
Thread Fundamentals (Process vs Thread) — Hands-On Coding Exercise
Thread current = Thread.currentThread();
System.out.printf("Thread: %s (id=%d)%n", current.getName(), current.threadId());
Implementing `Runnable` (preferred composition) vs extending `Thread`, passing lambdas to `new Thread(...)`, and Java 21 `Thread.ofVirtual()` preview
7.7 Thread Creation (Thread Class and Runnable Interface) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Thread Creation (Thread Class and Runnable Interface) (JVM & Concurrency) covers Implementing `Runnable` (preferred composition) vs extending `Thread`, passing lambdas to `new Thread(...)`, and Java 21 `Thread.ofVirtual()` preview. It is required in backend engineering to...
Thread Creation (Thread Class and Runnable Interface) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Thread Creation (Thread Class and Runnable Interface)': Create concurrent audit-log workers using `Runnable` lambdas and verify parallel...
Thread Creation (Thread Class and Runnable Interface) — Hands-On Coding Exercise
Runnable task = () -> System.out.println("Running on " + Thread.currentThread().getName());
Thread worker = new Thread(task, "audit-worker-1");
worker.start();
`Thread.State` enum: `NEW`, `RUNNABLE`, `BLOCKED`, `WAITING`, `TIMED_WAITING`, and `TERMINATED` state transitions
7.8 Thread Lifecycle States (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Thread Lifecycle States (JVM & Concurrency) covers `Thread.State` enum: `NEW`, `RUNNABLE`, `BLOCKED`, `WAITING`, `TIMED_WAITING`, and `TERMINATED` state transitions. It is required in backend engineering to Reading production thread dumps (`jstack`) to spot threads stuck in `BLOCKED` (lock contention)...
Thread Lifecycle States — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Thread Lifecycle States': Capture and print `worker.getState()` transitions from `NEW` -> `TIMED_WAITING` -> `TERMINATED`. Include clear...
Thread Lifecycle States — Hands-On Coding Exercise
Thread t = new Thread(() -> {
try { Thread.sleep(100); } catch (InterruptedException e) { Thread.currentThread().interrupt(); }
});
System.out.println(t.getState()); // NEW
Coordinating completion with `join()`, cooperative cancellation via `interrupt()` & `isInterrupted()`, and restoring interrupt status
7.9 Thread Methods (start, run, sleep, join, interrupt) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Thread Methods (start, run, sleep, join, interrupt) (JVM & Concurrency) covers Coordinating completion with `join()`, cooperative cancellation via `interrupt()` & `isInterrupted()`, and restoring interrupt status. It is required in backend engineering to Gracefully shut...
Thread Methods (start, run, sleep, join, interrupt) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Thread Methods (start, run, sleep, join, interrupt)': Coordinate 3 parallel report-generation threads with `join()` and implement clean c...
Thread Methods (start, run, sleep, join, interrupt) — Hands-On Coding Exercise
try {
Thread.sleep(250);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt(); // Always restore interrupt flag!
}
Intrinsic monitor locks, mutual exclusion + happens-before memory visibility, narrow `synchronized (lock)` blocks vs coarse method locks
7.10 Synchronization (synchronized Methods and Blocks) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Synchronization (synchronized Methods and Blocks) (JVM & Concurrency) covers Intrinsic monitor locks, mutual exclusion + happens-before memory visibility, narrow `synchronized (lock)` blocks vs coarse method locks. It is required in backend engineering to Preventing double-b...
Synchronization (synchronized Methods and Blocks) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Synchronization (synchronized Methods and Blocks)': Build a thread-safe Multithreaded Ticket Booking Simulation ensuring zero over-alloca...
Synchronization (synchronized Methods and Blocks) — Hands-On Coding Exercise
public class SeatInventory {
private final Object lock = new Object();
private int availableSeats;
public SeatInventory(int availableSeats) { this.availableSeats = availableSeats; }
public boolean bookSeat() {
synchronized (lock) {
if (availableSeats <= 0) return false;
availableSeats--;
return true;
}
}
}
Check-then-act (`if (!contains) put`) and read-modify-write (`count++`) hazards, stateless service design in Spring
7.11 Race Conditions and Shared Mutable State (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Race Conditions and Shared Mutable State (JVM & Concurrency) covers Check-then-act (`if (!contains) put`) and read-modify-write (`count++`) hazards, stateless service design in Spring. It is required in backend engineering to Keeping Spring `@Service` and `@RestController` singletons...
Race Conditions and Shared Mutable State — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Race Conditions and Shared Mutable State': Reproduce a lost-update race condition on a shared `BankAccount` across 10 threads and fix it...
Race Conditions and Shared Mutable State — Hands-On Coding Exercise
// count++ is NOT atomic: 1) read count, 2) add 1, 3) write count
// Keep singleton services stateless or protect shared state with locks/atomics.
Coffman conditions, circular lock acquisition (`Thread 1: A->B` vs `Thread 2: B->A`), consistent global lock ordering, and `ReentrantLock.tryLock(timeout)`
7.12 Deadlocks (Causes and Prevention) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Deadlocks (Causes and Prevention) (JVM & Concurrency) covers Coffman conditions, circular lock acquisition (`Thread 1: A->B` vs `Thread 2: B->A`), consistent global lock ordering, and `ReentrantLock.tryLock(timeout)`. It is required in backend engineering to Preventing deadlocks in mu...
Deadlocks (Causes and Prevention) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Deadlocks (Causes and Prevention)': Implement deadlock-free bidirectional `BankAccount` transfers using deterministic ID lock ordering. I...
Deadlocks (Causes and Prevention) — Hands-On Coding Exercise
Object firstLock = from.getId() < to.getId() ? from.lock() : to.lock();
Object secondLock = from.getId() < to.getId() ? to.lock() : from.lock();
synchronized (firstLock) {
synchronized (secondLock) { /* safe transfer */ }
}
CPU cache coherence, Java Memory Model happens-before guarantee, when `volatile` suffices (single-writer boolean flag) vs when it fails (`count++`)
7.13 volatile Keyword and Memory Visibility (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works volatile Keyword and Memory Visibility (JVM & Concurrency) covers CPU cache coherence, Java Memory Model happens-before guarantee, when `volatile` suffices (single-writer boolean flag) vs when it fails (`count++`). It is required in backend engineering to Signaling a background consume...
volatile Keyword and Memory Visibility — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'volatile Keyword and Memory Visibility': Build a background health-poller worker controlled cleanly by a `volatile boolean running` flag....
volatile Keyword and Memory Visibility — Hands-On Coding Exercise
public class Poller {
private volatile boolean running = true;
public void stop() { this.running = false; }
public void runLoop() { while (running) { /* poll */ } }
}
Lock-free Compare-And-Swap (CAS) hardware instructions, `incrementAndGet`, `compareAndSet`, `AtomicReference`, and high-contention `LongAdder`
7.14 Atomic Classes (AtomicInteger, AtomicLong, LongAdder) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Atomic Classes (AtomicInteger, AtomicLong, LongAdder) (JVM & Concurrency) covers Lock-free Compare-And-Swap (CAS) hardware instructions, `incrementAndGet`, `compareAndSet`, `AtomicReference`, and high-contention `LongAdder`. It is required in backend engineering to Track...
Atomic Classes (AtomicInteger, AtomicLong, LongAdder) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Atomic Classes (AtomicInteger, AtomicLong, LongAdder)': Benchmark `AtomicInteger.incrementAndGet()` vs `synchronized` counter across 8 co...
Atomic Classes (AtomicInteger, AtomicLong, LongAdder) — Hands-On Coding Exercise
import java.util.concurrent.atomic.AtomicLong;
public class MetricsCounter {
private final AtomicLong totalRequests = new AtomicLong();
public long recordHit() { return totalRequests.incrementAndGet(); }
}
Fixed, cached, scheduled, and custom `ThreadPoolExecutor` (corePoolSize, maxPoolSize, bounded workQueue, rejection policy) and `shutdown()`
7.15 ExecutorService and Thread Pools (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works ExecutorService and Thread Pools (JVM & Concurrency) covers Fixed, cached, scheduled, and custom `ThreadPoolExecutor` (corePoolSize, maxPoolSize, bounded workQueue, rejection policy) and `shutdown()`. It is required in backend engineering to Executing bounded parallel batch jobs and `@Async`...
ExecutorService and Thread Pools — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'ExecutorService and Thread Pools': Process 50 simulated payroll tasks across a bounded 4-thread `ExecutorService` using Java 21 `try-with...
ExecutorService and Thread Pools — Hands-On Coding Exercise
import java.util.concurrent.*;
try (ExecutorService pool = Executors.newFixedThreadPool(4)) {
pool.submit(() -> System.out.println("Processed on " + Thread.currentThread().getName()));
}
`Callable<V>` returning typed results & throwing checked exceptions, `Future.get(timeout, unit)`, `invokeAll`, and timeout handling
7.16 Callable and Future (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Callable and Future (JVM & Concurrency) covers `Callable<V>` returning typed results & throwing checked exceptions, `Future.get(timeout, unit)`, `invokeAll`, and timeout handling. It is required in backend engineering to Running parallel downstream service checks with strict SLA timeouts (`futu...
Callable and Future — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Callable and Future': Submit 4 `Callable<Double>` regional sales aggregators in parallel and combine their results with timeouts. Include...
Callable and Future — Hands-On Coding Exercise
Callable<Integer> task = () -> 42;
try (ExecutorService pool = Executors.newSingleThreadExecutor()) {
Future<Integer> future = pool.submit(task);
int answer = future.get(2, java.util.concurrent.TimeUnit.SECONDS);
}
`supplyAsync`, `thenApply`, `thenCompose`, `thenCombine`, `allOf`, `orTimeout`, and `exceptionally` non-blocking error recovery
7.17 CompletableFuture (Asynchronous Programming) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works CompletableFuture (Asynchronous Programming) (JVM & Concurrency) covers `supplyAsync`, `thenApply`, `thenCompose`, `thenCombine`, `allOf`, `orTimeout`, and `exceptionally` non-blocking error recovery. It is required in backend engineering to Fetching User Profile, Order Summary,...
CompletableFuture (Asynchronous Programming) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'CompletableFuture (Asynchronous Programming)': Combine asynchronous User + CreditScore + Offer lookups using `CompletableFuture.thenCombi...
CompletableFuture (Asynchronous Programming) — Hands-On Coding Exercise
import java.util.concurrent.*;
CompletableFuture<Double> priceF = CompletableFuture.supplyAsync(() -> 1000.0);
CompletableFuture<Double> discountF = CompletableFuture.supplyAsync(() -> 150.0);
double net = priceF.thenCombine(discountF, (p, d) -> p - d).join();
Fine-grained bucket/CAS concurrency in `ConcurrentHashMap`, atomic `computeIfAbsent`, and bounded `ArrayBlockingQueue` (`put`/`take`) for Producer-Consumer
7.18 Concurrent Collections (ConcurrentHashMap and BlockingQueue) (Week 7 • JVM & Concurrency) 1. What It Is, Why It Is Required & How It Works Concurrent Collections (ConcurrentHashMap and BlockingQueue) (JVM & Concurrency) covers Fine-grained bucket/CAS concurrency in `ConcurrentHashMap`, atomic `computeIfAbsent`, and bounded `ArrayBlockingQueue` (`put`/`take`) for Producer-Consumer. It is required in b...
Concurrent Collections (ConcurrentHashMap and BlockingQueue) — Practical Implementation Assignment
Complete and push your working JVM & Concurrency solution for 'Concurrent Collections (ConcurrentHashMap and BlockingQueue)': Implement a classic multi-producer / multi-consumer order processing pipel...
Concurrent Collections (ConcurrentHashMap and BlockingQueue) — Hands-On Coding Exercise
BlockingQueue<String> queue = new ArrayBlockingQueue<>(50);
// Producer: queue.put("ORDER-101");
// Consumer: String order = queue.take();
Develop a concurrent seat-reservation simulator and bounded `ArrayBlockingQueue` producer-consumer audit pipeline using locks, `AtomicLong` counters, `ExecutorService`, and `CompletableFuture` parallel aggregation.
Module Learning & Hands-On Objectives
Definition of an algorithm, correctness invariants, edge-case modeling, dry-running, and brute-force-to-optimal progression
8.1 Algorithm Fundamentals (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Algorithm Fundamentals (DSA in Java) covers Definition of an algorithm, correctness invariants, edge-case modeling, dry-running, and brute-force-to-optimal progression. It is required in backend engineering to Approaching unfamiliar OA and live coding interview problems methodically instead of guessing. Under the ho...
Algorithm Fundamentals — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Algorithm Fundamentals': Write brute-force and optimized Java solutions for pair-difference and array-equilibrium problems with dry-run traces....
Algorithm Fundamentals — Hands-On Coding Exercise
// Step 1: Clarify constraints (e.g. 1 <= n <= 10^5, -10^9 <= a[i] <= 10^9)
// Step 2: Baseline brute force & complexity
// Step 3: Optimize bottleneck data structure
Counting elementary operations vs input size `n`, auxiliary space vs total space, recursion call-stack space, amortized complexity
8.2 Time and Space Complexity Analysis (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Time and Space Complexity Analysis (DSA in Java) covers Counting elementary operations vs input size `n`, auxiliary space vs total space, recursion call-stack space, amortized complexity. It is required in backend engineering to Predicting whether an API endpoint or SQL-post-processing loop will time out...
Time and Space Complexity Analysis — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Time and Space Complexity Analysis': Derive exact time and auxiliary space complexity for 10 Java loop and recursive snippets. Include clear me...
Time and Space Complexity Analysis — Hands-On Coding Exercise
// ArrayList.add(e): O(n) worst-case resize, but O(1) amortized across n insertions
Asymptotic upper bounds, dropping constants & lower-order terms, input-constraint-to-acceptable-Big-O cheat sheet
8.3 Big O Notation (O(1), O(log n), O(n), O(n log n), O(n²)) (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Big O Notation (O(1), O(log n), O(n), O(n log n), O(n²)) (DSA in Java) covers Asymptotic upper bounds, dropping constants & lower-order terms, input-constraint-to-acceptable-Big-O cheat sheet. It is required in backend engineering to Knowing immediately that `n <= 10^5` requi...
Big O Notation (O(1), O(log n), O(n), O(n log n), O(n²)) — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Big O Notation (O(1), O(log n), O(n), O(n log n), O(n²))': Classify 8 algorithms across `O(1)`, `O(log n)`, `O(n)`, `O(n log n)`, and `O(n^2)`...
Big O Notation (O(1), O(log n), O(n), O(n log n), O(n²)) — Hands-On Coding Exercise
// Constraint guide: n <= 20 -> O(2^n); n <= 2000 -> O(n^2); n <= 2*10^5 -> O(n log n) or O(n)
In-place reversal algorithm for `k`-step array rotation, Kadane’s maximum subarray sum, Dutch National Flag 3-way partition
8.4 Array Problem Patterns (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Array Problem Patterns (DSA in Java) covers In-place reversal algorithm for `k`-step array rotation, Kadane’s maximum subarray sum, Dutch National Flag 3-way partition. It is required in backend engineering to Solving classic coding screening problems in `O(n)` time and `O(1)` auxiliary space. Under the hood, unders...
Array Problem Patterns — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Array Problem Patterns': Implement `O(1)`-space array right-rotation and Kadane’s maximum subarray sum in Java. Include clear method/schema nam...
Array Problem Patterns — Hands-On Coding Exercise
public static int maxSubArray(int[] nums) {
int best = nums[0], cur = nums[0];
for (int i = 1; i < nums.length; i++) {
cur = Math.max(nums[i], cur + nums[i]);
best = Math.max(best, cur);
}
return best;
}
Converging left/right pointers on sorted arrays (pair sum, container water, palindrome) and fast/slow write-read pointers (move zeroes, deduplicate)
8.5 Two Pointers Technique (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Two Pointers Technique (DSA in Java) covers Converging left/right pointers on sorted arrays (pair sum, container water, palindrome) and fast/slow write-read pointers (move zeroes, deduplicate). It is required in backend engineering to Reducing `O(n^2)` nested pair scans to `O(n)` linear passes without extra hash mem...
Two Pointers Technique — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Two Pointers Technique': Solve Sorted Two-Sum, Move Zeroes in-place, and 3Sum using Two Pointers. Include clear method/schema naming, edge-case...
Two Pointers Technique — Hands-On Coding Exercise
public static int[] twoSumSorted(int[] sorted, int target) {
int l = 0, r = sorted.length - 1;
while (l < r) {
long sum = (long) sorted[l] + sorted[r];
if (sum == target) return new int[]{l, r};
if (sum < target) l++; else r--;
}
return new int[]{-1, -1};
}
Fixed-size `k` rolling window sum/average and variable expand-shrink `[left..right]` window (longest unique substring, min-size subarray sum)
8.6 Sliding Window (Fixed and Variable Window) (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Sliding Window (Fixed and Variable Window) (DSA in Java) covers Fixed-size `k` rolling window sum/average and variable expand-shrink `[left..right]` window (longest unique substring, min-size subarray sum). It is required in backend engineering to Computing rolling 5-minute API error rates and st...
Sliding Window (Fixed and Variable Window) — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Sliding Window (Fixed and Variable Window)': Implement Maximum Sum Subarray of Size K and Longest Substring Without Repeating Characters. Inclu...
Sliding Window (Fixed and Variable Window) — Hands-On Coding Exercise
public static long maxWindowSum(int[] arr, int k) {
long window = 0;
for (int i = 0; i < k; i++) window += arr[i];
long best = window;
for (int i = k; i < arr.length; i++) {
window += arr[i] - arr[i - k];
best = Math.max(best, window);
}
return best;
}
`prefix[i]` construction for `O(1)` range sum `[L..R]`, Prefix Sum + HashMap for `Subarray Sum Equals K` (including negative numbers)
8.7 Prefix Sum and Subarray Queries (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Prefix Sum and Subarray Queries (DSA in Java) covers `prefix[i]` construction for `O(1)` range sum `[L..R]`, Prefix Sum + HashMap for `Subarray Sum Equals K` (including negative numbers). It is required in backend engineering to Answering thousands of financial date-range ledger queries in `O(1)` time after...
Prefix Sum and Subarray Queries — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Prefix Sum and Subarray Queries': Build an immutable `RangeSumQuery` class and solve `Subarray Sum Equals K` with negative integers. Include cl...
Prefix Sum and Subarray Queries — Hands-On Coding Exercise
public static int subarraySumEqualsK(int[] nums, int k) {
var seen = new java.util.HashMap<Long, Integer>();
seen.put(0L, 1);
long prefix = 0;
int count = 0;
for (int n : nums) {
prefix += n;
count += seen.getOrDefault(prefix - k, 0);
seen.merge(prefix, 1, Integer::sum);
}
return count;
}
Sequential scan vs `O(log n)` Binary Search, overflow-safe midpoint `low + (high - low) / 2`, lower-bound (first occurrence) and upper-bound
8.8 Searching (Linear and Binary Search) (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Searching (Linear and Binary Search) (DSA in Java) covers Sequential scan vs `O(log n)` Binary Search, overflow-safe midpoint `low + (high - low) / 2`, lower-bound (first occurrence) and upper-bound. It is required in backend engineering to Fast timestamp log bisection, sorted index lookups, and monoto...
Searching (Linear and Binary Search) — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Searching (Linear and Binary Search)': Implement iterative Binary Search plus First and Last Occurrence of Target in a sorted array. Include cl...
Searching (Linear and Binary Search) — Hands-On Coding Exercise
public static int binarySearch(int[] arr, int target) {
int low = 0, high = arr.length - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
if (arr[mid] == target) return mid;
if (arr[mid] < target) low = mid + 1;
else high = mid - 1;
}
return -1;
}
Swapping invariants, stability (Bubble & Insertion are stable; Selection is unstable), `O(n)` best-case adaptive Insertion Sort on nearly sorted data
8.9 Elementary Sorting (Bubble, Selection and Insertion Sort) (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Elementary Sorting (Bubble, Selection and Insertion Sort) (DSA in Java) covers Swapping invariants, stability (Bubble & Insertion are stable; Selection is unstable), `O(n)` best-case adaptive Insertion Sort on nearly sorted data. It is required in backend engineering to Underst...
Elementary Sorting (Bubble, Selection and Insertion Sort) — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Elementary Sorting (Bubble, Selection and Insertion Sort)': Implement Bubble, Selection, and Insertion Sort and verify stability on key-value r...
Elementary Sorting (Bubble, Selection and Insertion Sort) — Hands-On Coding Exercise
public static void insertionSort(int[] arr) {
for (int i = 1; i < arr.length; i++) {
int key = arr[i], j = i - 1;
while (j >= 0 && arr[j] > key) {
arr[j + 1] = arr[j--];
}
arr[j + 1] = key;
}
}
Merge Sort `O(n log n)` worst-case & stability (`O(n)` buffer) vs Quicksort Lomuto/Hoare partitioning (`O(n log n)` average, randomized pivot)
8.10 Efficient Divide-and-Conquer Sorting (Merge Sort and Quicksort) (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Efficient Divide-and-Conquer Sorting (Merge Sort and Quicksort) (DSA in Java) covers Merge Sort `O(n log n)` worst-case & stability (`O(n)` buffer) vs Quicksort Lomuto/Hoare partitioning (`O(n log n)` average, randomized pivot). It is required in backend engineering to E...
Efficient Divide-and-Conquer Sorting (Merge Sort and Quicksort) — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Efficient Divide-and-Conquer Sorting (Merge Sort and Quicksort)': Implement Merge Sort and Randomized-Pivot Quicksort and compare runtimes on 1...
Efficient Divide-and-Conquer Sorting (Merge Sort and Quicksort) — Hands-On Coding Exercise
// Merge Sort guarantees O(n log n) worst-case and preserves relative order of equal keys
Base case, recursive leap of faith, call-stack frame trace, recurrence relations, and fast exponentiation (`pow(x, n)` in `O(log n)`)
8.11 Recursion Fundamentals (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Recursion Fundamentals (DSA in Java) covers Base case, recursive leap of faith, call-stack frame trace, recurrence relations, and fast exponentiation (`pow(x, n)` in `O(log n)`). It is required in backend engineering to Traversing hierarchical category trees, org charts, and nested JSON AST structures. Under the ho...
Recursion Fundamentals — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Recursion Fundamentals': Implement recursive binary search, fast modular exponentiation, and recursive array palindrome checks. Include clear m...
Recursion Fundamentals — Hands-On Coding Exercise
public static long fastPow(long base, int exp) {
if (exp == 0) return 1L;
long half = fastPow(base, exp / 2);
return (exp % 2 == 0) ? half * half : half * half * base;
}
Choose -> Explore -> Unchoose state-space tree template, pruning invalid branches early
8.12 Backtracking (Subsets, Combinations and Permutations) (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Backtracking (Subsets, Combinations and Permutations) (DSA in Java) covers Choose -> Explore -> Unchoose state-space tree template, pruning invalid branches early. It is required in backend engineering to Generating valid schedule combinations, rule configurations, and constrain...
Backtracking (Subsets, Combinations and Permutations) — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Backtracking (Subsets, Combinations and Permutations)': Generate all Subsets (Power Set), Combinations summing to target, and Permutations of d...
Backtracking (Subsets, Combinations and Permutations) — Hands-On Coding Exercise
private static void backtrackSubsets(int[] nums, int idx, java.util.List<Integer> path, java.util.List<java.util.List<Integer>> out) {
out.add(new java.util.ArrayList<>(path));
for (int i = idx; i < nums.length; i++) {
path.add(nums[i]);
backtrackSubsets(nums, i + 1, path, out);
path.removeLast();
}
}
Custom `ListNode` implementation, dummy sentinel head technique, in-place reversal, middle node, and Floyd’s Tortoise-and-Hare cycle detection
8.13 Linked List Data Structures (Singly, Doubly and Circular) (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Linked List Data Structures (Singly, Doubly and Circular) (DSA in Java) covers Custom `ListNode` implementation, dummy sentinel head technique, in-place reversal, middle node, and Floyd’s Tortoise-and-Hare cycle detection. It is required in backend engineering to Mastering pointer...
Linked List Data Structures (Singly, Doubly and Circular) — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Linked List Data Structures (Singly, Doubly and Circular)': Implement a Singly Linked List with `reverse()`, `middleNode()`, and `hasCycle()` i...
Linked List Data Structures (Singly, Doubly and Circular) — Hands-On Coding Exercise
public static ListNode reverse(ListNode head) {
ListNode prev = null, curr = head;
while (curr != null) {
ListNode nextTemp = curr.next;
curr.next = prev;
prev = curr;
curr = nextTemp;
}
return prev;
}
Custom bounded Array Stack & Linked-Node Stack, Valid Parentheses, MinStack in `O(1)`, and Next Greater Element
8.14 Stack Implementations and Monotonic Stack Intro (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Stack Implementations and Monotonic Stack Intro (DSA in Java) covers Custom bounded Array Stack & Linked-Node Stack, Valid Parentheses, MinStack in `O(1)`, and Next Greater Element. It is required in backend engineering to Expression evaluation, syntax validation, and `O(n)` span/next-g...
Stack Implementations and Monotonic Stack Intro — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Stack Implementations and Monotonic Stack Intro': Implement `MinStack` supporting `O(1)` `push`, `pop`, `top`, and `getMin`, plus Next Greater...
Stack Implementations and Monotonic Stack Intro — Hands-On Coding Exercise
public static boolean isValidBrackets(String s) {
var stack = new java.util.ArrayDeque<Character>();
for (char c : s.toCharArray()) {
if (c == '(') stack.push(')');
else if (c == '[') stack.push(']');
else if (c == '{') stack.push('}');
else if (stack.isEmpty() || stack.pop() != c) return false;
}
return stack.isEmpty();
}
Ring-buffer Circular Queue using `(tail + 1) % capacity`, Queue using Two Stacks, and Monotonic Deque for Sliding Window Maximum
8.15 Queue Implementations (Simple, Circular and Deque) (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Queue Implementations (Simple, Circular and Deque) (DSA in Java) covers Ring-buffer Circular Queue using `(tail + 1) % capacity`, Queue using Two Stacks, and Monotonic Deque for Sliding Window Maximum. It is required in backend engineering to Understanding ring buffers used in high-throu...
Queue Implementations (Simple, Circular and Deque) — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Queue Implementations (Simple, Circular and Deque)': Implement a fixed-capacity `CircularQueue` and Queue-using-Two-Stacks (`O(1)` amortized de...
Queue Implementations (Simple, Circular and Deque) — Hands-On Coding Exercise
public class CircularIntQueue {
private final int[] buf;
private int head = 0, tail = 0, size = 0;
public CircularIntQueue(int cap) { this.buf = new int[cap]; }
public boolean enqueue(int val) {
if (size == buf.length) return false;
buf[tail] = val;
tail = (tail + 1) % buf.length;
size++;
return true;
}
}
Unsorted Two-Sum in `O(n)`, Group Anagrams, Longest Consecutive Sequence in `O(n)`, and First Non-Repeating Character
8.16 Hashing Problem Solving (HashMap and HashSet) (Week 8 • DSA in Java) 1. What It Is, Why It Is Required & How It Works Hashing Problem Solving (HashMap and HashSet) (DSA in Java) covers Unsorted Two-Sum in `O(n)`, Group Anagrams, Longest Consecutive Sequence in `O(n)`, and First Non-Repeating Character. It is required in backend engineering to Trading `O(n)` memory for `O(1)` average key lookups to eliminate...
Hashing Problem Solving (HashMap and HashSet) — Practical Implementation Assignment
Complete and push your working DSA in Java solution for 'Hashing Problem Solving (HashMap and HashSet)': Solve Unsorted Two-Sum, Group Anagrams, and Longest Consecutive Sequence in Java. Include clear...
Hashing Problem Solving (HashMap and HashSet) — Hands-On Coding Exercise
public static int[] twoSum(int[] nums, int target) {
var indexByVal = new java.util.HashMap<Integer, Integer>();
for (int i = 0; i < nums.length; i++) {
Integer match = indexByVal.get(target - nums[i]);
if (match != null) return new int[]{match, i};
indexByVal.put(nums[i], i);
}
return new int[]{-1, -1};
}
Centralized vs Distributed VCS, content-addressable snapshots (SHA-1/SHA-256), why every engineering team relies on Git
8.17 Version Control Systems Overview (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Version Control Systems Overview (Git & GitHub) covers Centralized vs Distributed VCS, content-addressable snapshots (SHA-1/SHA-256), why every engineering team relies on Git. It is required in backend engineering to Auditing who changed any line of backend code (`git blame`), rolling back bad re...
Version Control Systems Overview — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Version Control Systems Overview': Inspect `.git/HEAD` and `.git/config` inside your Mini-Project 2 repository. Include clear method/schema na...
Version Control Systems Overview — Hands-On Coding Exercise
git --version
git status -sb
`git config --global user.name`, `user.email`, `init.defaultBranch main`, `core.autocrlf` (Windows vs Linux line endings), SSH keys
8.18 Git Installation and Global Configuration (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Git Installation and Global Configuration (Git & GitHub) covers `git config --global user.name`, `user.email`, `init.defaultBranch main`, `core.autocrlf` (Windows vs Linux line endings), SSH keys. It is required in backend engineering to Preventing noisy CRLF whole-file diffs between Win...
Git Installation and Global Configuration — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Git Installation and Global Configuration': Configure global Git identity, default `main` branch, `core.autocrlf input/true`, and SSH key auth...
Git Installation and Global Configuration — Hands-On Coding Exercise
git config --global init.defaultBranch main
git config --global pull.ff only
Working Tree vs Staging Index vs Local `.git` Object DB vs Remote (`origin`), `git remote -v`
8.19 Local and Remote Repositories (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Local and Remote Repositories (Git & GitHub) covers Working Tree vs Staging Index vs Local `.git` Object DB vs Remote (`origin`), `git remote -v`. It is required in backend engineering to Understanding exactly what moves locally vs over the network during staging, committing, fetching, and pushing....
Local and Remote Repositories — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Local and Remote Repositories': Link a local Maven project to a remote GitHub `origin` and inspect remote tracking branches. Include clear met...
Local and Remote Repositories — Hands-On Coding Exercise
git remote add origin git@github.com:org/employee-management-java.git
git remote -v
Selective staging (`git add -p`), `git diff --staged`, atomic commits, and `git log --oneline --graph --decorate`
8.20 Basic Git Commands (init, status, add, diff, commit, log) (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Basic Git Commands (init, status, add, diff, commit, log) (Git & GitHub) covers Selective staging (`git add -p`), `git diff --staged`, atomic commits, and `git log --oneline --graph --decorate`. It is required in backend engineering to Reviewing every staged hunk with `gi...
Basic Git Commands (init, status, add, diff, commit, log) — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Basic Git Commands (init, status, add, diff, commit, log)': Make 5 small, atomic commits for Employee model, validation, search, stream analyt...
Basic Git Commands (init, status, add, diff, commit, log) — Hands-On Coding Exercise
git diff --staged
git log --oneline --graph --decorate -n 10
`git clone`, `git fetch` (safe metadata sync) vs `git pull` (`fetch` + `merge`/`rebase`), `git push -u origin <branch>`
8.21 Remote Git Commands (clone, fetch, pull, push) (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Remote Git Commands (clone, fetch, pull, push) (Git & GitHub) covers `git clone`, `git fetch` (safe metadata sync) vs `git pull` (`fetch` + `merge`/`rebase`), `git push -u origin <branch>`. It is required in backend engineering to Inspecting teammate updates safely via `git fe...
Remote Git Commands (clone, fetch, pull, push) — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Remote Git Commands (clone, fetch, pull, push)': Clone a repository, fetch upstream updates, and push a feature branch tracking `origin`. Incl...
Remote Git Commands (clone, fetch, pull, push) — Hands-On Coding Exercise
git fetch origin
git push -u origin feat/stream-department-report
Lightweight branch pointers, `git switch -c feat/...`, naming conventions (`feat/`, `fix/`, `chore/`), deleting merged branches
8.22 Branching (branch, switch, checkout) (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Branching (branch, switch, checkout) (Git & GitHub) covers Lightweight branch pointers, `git switch -c feat/...`, naming conventions (`feat/`, `fix/`, `chore/`), deleting merged branches. It is required in backend engineering to Isolating every Jira/GitHub ticket in its own feature branch so...
Branching (branch, switch, checkout) — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Branching (branch, switch, checkout)': Create `feat/employee-crud` and `feat/csv-export` branches for Mini-Project 2. Include clear method/sch...
Branching (branch, switch, checkout) — Hands-On Coding Exercise
git switch main
git pull
git switch -c feat/employee-search
Fast-forward vs 3-way merge commits, reading `<<<<<<< HEAD`, `=======`, `>>>>>>>` conflict markers, testing before completing merge
8.23 Merging and Resolving Merge Conflicts (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Merging and Resolving Merge Conflicts (Git & GitHub) covers Fast-forward vs 3-way merge commits, reading `<<<<<<< HEAD`, `=======`, `>>>>>>>` conflict markers, testing before completing merge. It is required in backend engineering to Cleanly combinin...
Merging and Resolving Merge Conflicts — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Merging and Resolving Merge Conflicts': Intentionally create a two-branch edit conflict on `EmployeeService.java`, resolve it cleanly, compile...
Merging and Resolving Merge Conflicts — Hands-On Coding Exercise
git switch main
git merge feat/employee-search
# If conflict: edit markers -> mvn test -> git add <file> -> git commit
`git rebase main` linear history replay, interactive rebase (`git rebase -i`) for cleaning local WIP commits, Golden Rule of Rebasing
8.24 Rebasing Fundamentals (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Rebasing Fundamentals (Git & GitHub) covers `git rebase main` linear history replay, interactive rebase (`git rebase -i`) for cleaning local WIP commits, Golden Rule of Rebasing. It is required in backend engineering to Keeping your unmerged feature branch cleanly on top of the latest `main` before opening...
Rebasing Fundamentals — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Rebasing Fundamentals': Rebase a local feature branch onto an updated `main` branch and abort/continue cleanly. Include clear method/schema na...
Rebasing Fundamentals — Hands-On Coding Exercise
git switch feat/csv-export
git fetch origin
git rebase origin/main
`git stash push -m "..."`, `git stash list`, `git stash pop`, `git stash apply`, and `-u` for untracked files
8.25 Stashing Temporary Changes (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Stashing Temporary Changes (Git & GitHub) covers `git stash push -m "..."`, `git stash list`, `git stash pop`, `git stash apply`, and `-u` for untracked files. It is required in backend engineering to Saving half-finished feature edits cleanly when an urgent production hotfix branch switch is...
Stashing Temporary Changes — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Stashing Temporary Changes': Stash in-progress stream refactoring with a message, switch branches for a hotfix, then `stash pop` cleanly. Incl...
Stashing Temporary Changes — Hands-On Coding Exercise
git stash push -u -m "WIP: salary comparator refactor"
git stash list
git stash pop
`git reset --soft / --mixed / --hard` (local history rewrite) vs `git revert <sha>` (safe inverse commit for pushed shared branches)
8.26 Reset vs Revert (Safe History Management) (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Reset vs Revert (Safe History Management) (Git & GitHub) covers `git reset --soft / --mixed / --hard` (local history rewrite) vs `git revert <sha>` (safe inverse commit for pushed shared branches). It is required in backend engineering to Rolling back a broken commit on shared `mai...
Reset vs Revert (Safe History Management) — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Reset vs Revert (Safe History Management)': Undo a pushed bug commit using `git revert` and unstage a local file using `git restore --staged`....
Reset vs Revert (Safe History Management) — Hands-On Coding Exercise
# Safe rollback on shared branch (creates a new inverse commit):
git revert HEAD --no-edit
Ignoring `target/`, `.idea/`, `.env`, `application-local.yml`, `*.log`, and removing accidentally tracked files with `git rm --cached`
8.27 .gitignore Hygiene and Secret Prevention (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works .gitignore Hygiene and Secret Prevention (Git & GitHub) covers Ignoring `target/`, `.idea/`, `.env`, `application-local.yml`, `*.log`, and removing accidentally tracked files with `git rm --cached`. It is required in backend engineering to Preventing database passwords, JWT signing keys,...
.gitignore Hygiene and Secret Prevention — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for '.gitignore Hygiene and Secret Prevention': Configure a production-grade Java/Maven/Spring/Docker `.gitignore` and test `git rm --cached`. Incl...
.gitignore Hygiene and Secret Prevention — Hands-On Coding Exercise
# Untrack an accidentally committed local config without deleting it from disk:
git rm --cached application-local.properties
Public/private repo setup, branch protection rules, Topics/tags, Releases, and GitHub Issues tracking
8.28 GitHub Repository Creation and Protection (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works GitHub Repository Creation and Protection (Git & GitHub) covers Public/private repo setup, branch protection rules, Topics/tags, Releases, and GitHub Issues tracking. It is required in backend engineering to Presenting clean, recruiter-ready portfolio repositories on GitHub with clear to...
GitHub Repository Creation and Protection — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'GitHub Repository Creation and Protection': Publish Mini-Project 2 on GitHub with issue labels and structured repository metadata. Include cle...
GitHub Repository Creation and Protection — Hands-On Coding Exercise
# Tagging a verified milestone release:
git tag -a v1.0.0 -m "Month 2 Deliverable: Employee Management v1.0"
git push origin v1.0.0
Opening descriptive PRs (Problem, Solution, Testing Done), line-by-line review comments, resolving conversations, Squash & Merge
8.29 Pull Requests and Code Review Workflow (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Pull Requests and Code Review Workflow (Git & GitHub) covers Opening descriptive PRs (Problem, Solution, Testing Done), line-by-line review comments, resolving conversations, Squash & Merge. It is required in backend engineering to Working identically to agile backend engineering teams...
Pull Requests and Code Review Workflow — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Pull Requests and Code Review Workflow': Open at least 3 feature Pull Requests for Mini-Project 2 with self-review checklists before merging....
Pull Requests and Code Review Workflow — Hands-On Coding Exercise
## PR Summary
- Add department-wise salary analytics via Java Streams
## Verification
- Tested empty list, duplicate salaries, and CSV export round-trip
Trunk-based / GitHub Flow feature branching, syncing with `origin/main`, pair code reviews, and avoiding long-lived drift branches
8.30 Team Collaboration and Feature-Branch Workflow (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Team Collaboration and Feature-Branch Workflow (Git & GitHub) covers Trunk-based / GitHub Flow feature branching, syncing with `origin/main`, pair code reviews, and avoiding long-lived drift branches. It is required in backend engineering to Collaborating smoothly across microservic...
Team Collaboration and Feature-Branch Workflow — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Team Collaboration and Feature-Branch Workflow': Simulate a two-feature parallel workflow merging sequential PRs cleanly into `main`. Include...
Team Collaboration and Feature-Branch Workflow — Hands-On Coding Exercise
git fetch origin
git rebase origin/main
# Run tests locally before requesting PR review
Imperative Conventional Commits (`feat:`, `fix:`, `refactor:`, `test:`, `docs:`), architecture diagrams, setup commands, and sample CLI/API output in README
8.31 Git Best Practices (Conventional Commits & Engineering README) (Week 8 • Git & GitHub) 1. What It Is, Why It Is Required & How It Works Git Best Practices (Conventional Commits & Engineering README) (Git & GitHub) covers Imperative Conventional Commits (`feat:`, `fix:`, `refactor:`, `test:`, `docs:`), architecture diagrams, setup commands, and sample CLI/API output in README. It is required i...
Git Best Practices (Conventional Commits & Engineering README) — Practical Implementation Assignment
Complete and push your working Git & GitHub solution for 'Git Best Practices (Conventional Commits & Engineering README)': Write a comprehensive `README.md` for Mini-Project 2 with prerequisites, buil...
Git Best Practices (Conventional Commits & Engineering README) — Hands-On Coding Exercise
git commit -m "feat(payroll): group employees by department and export summary CSV"
Develop an enterprise-style Core Java 21 Employee Management Application utilizing OOP, `HashMap`/`ArrayList`/`TreeSet` Collections, `Comparator` sorting, Java Stream API analytics, `Optional`, NIO.2 CSV file persistence, and a multi-branch GitHub Pull Request workflow.
Module Learning & Hands-On Objectives
File systems vs DBMS vs RDBMS, Codd’s relational model, PostgreSQL vs MySQL overview, client-server connection lifecycle
9.1 Database, DBMS and RDBMS Introduction (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Database, DBMS and RDBMS Introduction (PostgreSQL & SQL) covers File systems vs DBMS vs RDBMS, Codd’s relational model, PostgreSQL vs MySQL overview, client-server connection lifecycle. It is required in backend engineering to Choosing PostgreSQL as the system-of-record store for financia...
Database, DBMS and RDBMS Introduction — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Database, DBMS and RDBMS Introduction': Connect to PostgreSQL via `psql`/DBeaver, inspect version/catalog tables, and create the `academy_...
Database, DBMS and RDBMS Introduction — Hands-On Coding Exercise
SELECT version(), current_database(), current_user;
Schemas, tables (relations), rows (tuples), columns (attributes), primary keys, foreign keys, and catalog metadata
9.2 Relational Database Architecture (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Relational Database Architecture (PostgreSQL & SQL) covers Schemas, tables (relations), rows (tuples), columns (attributes), primary keys, foreign keys, and catalog metadata. It is required in backend engineering to Isolating multi-module tables cleanly inside PostgreSQL schemas (`hr`, `payrol...
Relational Database Architecture — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Relational Database Architecture': Create `hr` schema and inspect table metadata via `information_schema.columns`. Include clear method/sc...
Relational Database Architecture — Hands-On Coding Exercise
CREATE SCHEMA IF NOT EXISTS hr;
`BIGINT`, `INTEGER`, `NUMERIC(p,s)`, `VARCHAR(n)`, `TEXT`, `BOOLEAN`, `DATE`, `TIMESTAMPTZ`, `UUID`, and `JSONB` overview
9.3 SQL Data Types (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works SQL Data Types (PostgreSQL & SQL) covers `BIGINT`, `INTEGER`, `NUMERIC(p,s)`, `VARCHAR(n)`, `TEXT`, `BOOLEAN`, `DATE`, `TIMESTAMPTZ`, `UUID`, and `JSONB` overview. It is required in backend engineering to Using `NUMERIC(12,2)` for exact money amounts and `TIMESTAMPTZ` for timezone-safe UTC timestamps. Under the...
SQL Data Types — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'SQL Data Types': Select optimal PostgreSQL data types for `employees`, `departments`, and `salary_ledgers`. Include clear method/schema na...
SQL Data Types — Hands-On Coding Exercise
-- Always use NUMERIC(12,2) for money and TIMESTAMPTZ for instants in PostgreSQL
DDL (`CREATE/ALTER/DROP/TRUNCATE`), DML (`INSERT/UPDATE/DELETE`), DQL (`SELECT`), DCL (`GRANT/REVOKE`), TCL (`BEGIN/COMMIT/ROLLBACK`)
9.4 SQL Command Categories (DDL, DML, DQL, DCL and TCL) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works SQL Command Categories (DDL, DML, DQL, DCL and TCL) (PostgreSQL & SQL) covers DDL (`CREATE/ALTER/DROP/TRUNCATE`), DML (`INSERT/UPDATE/DELETE`), DQL (`SELECT`), DCL (`GRANT/REVOKE`), TCL (`BEGIN/COMMIT/ROLLBACK`). It is required in backend engineering to Separating Flyway/Liq...
SQL Command Categories (DDL, DML, DQL, DCL and TCL) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'SQL Command Categories (DDL, DML, DQL, DCL and TCL)': Classify and execute representative DDL, DML, DQL, DCL, and TCL statements in `hr`....
SQL Command Categories (DDL, DML, DQL, DCL and TCL) — Hands-On Coding Exercise
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA hr TO app_backend;
`CREATE TABLE`, `GENERATED ALWAYS AS IDENTITY`, `ALTER TABLE ADD/ALTER/DROP COLUMN`, `DROP TABLE IF EXISTS`, `TRUNCATE`
9.5 Database and Table Creation (CREATE, ALTER, DROP) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Database and Table Creation (CREATE, ALTER, DROP) (PostgreSQL & SQL) covers `CREATE TABLE`, `GENERATED ALWAYS AS IDENTITY`, `ALTER TABLE ADD/ALTER/DROP COLUMN`, `DROP TABLE IF EXISTS`, `TRUNCATE`. It is required in backend engineering to Writing repeatable, forward-compatible...
Database and Table Creation (CREATE, ALTER, DROP) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Database and Table Creation (CREATE, ALTER, DROP)': Create `departments` and `employees` tables and evolve `employees` with an `ALTER TABL...
Database and Table Creation (CREATE, ALTER, DROP) — Hands-On Coding Exercise
CREATE TABLE hr.departments (
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
code VARCHAR(16) NOT NULL UNIQUE,
name VARCHAR(120) NOT NULL
);
Multi-row `INSERT ... RETURNING`, targeted `UPDATE ... WHERE`, safe `DELETE ... WHERE`, and `ON CONFLICT` upserts
9.6 Data Manipulation (INSERT, UPDATE, DELETE) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Data Manipulation (INSERT, UPDATE, DELETE) (PostgreSQL & SQL) covers Multi-row `INSERT ... RETURNING`, targeted `UPDATE ... WHERE`, safe `DELETE ... WHERE`, and `ON CONFLICT` upserts. It is required in backend engineering to Fetching generated IDs in one round-trip with `INSERT ... R...
Data Manipulation (INSERT, UPDATE, DELETE) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Data Manipulation (INSERT, UPDATE, DELETE)': Seed 15 employees across 4 departments, update salaries for a department, and test `RETURNING...
Data Manipulation (INSERT, UPDATE, DELETE) — Hands-On Coding Exercise
INSERT INTO hr.departments (code, name)
VALUES ('ENG', 'Backend Engineering')
RETURNING id, code;
Explicit column projection (avoiding `SELECT *`), column aliases, computed expressions, `COALESCE`, and `DISTINCT`
9.7 Data Retrieval (SELECT and DISTINCT) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Data Retrieval (SELECT and DISTINCT) (PostgreSQL & SQL) covers Explicit column projection (avoiding `SELECT *`), column aliases, computed expressions, `COALESCE`, and `DISTINCT`. It is required in backend engineering to Fetching only required DTO columns over the network to reduce database...
Data Retrieval (SELECT and DISTINCT) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Data Retrieval (SELECT and DISTINCT)': Project employee compensation summaries using `COALESCE(bonus, 0)` and list distinct active locatio...
Data Retrieval (SELECT and DISTINCT) — Hands-On Coding Exercise
SELECT id, full_name, salary + COALESCE(bonus, 0) AS total_comp
FROM hr.employees;
Predicate evaluation, operator precedence (`AND` binds tighter than `OR`!), explicit parentheses, and boolean filtering
9.8 Filtering Rows (WHERE, AND, OR, NOT) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Filtering Rows (WHERE, AND, OR, NOT) (PostgreSQL & SQL) covers Predicate evaluation, operator precedence (`AND` binds tighter than `OR`!), explicit parentheses, and boolean filtering. It is required in backend engineering to Building accurate search filters in HR and e-commerce product cat...
Filtering Rows (WHERE, AND, OR, NOT) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Filtering Rows (WHERE, AND, OR, NOT)': Filter active Engineering/Platform employees earning above ₹60,000 using properly parenthesized pre...
Filtering Rows (WHERE, AND, OR, NOT) — Hands-On Coding Exercise
SELECT id, full_name, salary
FROM hr.employees
WHERE is_active = TRUE AND (department_id = 1 OR department_id = 2) AND salary >= 60000;
Set membership `IN`, inclusive range `BETWEEN`, wildcard `LIKE` (`%`, `_`) / PostgreSQL `ILIKE`, and three-valued `NULL` logic (`IS NULL` / `IS NOT NULL`)
9.9 SQL Operators (IN, BETWEEN, LIKE, ILIKE, IS NULL) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works SQL Operators (IN, BETWEEN, LIKE, ILIKE, IS NULL) (PostgreSQL & SQL) covers Set membership `IN`, inclusive range `BETWEEN`, wildcard `LIKE` (`%`, `_`) / PostgreSQL `ILIKE`, and three-valued `NULL` logic (`IS NULL` / `IS NOT NULL`). It is required in backend engineering to Impl...
SQL Operators (IN, BETWEEN, LIKE, ILIKE, IS NULL) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'SQL Operators (IN, BETWEEN, LIKE, ILIKE, IS NULL)': Query top-level managers (`manager_id IS NULL`), mid-band salaries (`BETWEEN`), and em...
SQL Operators (IN, BETWEEN, LIKE, ILIKE, IS NULL) — Hands-On Coding Exercise
SELECT id, full_name FROM hr.employees
WHERE manager_id IS NULL AND email ILIKE '%@mockattempt.com';
Multi-column `ASC`/`DESC` sorting, `NULLS LAST` / `NULLS FIRST`, deterministic tie-breaker columns (`ORDER BY salary DESC, id ASC`)
9.10 Sorting Results (ORDER BY) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Sorting Results (ORDER BY) (PostgreSQL & SQL) covers Multi-column `ASC`/`DESC` sorting, `NULLS LAST` / `NULLS FIRST`, deterministic tie-breaker columns (`ORDER BY salary DESC, id ASC`). It is required in backend engineering to Preventing duplicate or skipped records across paginated API pages by al...
Sorting Results (ORDER BY) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Sorting Results (ORDER BY)': Order employees by bonus `DESC NULLS LAST`, salary `DESC`, and `id ASC`. Include clear method/schema naming,...
Sorting Results (ORDER BY) — Hands-On Coding Exercise
SELECT id, full_name, bonus, salary
FROM hr.employees
ORDER BY bonus DESC NULLS LAST, salary DESC, id ASC;
`COUNT(*)` vs `COUNT(column)` (ignores NULLs) vs `COUNT(DISTINCT col)`, `SUM`, `ROUND(AVG(...), 2)`, `MIN`, `MAX`, `FILTER (WHERE ...)`
9.11 Aggregation Functions (COUNT, SUM, AVG, MIN, MAX) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Aggregation Functions (COUNT, SUM, AVG, MIN, MAX) (PostgreSQL & SQL) covers `COUNT(*)` vs `COUNT(column)` (ignores NULLs) vs `COUNT(DISTINCT col)`, `SUM`, `ROUND(AVG(...), 2)`, `MIN`, `MAX`, `FILTER (WHERE ...)`. It is required in backend engineering to Generating dashboard K...
Aggregation Functions (COUNT, SUM, AVG, MIN, MAX) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Aggregation Functions (COUNT, SUM, AVG, MIN, MAX)': Compute company-wide headcount, assigned-manager count, total payroll, and min/avg/max...
Aggregation Functions (COUNT, SUM, AVG, MIN, MAX) — Hands-On Coding Exercise
SELECT COUNT(*) AS total_staff,
COUNT(manager_id) AS with_manager,
ROUND(AVG(salary), 2) AS avg_salary
FROM hr.employees;
Grouping keys, non-aggregated column rule, pre-aggregation `WHERE` filtering vs post-aggregation `HAVING` filtering
9.12 Grouping Data (GROUP BY and HAVING) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Grouping Data (GROUP BY and HAVING) (PostgreSQL & SQL) covers Grouping keys, non-aggregated column rule, pre-aggregation `WHERE` filtering vs post-aggregation `HAVING` filtering. It is required in backend engineering to Finding departments with more than 5 active employees or average salar...
Grouping Data (GROUP BY and HAVING) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Grouping Data (GROUP BY and HAVING)': List departments with >= 3 active employees and total payroll > ₹2,50,000 ordered by average salary....
Grouping Data (GROUP BY and HAVING) — Hands-On Coding Exercise
SELECT department_id, COUNT(*) AS headcount, SUM(salary) AS payroll
FROM hr.employees
WHERE is_active = TRUE
GROUP BY department_id
HAVING COUNT(*) >= 3 AND SUM(salary) > 250000;
Declarative data integrity, `ON DELETE RESTRICT / CASCADE / SET NULL`, `CHECK (salary > 0)`, composite unique constraints
9.13 Integrity Constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Integrity Constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL) (PostgreSQL & SQL) covers Declarative data integrity, `ON DELETE RESTRICT / CASCADE / SET NULL`, `CHECK (salary > 0)`, composite unique constraints. It is required in backend...
Integrity Constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Integrity Constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL)': Add `FOREIGN KEY`, `UNIQUE (email)`, and `CHECK (salary >= 0)`...
Integrity Constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL) — Hands-On Coding Exercise
ALTER TABLE hr.employees
ADD CONSTRAINT fk_emp_dept FOREIGN KEY (department_id) REFERENCES hr.departments(id) ON DELETE RESTRICT,
ADD CONSTRAINT chk_positive_salary CHECK (salary >= 0);
One-to-One (`employee_profiles` unique FK), One-to-Many (`departments` -> `employees`), Many-to-Many (`employees` <-> `projects` via composite-PK join table)
9.14 Entity Relationships (1:1, 1:N and M:N) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Entity Relationships (1:1, 1:N and M:N) (PostgreSQL & SQL) covers One-to-One (`employee_profiles` unique FK), One-to-Many (`departments` -> `employees`), Many-to-Many (`employees` <-> `projects` via composite-PK join table). It is required in backend engineering to Designing c...
Entity Relationships (1:1, 1:N and M:N) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Entity Relationships (1:1, 1:N and M:N)': Create `projects` and `employee_projects` (M:N) tables with composite primary key `(employee_id,...
Entity Relationships (1:1, 1:N and M:N) — Hands-On Coding Exercise
CREATE TABLE hr.employee_projects (
employee_id BIGINT NOT NULL REFERENCES hr.employees(id) ON DELETE CASCADE,
project_id BIGINT NOT NULL REFERENCES hr.projects(id) ON DELETE CASCADE,
allocation_pct INT NOT NULL DEFAULT 100 CHECK (allocation_pct BETWEEN 1 AND 100),
PRIMARY KEY (employee_id, project_id)
);
ANSI `JOIN ... ON` syntax, preserving unmatched left rows with `LEFT JOIN`, finding anti-joins (`LEFT JOIN ... WHERE right.id IS NULL`), `FULL OUTER JOIN`
9.15 SQL Joins (INNER, LEFT, RIGHT and FULL OUTER JOIN) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works SQL Joins (INNER, LEFT, RIGHT and FULL OUTER JOIN) (PostgreSQL & SQL) covers ANSI `JOIN ... ON` syntax, preserving unmatched left rows with `LEFT JOIN`, finding anti-joins (`LEFT JOIN ... WHERE right.id IS NULL`), `FULL OUTER JOIN`. It is required in backend engineering to L...
SQL Joins (INNER, LEFT, RIGHT and FULL OUTER JOIN) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'SQL Joins (INNER, LEFT, RIGHT and FULL OUTER JOIN)': Write INNER, LEFT (including 0-employee departments), and anti-join (unassigned proje...
SQL Joins (INNER, LEFT, RIGHT and FULL OUTER JOIN) — Hands-On Coding Exercise
SELECT d.name, COUNT(e.id) AS active_count
FROM hr.departments d
LEFT JOIN hr.employees e ON e.department_id = d.id AND e.is_active = TRUE
GROUP BY d.id, d.name;
Joining a table to itself using mandatory table aliases (`emp` vs `mgr`) to query hierarchical parent-child rows
9.16 Self Joins (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Self Joins (PostgreSQL & SQL) covers Joining a table to itself using mandatory table aliases (`emp` vs `mgr`) to query hierarchical parent-child rows. It is required in backend engineering to Listing every employee alongside their reporting manager’s name (including CEO via `LEFT JOIN`). Under the hood, understand...
Self Joins — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Self Joins': Query employees with their manager name and identify employees earning more than their direct manager. Include clear method/s...
Self Joins — Hands-On Coding Exercise
SELECT e.full_name AS employee, COALESCE(m.full_name, 'Board / Top Level') AS manager
FROM hr.employees e
LEFT JOIN hr.employees m ON m.id = e.manager_id;
Scalar subqueries (`salary > (SELECT AVG(salary)...)`), `IN` subqueries, derived inline tables in `FROM`, and `NOT IN` NULL trap!
9.17 Subqueries (Scalar and Multi-Row) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Subqueries (Scalar and Multi-Row) (PostgreSQL & SQL) covers Scalar subqueries (`salary > (SELECT AVG(salary)...)`), `IN` subqueries, derived inline tables in `FROM`, and `NOT IN` NULL trap!. It is required in backend engineering to Comparing individual performance or pricing against compa...
Subqueries (Scalar and Multi-Row) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Subqueries (Scalar and Multi-Row)': Find employees earning above company average and non-manager employees safely using `NOT EXISTS`. Incl...
Subqueries (Scalar and Multi-Row) — Hands-On Coding Exercise
SELECT id, full_name, salary
FROM hr.employees
WHERE salary > (SELECT AVG(salary) FROM hr.employees);
Outer-row-dependent subqueries, `EXISTS` / `NOT EXISTS` short-circuit semi-joins, and comparing against per-department averages
9.18 Correlated Subqueries and EXISTS (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Correlated Subqueries and EXISTS (PostgreSQL & SQL) covers Outer-row-dependent subqueries, `EXISTS` / `NOT EXISTS` short-circuit semi-joins, and comparing against per-department averages. It is required in backend engineering to Finding employees earning above *their own department’s* average...
Correlated Subqueries and EXISTS — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Correlated Subqueries and EXISTS': Write correlated subqueries for above-department-average earners and `EXISTS` checks for project-assign...
Correlated Subqueries and EXISTS — Hands-On Coding Exercise
SELECT e.id, e.full_name, e.department_id, e.salary
FROM hr.employees e
WHERE e.salary > (
SELECT AVG(e2.salary) FROM hr.employees e2 WHERE e2.department_id = e.department_id
);
Column-count & type compatibility, deduplicating `UNION` vs fast `UNION ALL`, common rows `INTERSECT`, and set difference `EXCEPT`
9.19 Set Operations (UNION, UNION ALL, INTERSECT, EXCEPT) (Week 9 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Set Operations (UNION, UNION ALL, INTERSECT, EXCEPT) (PostgreSQL & SQL) covers Column-count & type compatibility, deduplicating `UNION` vs fast `UNION ALL`, common rows `INTERSECT`, and set difference `EXCEPT`. It is required in backend engineering to Combining active...
Set Operations (UNION, UNION ALL, INTERSECT, EXCEPT) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Set Operations (UNION, UNION ALL, INTERSECT, EXCEPT)': Combine current and archived employee records with `UNION ALL` and find skills gap...
Set Operations (UNION, UNION ALL, INTERSECT, EXCEPT) — Hands-On Coding Exercise
SELECT email FROM hr.employees WHERE is_active = TRUE
EXCEPT
SELECT email FROM hr.security_training_completions;
Author a complete PostgreSQL DDL schema (`departments`, `employees`, `projects`, `employee_projects`) with PK/FK/UNIQUE/CHECK constraints and 40 analytical queries covering INNER/LEFT/SELF joins, aggregations, correlated subqueries, and set operations.
Module Learning & Hands-On Objectives
Atomic attributes (1NF), eliminating partial dependencies on composite keys (2NF), eliminating transitive dependencies (3NF), and Boyce-Codd Normal Form (BCNF)
10.1 Database Normalization (1NF, 2NF, 3NF and BCNF) (Week 10 • Database Design) 1. What It Is, Why It Is Required & How It Works Database Normalization (1NF, 2NF, 3NF and BCNF) (Database Design) covers Atomic attributes (1NF), eliminating partial dependencies on composite keys (2NF), eliminating transitive dependencies (3NF), and Boyce-Codd Normal Form (BCNF). It is required in backend engineering to Eliminating...
Database Normalization (1NF, 2NF, 3NF and BCNF) — Practical Implementation Assignment
Complete and push your working Database Design solution for 'Database Normalization (1NF, 2NF, 3NF and BCNF)': Normalize a flat 18-column college/payroll spreadsheet step-by-step into 3NF/BCNF Postgre...
Database Normalization (1NF, 2NF, 3NF and BCNF) — Hands-On Coding Exercise
-- 3NF: Move department_name & head_email out of employees into departments(id, name, head_email)
Read-heavy vs write-heavy trade-offs, snapshotting historical facts (`order_items.unit_price_at_purchase`), summary caches
10.2 Strategic Denormalization (Week 10 • Database Design) 1. What It Is, Why It Is Required & How It Works Strategic Denormalization (Database Design) covers Read-heavy vs write-heavy trade-offs, snapshotting historical facts (`order_items.unit_price_at_purchase`), summary caches. It is required in backend engineering to Storing `unit_price` snapshot on `order_items` so future catalog price edits never alter his...
Strategic Denormalization — Practical Implementation Assignment
Complete and push your working Database Design solution for 'Strategic Denormalization': Identify which columns in an E-Commerce invoice schema MUST be snapshotted vs normalized. Include clear method/...
Strategic Denormalization — Hands-On Coding Exercise
-- Snapshot unit_price_paise on order_items at checkout time to preserve historical invoice accuracy
B-Tree structure (`O(log n)`), composite index leftmost-prefix rule `(department_id, salary)`, unique & partial indexes, write/storage overhead
10.3 Database Indexes (Single-Column, Composite and Unique) (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Database Indexes (Single-Column, Composite and Unique) (PostgreSQL & SQL) covers B-Tree structure (`O(log n)`), composite index leftmost-prefix rule `(department_id, salary)`, unique & partial indexes, write/storage overhead. It is required in backend engineering to...
Database Indexes (Single-Column, Composite and Unique) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Database Indexes (Single-Column, Composite and Unique)': Create FK and composite `(department_id, is_active, salary DESC)` indexes on 100k...
Database Indexes (Single-Column, Composite and Unique) — Hands-On Coding Exercise
CREATE INDEX idx_emp_dept_active_salary
ON hr.employees (department_id, is_active, salary DESC);
`Seq Scan` vs `Index Scan` vs `Index Only Scan` vs `Bitmap Heap Scan`, `Nested Loop` / `Hash Join` / `Merge Join`, estimated vs actual rows
10.4 Query Execution Plans (EXPLAIN and EXPLAIN ANALYZE) (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Query Execution Plans (EXPLAIN and EXPLAIN ANALYZE) (PostgreSQL & SQL) covers `Seq Scan` vs `Index Scan` vs `Index Only Scan` vs `Bitmap Heap Scan`, `Nested Loop` / `Hash Join` / `Merge Join`, estimated vs actual rows. It is required in backend engineering to Proving with...
Query Execution Plans (EXPLAIN and EXPLAIN ANALYZE) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Query Execution Plans (EXPLAIN and EXPLAIN ANALYZE)': Compare `EXPLAIN (ANALYZE, BUFFERS)` output before and after adding a composite inde...
Query Execution Plans (EXPLAIN and EXPLAIN ANALYZE) — Hands-On Coding Exercise
EXPLAIN (ANALYZE, BUFFERS)
SELECT id, full_name FROM hr.employees
WHERE department_id = 3 AND is_active = TRUE
ORDER BY salary DESC LIMIT 20;
SARGable predicates (avoiding functions on indexed columns like `LOWER(email)` without functional index), avoiding `SELECT *`, covering indexes
10.5 SQL Query Optimization (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works SQL Query Optimization (PostgreSQL & SQL) covers SARGable predicates (avoiding functions on indexed columns like `LOWER(email)` without functional index), avoiding `SELECT *`, covering indexes. It is required in backend engineering to Rewriting `WHERE EXTRACT(YEAR FROM created_at) = 2026` into a SARGa...
SQL Query Optimization — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'SQL Query Optimization': Refactor 5 non-SARGable slow SQL queries so PostgreSQL switches from `Seq Scan` to `Index Scan`. Include clear me...
SQL Query Optimization — Hands-On Coding Exercise
-- SARGable date filter uses index on hired_at:
SELECT id FROM hr.employees
WHERE hired_at >= DATE '2026-01-01' AND hired_at < DATE '2027-01-01';
`CREATE OR REPLACE VIEW`, security column masking (hiding salary/PII), simplifying complex reusable joins
10.6 Database Views (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Database Views (PostgreSQL & SQL) covers `CREATE OR REPLACE VIEW`, security column masking (hiding salary/PII), simplifying complex reusable joins. It is required in backend engineering to Exposing a clean `v_public_employee_directory` view without sensitive payroll columns to reporting consumers. Under the h...
Database Views — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Database Views': Create `hr.v_department_headcount_summary` and query it from SQL. Include clear method/schema naming, edge-case validatio...
Database Views — Hands-On Coding Exercise
CREATE OR REPLACE VIEW hr.v_employee_directory AS
SELECT e.id, e.full_name, e.email, d.name AS department_name
FROM hr.employees e JOIN hr.departments d ON d.id = e.department_id
WHERE e.is_active = TRUE;
`CREATE MATERIALIZED VIEW`, persisted query results on disk, indexing materialized views, `REFRESH MATERIALIZED VIEW CONCURRENTLY`
10.7 Materialized Views (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Materialized Views (PostgreSQL & SQL) covers `CREATE MATERIALIZED VIEW`, persisted query results on disk, indexing materialized views, `REFRESH MATERIALIZED VIEW CONCURRENTLY`. It is required in backend engineering to Precomputing heavy analytical dashboards refreshed every 15 minutes instead of scanning...
Materialized Views — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Materialized Views': Create a Materialized View with a unique index on `department_id` and refresh it `CONCURRENTLY`. Include clear method...
Materialized Views — Hands-On Coding Exercise
CREATE MATERIALIZED VIEW hr.mv_dept_stats AS
SELECT department_id, COUNT(*) AS staff_count, AVG(salary) AS avg_sal
FROM hr.employees GROUP BY department_id;
CREATE UNIQUE INDEX idx_mv_dept ON hr.mv_dept_stats(department_id);
PostgreSQL `CREATE PROCEDURE` (`plpgsql`), `CALL`, transactional control inside procedures, when logic belongs in Java Service vs DB procedure
10.8 Stored Procedures (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Stored Procedures (PostgreSQL & SQL) covers PostgreSQL `CREATE PROCEDURE` (`plpgsql`), `CALL`, transactional control inside procedures, when logic belongs in Java Service vs DB procedure. It is required in backend engineering to Executing bulk archival or data-cleanup DBA routines close to the data engine....
Stored Procedures — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Stored Procedures': Write and invoke a `CALL hr.archive_inactive_employees(cutoff_date)` stored procedure. Include clear method/schema nam...
Stored Procedures — Hands-On Coding Exercise
CREATE OR REPLACE PROCEDURE hr.give_department_hike(p_dept_id BIGINT, p_pct NUMERIC)
LANGUAGE plpgsql AS $$
BEGIN
UPDATE hr.employees SET salary = salary * (1 + p_pct / 100.0) WHERE department_id = p_dept_id;
END; $$;
Scalar and table-returning functions (`CREATE FUNCTION ... RETURNS`), SQL vs PL/pgSQL functions, `IMMUTABLE` / `STABLE` / `VOLATILE` markers
10.9 User-Defined SQL Functions (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works User-Defined SQL Functions (PostgreSQL & SQL) covers Scalar and table-returning functions (`CREATE FUNCTION ... RETURNS`), SQL vs PL/pgSQL functions, `IMMUTABLE` / `STABLE` / `VOLATILE` markers. It is required in backend engineering to Encapsulating reusable fiscal-year or net-compensation calcula...
User-Defined SQL Functions — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'User-Defined SQL Functions': Create an `IMMUTABLE` fiscal-quarter helper function in PostgreSQL and test it in `SELECT`. Include clear met...
User-Defined SQL Functions — Hands-On Coding Exercise
CREATE OR REPLACE FUNCTION hr.annual_ctc(p_monthly NUMERIC, p_bonus NUMERIC)
RETURNS NUMERIC LANGUAGE sql IMMUTABLE AS $$
SELECT (p_monthly * 12) + COALESCE(p_bonus, 0);
$$;
`BEFORE` vs `AFTER` row/statement triggers, `NEW` and `OLD` record variables, automated `updated_at` stamping and immutable audit tables
10.10 Database Triggers (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Database Triggers (PostgreSQL & SQL) covers `BEFORE` vs `AFTER` row/statement triggers, `NEW` and `OLD` record variables, automated `updated_at` stamping and immutable audit tables. It is required in backend engineering to Recording tamper-evident salary-change audit rows automatically whenever `hr.employ...
Database Triggers — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Database Triggers': Create an `AFTER UPDATE OF salary` trigger that logs old and new salary into `hr.salary_audit_log`. Include clear meth...
Database Triggers — Hands-On Coding Exercise
-- Trigger logs OLD.salary -> NEW.salary into hr.salary_audit_log whenever salary changes
All-or-nothing atomic work units, `BEGIN`, `COMMIT`, `ROLLBACK`, partial rollback with `SAVEPOINT`, and avoiding idle-in-transaction sessions
10.11 Transactions (BEGIN, COMMIT, ROLLBACK and SAVEPOINT) (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Transactions (BEGIN, COMMIT, ROLLBACK and SAVEPOINT) (PostgreSQL & SQL) covers All-or-nothing atomic work units, `BEGIN`, `COMMIT`, `ROLLBACK`, partial rollback with `SAVEPOINT`, and avoiding idle-in-transaction sessions. It is required in backend engineering to Ensuring...
Transactions (BEGIN, COMMIT, ROLLBACK and SAVEPOINT) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Transactions (BEGIN, COMMIT, ROLLBACK and SAVEPOINT)': Execute a multi-statement fund-transfer transaction testing both `COMMIT` and simul...
Transactions (BEGIN, COMMIT, ROLLBACK and SAVEPOINT) — Hands-On Coding Exercise
BEGIN;
UPDATE hr.accounts SET balance = balance - 5000 WHERE id = 1;
UPDATE hr.accounts SET balance = balance + 5000 WHERE id = 2;
COMMIT;
Atomicity (WAL undo/abort), Consistency (constraints/invariants), Isolation (MVCC concurrency), and Durability (WAL fsync crash recovery)
10.12 ACID Properties (Week 10 • Database Design) 1. What It Is, Why It Is Required & How It Works ACID Properties (Database Design) covers Atomicity (WAL undo/abort), Consistency (constraints/invariants), Isolation (MVCC concurrency), and Durability (WAL fsync crash recovery). It is required in backend engineering to Explaining in backend interviews *how* PostgreSQL guarantees zero corrupted balances across powe...
ACID Properties — Practical Implementation Assignment
Complete and push your working Database Design solution for 'ACID Properties': Map each ACID letter to its concrete PostgreSQL mechanism (WAL, constraints, MVCC, commit flush). Include clear method/sc...
ACID Properties — Hands-On Coding Exercise
-- PostgreSQL uses MVCC (Multi-Version Concurrency Control): readers never block writers, writers never block readers
Dirty Read, Non-Repeatable Read, Phantom Read, Write Skew; Read Uncommitted, Read Committed (PostgreSQL default), Repeatable Read (MySQL InnoDB default), Serializable
10.13 Transaction Isolation Levels (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Transaction Isolation Levels (PostgreSQL & SQL) covers Dirty Read, Non-Repeatable Read, Phantom Read, Write Skew; Read Uncommitted, Read Committed (PostgreSQL default), Repeatable Read (MySQL InnoDB default), Serializable. It is required in backend engineering to Preventing concurrent double-sp...
Transaction Isolation Levels — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Transaction Isolation Levels': Open two `psql` sessions side-by-side to observe `READ COMMITTED` vs `REPEATABLE READ` snapshot behavior. I...
Transaction Isolation Levels — Hands-On Coding Exercise
BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ;
SELECT balance FROM hr.accounts WHERE id = 1;
COMMIT;
Row-level `FOR SHARE` vs `FOR UPDATE`, `FOR UPDATE SKIP LOCKED` (job queues), pessimistic vs optimistic concurrency control
10.14 Database Locking (Shared and Exclusive Locks) (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Database Locking (Shared and Exclusive Locks) (PostgreSQL & SQL) covers Row-level `FOR SHARE` vs `FOR UPDATE`, `FOR UPDATE SKIP LOCKED` (job queues), pessimistic vs optimistic concurrency control. It is required in backend engineering to Locking an inventory or wallet row with...
Database Locking (Shared and Exclusive Locks) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Database Locking (Shared and Exclusive Locks)': Prevent concurrent seat double-booking across two DB sessions using `SELECT ... FOR UPDATE...
Database Locking (Shared and Exclusive Locks) — Hands-On Coding Exercise
BEGIN;
SELECT available_seats FROM bookings.shows WHERE id = 42 FOR UPDATE;
UPDATE bookings.shows SET available_seats = available_seats - 1 WHERE id = 42;
COMMIT;
Cross-row lock cycles between two transactions, PostgreSQL deadlock detector (`deadlock_timeout`), automatic victim abort (`SQLSTATE 40P01`), consistent primary-key update ordering
10.15 Database Deadlocks (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Database Deadlocks (PostgreSQL & SQL) covers Cross-row lock cycles between two transactions, PostgreSQL deadlock detector (`deadlock_timeout`), automatic victim abort (`SQLSTATE 40P01`), consistent primary-key update ordering. It is required in backend engineering to Sorting item IDs ascending before bat...
Database Deadlocks — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Database Deadlocks': Reproduce a 2-session PostgreSQL deadlock, observe `40P01`, and eliminate it by ordering `id ASC` first. Include clea...
Database Deadlocks — Hands-On Coding Exercise
-- Always lock multiple rows in deterministic ascending primary-key order to prevent DB deadlocks
Why `OFFSET 100000 LIMIT 20` still scans & discards 100,000 rows, vs `O(log n)` Keyset/Cursor pagination (`WHERE (created_at, id) < (?, ?)`)
10.16 Efficient SQL Pagination (LIMIT/OFFSET vs Keyset Seek) (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Efficient SQL Pagination (LIMIT/OFFSET vs Keyset Seek) (PostgreSQL & SQL) covers Why `OFFSET 100000 LIMIT 20` still scans & discards 100,000 rows, vs `O(log n)` Keyset/Cursor pagination (`WHERE (created_at, id) < (?, ?)`). It is required in backend engineering t...
Efficient SQL Pagination (LIMIT/OFFSET vs Keyset Seek) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Efficient SQL Pagination (LIMIT/OFFSET vs Keyset Seek)': Implement both `LIMIT/OFFSET` (admin table) and Keyset cursor pagination `(salary...
Efficient SQL Pagination (LIMIT/OFFSET vs Keyset Seek) — Hands-On Coding Exercise
SELECT id, full_name, salary
FROM hr.employees
WHERE (salary, id) < (85000.00, 1042)
ORDER BY salary DESC, id DESC
LIMIT 20;
`OVER (PARTITION BY ... ORDER BY ...)`, Top-N per group (`DENSE_RANK`), running totals (`SUM(...) OVER`), month-over-month deltas (`LAG`/`LEAD`)
10.17 Window Functions (ROW_NUMBER, RANK, DENSE_RANK, LEAD, LAG) (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Window Functions (ROW_NUMBER, RANK, DENSE_RANK, LEAD, LAG) (PostgreSQL & SQL) covers `OVER (PARTITION BY ... ORDER BY ...)`, Top-N per group (`DENSE_RANK`), running totals (`SUM(...) OVER`), month-over-month deltas (`LAG`/`LEAD`). It is required in backend engineer...
Window Functions (ROW_NUMBER, RANK, DENSE_RANK, LEAD, LAG) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Window Functions (ROW_NUMBER, RANK, DENSE_RANK, LEAD, LAG)': Write Top-3 earners per department (`DENSE_RANK`), running payroll totals, an...
Window Functions (ROW_NUMBER, RANK, DENSE_RANK, LEAD, LAG) — Hands-On Coding Exercise
WITH ranked AS (
SELECT id, full_name, department_id, salary,
DENSE_RANK() OVER (PARTITION BY department_id ORDER BY salary DESC) AS rnk
FROM hr.employees
)
SELECT * FROM ranked WHERE rnk <= 3;
`WITH` readable modular queries, multi-CTE pipelines, `WITH RECURSIVE` anchor + recursive union for org-chart & category hierarchies
10.18 Common Table Expressions (CTEs and Recursive CTEs) (Week 10 • PostgreSQL & SQL) 1. What It Is, Why It Is Required & How It Works Common Table Expressions (CTEs and Recursive CTEs) (PostgreSQL & SQL) covers `WITH` readable modular queries, multi-CTE pipelines, `WITH RECURSIVE` anchor + recursive union for org-chart & category hierarchies. It is required in backend engineering to Traversing an arb...
Common Table Expressions (CTEs and Recursive CTEs) — Practical Implementation Assignment
Complete and push your working PostgreSQL & SQL solution for 'Common Table Expressions (CTEs and Recursive CTEs)': Traverse a 4-level CEO -> VP -> Manager -> Engineer org chart using `WITH RECURSIVE`....
Common Table Expressions (CTEs and Recursive CTEs) — Hands-On Coding Exercise
WITH RECURSIVE org_tree AS (
SELECT id, full_name, manager_id, 1 AS depth FROM hr.employees WHERE manager_id IS NULL
UNION ALL
SELECT e.id, e.full_name, e.manager_id, t.depth + 1
FROM hr.employees e JOIN org_tree t ON e.manager_id = t.id WHERE t.depth < 10
)
SELECT * FROM org_tree;
Normalize an unnormalized enterprise dataset into 3NF/BCNF, benchmark composite B-Tree indexes on 100k rows using `EXPLAIN ANALYZE`, and build Top-N per department `DENSE_RANK` + `WITH RECURSIVE` org-chart queries.
Module Learning & Hands-On Objectives
`java.sql` / `javax.sql` interfaces vs vendor driver implementations (`org.postgresql:postgresql`), 6-step query lifecycle
11.1 JDBC Architecture and Workflow (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works JDBC Architecture and Workflow (Java JDBC) covers `java.sql` / `javax.sql` interfaces vs vendor driver implementations (`org.postgresql:postgresql`), 6-step query lifecycle. It is required in backend engineering to Understanding the exact foundational layer beneath Spring `JdbcClient`, `JdbcTemplate`, MyBati...
JDBC Architecture and Workflow — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'JDBC Architecture and Workflow': Add `org.postgresql:postgresql` to `pom.xml` and verify connectivity to local PostgreSQL. Include clear method/s...
JDBC Architecture and Workflow — Hands-On Coding Exercise
// pom.xml dependency: org.postgresql:postgresql (Type-4 pure Java JDBC driver)
Historical Driver Types 1–4, why pure-Java Type-4 drivers dominate production, automatic `ServiceLoader` discovery (no `Class.forName` needed)
11.2 JDBC Drivers and Modern SPI Loading (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works JDBC Drivers and Modern SPI Loading (Java JDBC) covers Historical Driver Types 1–4, why pure-Java Type-4 drivers dominate production, automatic `ServiceLoader` discovery (no `Class.forName` needed). It is required in backend engineering to Configuring clean JDBC URLs (`jdbc:postgresql://localhost:5432/a...
JDBC Drivers and Modern SPI Loading — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'JDBC Drivers and Modern SPI Loading': Configure JDBC URL, username, and password externally via environment variables / properties. Include clear...
JDBC Drivers and Modern SPI Loading — Hands-On Coding Exercise
String url = System.getenv().getOrDefault("DB_URL", "jdbc:postgresql://localhost:5432/academy_hr");
`DriverManager.getConnection`, network TCP/TLS handshake cost, connection validation (`isValid`), and externalized credentials
11.3 Establishing Database Connections (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works Establishing Database Connections (Java JDBC) covers `DriverManager.getConnection`, network TCP/TLS handshake cost, connection validation (`isValid`), and externalized credentials. It is required in backend engineering to Verifying database reachability at startup and keeping secrets out of Git. Under the...
Establishing Database Connections — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'Establishing Database Connections': Write a `DatabaseConfig` helper reading `DB_URL`, `DB_USER`, and `DB_PASSWORD` safely. Include clear method/s...
Establishing Database Connections — Hands-On Coding Exercise
try (var conn = java.sql.DriverManager.getConnection(url, user, pass)) {
System.out.println("Connected: " + conn.getMetaData().getDatabaseProductVersion());
}
`Connection.createStatement()`, `executeQuery` vs `executeUpdate` vs `execute`, and why `Statement` must NEVER take user input
11.4 Statement Interface and Static DDL/SQL (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works Statement Interface and Static DDL/SQL (Java JDBC) covers `Connection.createStatement()`, `executeQuery` vs `executeUpdate` vs `execute`, and why `Statement` must NEVER take user input. It is required in backend engineering to Running fixed, parameterless schema bootstrap scripts in integration test...
Statement Interface and Static DDL/SQL — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'Statement Interface and Static DDL/SQL': Execute a static schema check via `Statement` and identify why dynamic inputs require `PreparedStatement...
Statement Interface and Static DDL/SQL — Hands-On Coding Exercise
// ONLY use Statement for fixed static SQL with zero external variables
`?` positional placeholders (1-based index!), `setLong`, `setString`, `setBigDecimal`, `setObject`, server-side plan reuse, `RETURN_GENERATED_KEYS`
11.5 PreparedStatement and Parameterized Queries (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works PreparedStatement and Parameterized Queries (Java JDBC) covers `?` positional placeholders (1-based index!), `setLong`, `setString`, `setBigDecimal`, `setObject`, server-side plan reuse, `RETURN_GENERATED_KEYS`. It is required in backend engineering to Executing 100% injection-safe parameterized...
PreparedStatement and Parameterized Queries — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'PreparedStatement and Parameterized Queries': Implement parameterized `insertEmployee` returning the generated `id` via `Statement.RETURN_GENERAT...
PreparedStatement and Parameterized Queries — Hands-On Coding Exercise
String sql = "INSERT INTO hr.employees(full_name, email, salary, department_id) VALUES (?, ?, ?, ?)";
try (var ps = conn.prepareStatement(sql, java.sql.Statement.RETURN_GENERATED_KEYS)) {
ps.setString(1, name);
ps.setString(2, email);
ps.setBigDecimal(3, salary);
ps.setLong(4, deptId);
ps.executeUpdate();
}
`prepareCall("CALL hr.give_department_hike(?, ?)")`, `IN` / `OUT` / `INOUT` parameters, `registerOutParameter`
11.6 CallableStatement (Calling Stored Procedures & Functions) (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works CallableStatement (Calling Stored Procedures & Functions) (Java JDBC) covers `prepareCall("CALL hr.give_department_hike(?, ?)")`, `IN` / `OUT` / `INOUT` parameters, `registerOutParameter`. It is required in backend engineering to Invoking PostgreSQL stored procedu...
CallableStatement (Calling Stored Procedures & Functions) — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'CallableStatement (Calling Stored Procedures & Functions)': Invoke `hr.give_department_hike` from Java using `CallableStatement`. Include clear m...
CallableStatement (Calling Stored Procedures & Functions) — Hands-On Coding Exercise
try (var cs = conn.prepareCall("CALL hr.give_department_hike(?, ?)")) {
cs.setLong(1, deptId);
cs.setBigDecimal(2, java.math.BigDecimal.valueOf(10.0));
cs.execute();
}
Forward-only cursor `rs.next()`, column-name getters (`getLong("id")`, `getBigDecimal("salary")`, `getObject("hired_at", LocalDate.class)`), handling SQL `NULL` (`wasNull` / `getObject`)
11.7 ResultSet Navigation and Row Mapping (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works ResultSet Navigation and Row Mapping (Java JDBC) covers Forward-only cursor `rs.next()`, column-name getters (`getLong("id")`, `getBigDecimal("salary")`, `getObject("hired_at", LocalDate.class)`), handling SQL `NULL` (`wasNull` / `getObject`). It is required in backend eng...
ResultSet Navigation and Row Mapping — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'ResultSet Navigation and Row Mapping': Write a clean `mapRow(ResultSet rs)` method mapping nullable `manager_id` and `LocalDate` columns accurate...
ResultSet Navigation and Row Mapping — Hands-On Coding Exercise
Long managerId = rs.getObject("manager_id", Long.class); // Returns null cleanly when SQL value is NULL!
java.time.LocalDate hiredAt = rs.getObject("hired_at", java.time.LocalDate.class);
Complete Create, Read-by-ID (`Optional<Employee>`), Read-All-Paginated, Update (checking affected row count), and Delete repository operations
11.8 JDBC CRUD Operations (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works JDBC CRUD Operations (Java JDBC) covers Complete Create, Read-by-ID (`Optional<Employee>`), Read-All-Paginated, Update (checking affected row count), and Delete repository operations. It is required in backend engineering to Implementing deterministic data access methods with explicit affected-row verification....
JDBC CRUD Operations — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'JDBC CRUD Operations': Implement all 5 CRUD methods (`save`, `findById`, `findAll`, `updateSalary`, `deleteById`) for `EmployeeDao`. Include clea...
JDBC CRUD Operations — Hands-On Coding Exercise
int rows = ps.executeUpdate();
if (rows == 0) {
throw new EmployeeNotFoundException(employeeId);
}
`addBatch()`, `executeBatch()`, PostgreSQL `reWriteBatchedInserts=true` driver flag, chunking batches of 500–1,000 rows
11.9 JDBC Batch Processing (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works JDBC Batch Processing (Java JDBC) covers `addBatch()`, `executeBatch()`, PostgreSQL `reWriteBatchedInserts=true` driver flag, chunking batches of 500–1,000 rows. It is required in backend engineering to Importing 10,000 payroll rows in ~50ms via batched network round-trips instead of 10,000 individual round-trips (~8...
JDBC Batch Processing — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'JDBC Batch Processing': Bulk-insert 1,000 employees in chunks of 250 with `addBatch()`/`executeBatch()` and `reWriteBatchedInserts=true`. Include...
JDBC Batch Processing — Hands-On Coding Exercise
int count = 0;
for (var emp : employees) {
ps.setString(1, emp.name());
ps.addBatch();
if (++count % 250 == 0) ps.executeBatch();
}
ps.executeBatch();
`conn.setAutoCommit(false)`, executing multiple `PreparedStatement`s on the SAME `Connection`, `conn.commit()`, `conn.rollback()` in `catch`, restoring autoCommit
11.10 JDBC Transaction Management (Commit and Rollback) (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works JDBC Transaction Management (Commit and Rollback) (Java JDBC) covers `conn.setAutoCommit(false)`, executing multiple `PreparedStatement`s on the SAME `Connection`, `conn.commit()`, `conn.rollback()` in `catch`, restoring autoCommit. It is required in backend engineering to Transferring bu...
JDBC Transaction Management (Commit and Rollback) — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'JDBC Transaction Management (Commit and Rollback)': Implement an atomic department-transfer + audit-insert service method with explicit rollback...
JDBC Transaction Management (Commit and Rollback) — Hands-On Coding Exercise
conn.setAutoCommit(false);
try {
debitPs.executeUpdate();
creditPs.executeUpdate();
conn.commit();
} catch (Exception ex) {
conn.rollback();
throw ex;
}
Why connection creation is expensive, pool sizing formula (`connections = (core_count * 2) + disk_spindles`), `maximumPoolSize`, `connectionTimeout`, leak detection
11.11 Connection Pooling Concepts and HikariCP (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works Connection Pooling Concepts and HikariCP (Java JDBC) covers Why connection creation is expensive, pool sizing formula (`connections = (core_count * 2) + disk_spindles`), `maximumPoolSize`, `connectionTimeout`, leak detection. It is required in backend engineering to Configuring HikariCP (Spring Bo...
Connection Pooling Concepts and HikariCP — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'Connection Pooling Concepts and HikariCP': Add `com.zaxxer:HikariCP` and configure a pooled `HikariDataSource` with sensible timeouts. Include cl...
Connection Pooling Concepts and HikariCP — Hands-On Coding Exercise
var cfg = new com.zaxxer.hikari.HikariConfig();
cfg.setJdbcUrl(url);
cfg.setMaximumPoolSize(10);
cfg.setConnectionTimeout(5000);
Injecting `DataSource` into DAOs instead of `DriverManager`, swapping H2/Testcontainers in tests vs HikariCP PostgreSQL in prod
11.12 javax.sql.DataSource Abstraction (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works javax.sql.DataSource Abstraction (Java JDBC) covers Injecting `DataSource` into DAOs instead of `DriverManager`, swapping H2/Testcontainers in tests vs HikariCP PostgreSQL in prod. It is required in backend engineering to Making DAO classes 100% decoupled from connection creation so integration tests inje...
javax.sql.DataSource Abstraction — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'javax.sql.DataSource Abstraction': Refactor `EmployeeDao` to accept `javax.sql.DataSource` via constructor injection. Include clear method/schema...
javax.sql.DataSource Abstraction — Hands-On Coding Exercise
public class JdbcEmployeeDao {
private final javax.sql.DataSource dataSource;
public JdbcEmployeeDao(javax.sql.DataSource dataSource) { this.dataSource = dataSource; }
}
How tautology (`' OR '1'='1`), UNION-based, and stacked-query injections work, bind-parameter separation of SQL AST from data, whitelist validation for dynamic `ORDER BY` column names
11.13 SQL Injection Vulnerabilities and Prevention (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works SQL Injection Vulnerabilities and Prevention (Java JDBC) covers How tautology (`' OR '1'='1`), UNION-based, and stacked-query injections work, bind-parameter separation of SQL AST from data, whitelist validation for dynamic `ORDER BY` column names. It is required in backend...
SQL Injection Vulnerabilities and Prevention — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'SQL Injection Vulnerabilities and Prevention': Fix a vulnerable search/sort DAO using `PreparedStatement` bind parameters + an allow-listed sort...
SQL Injection Vulnerabilities and Prevention — Hands-On Coding Exercise
private static final java.util.Set<String> ALLOWED_SORT = java.util.Set.of("salary", "full_name", "hired_at");
String safeSort = ALLOWED_SORT.contains(sortCol) ? sortCol : "id";
Interface `EmployeeDao` + `JdbcEmployeeDao` implementation, separating SQL persistence from domain service rules
11.14 DAO (Data Access Object) Design Pattern (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works DAO (Data Access Object) Design Pattern (Java JDBC) covers Interface `EmployeeDao` + `JdbcEmployeeDao` implementation, separating SQL persistence from domain service rules. It is required in backend engineering to Keeping SQL strings isolated in the persistence layer so Month 3 Week 12 can swap in...
DAO (Data Access Object) Design Pattern — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'DAO (Data Access Object) Design Pattern': Design `EmployeeDao` and `DepartmentDao` interfaces with clean domain return types (`Optional<Employee>...
DAO (Data Access Object) Design Pattern — Hands-On Coding Exercise
public interface EmployeeDao {
Employee save(Employee employee);
java.util.Optional<Employee> findById(long id);
java.util.List<Employee> findByDepartment(long departmentId, int limit, int offset);
}
`e.getSQLState()`, PostgreSQL unique violation (`23505`) & foreign-key violation (`23503`), wrapping checked `SQLException` into meaningful unchecked `DataAccessException`
11.15 SQLException Handling and SQLState Codes (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works SQLException Handling and SQLState Codes (Java JDBC) covers `e.getSQLState()`, PostgreSQL unique violation (`23505`) & foreign-key violation (`23503`), wrapping checked `SQLException` into meaningful unchecked `DataAccessException`. It is required in backend engineering to Translating PostgreS...
SQLException Handling and SQLState Codes — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'SQLException Handling and SQLState Codes': Translate SQLState `23505` and `23503` into typed domain exceptions in `JdbcEmployeeDao`. Include clea...
SQLException Handling and SQLState Codes — Hands-On Coding Exercise
if ("23505".equals(sqlEx.getSQLState())) {
throw new DuplicateEmailException("Email already registered", sqlEx);
}
Nested automatic closing order (`ResultSet` -> `PreparedStatement` -> `Connection` returned to pool), suppressed exceptions
11.16 Try-With-Resources in JDBC (Week 11 • Java JDBC) 1. What It Is, Why It Is Required & How It Works Try-With-Resources in JDBC (Java JDBC) covers Nested automatic closing order (`ResultSet` -> `PreparedStatement` -> `Connection` returned to pool), suppressed exceptions. It is required in backend engineering to Guaranteeing zero connection leaks back to HikariCP even when SQL queries throw exceptions. Un...
Try-With-Resources in JDBC — Practical Implementation Assignment
Complete and push your working Java JDBC solution for 'Try-With-Resources in JDBC': Audit every method in your JDBC Employee Database App to ensure 100% `try-with-resources` coverage. Include clear me...
Try-With-Resources in JDBC — Hands-On Coding Exercise
try (var conn = dataSource.getConnection();
var ps = conn.prepareStatement("SELECT id, full_name FROM hr.employees WHERE id = ?")) {
ps.setLong(1, id);
try (var rs = ps.executeQuery()) {
return rs.next() ? java.util.Optional.of(mapRow(rs)) : java.util.Optional.empty();
}
}
Create a HikariCP-pooled JDBC Employee & Department persistence application implementing the DAO pattern, parameterized `PreparedStatement` CRUD, batch imports, manual ACID commit/rollback, and `try-with-resources`.
Module Learning & Hands-On Objectives
Object graph vs relational tables impedance mismatch (granularity, inheritance, associations, navigation), pros & pitfalls of ORM
12.1 ORM (Object-Relational Mapping) Concepts (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works ORM (Object-Relational Mapping) Concepts (JPA & Hibernate) covers Object graph vs relational tables impedance mismatch (granularity, inheritance, associations, navigation), pros & pitfalls of ORM. It is required in backend engineering to Eliminating repetitive CRUD mapping boilerp...
ORM (Object-Relational Mapping) Concepts — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'ORM (Object-Relational Mapping) Concepts': Compare the lines of code and SQL emitted between `JdbcEmployeeDao` (Week 11) and a JPA `EntityM...
ORM (Object-Relational Mapping) Concepts — Hands-On Coding Exercise
// ORM maps Java domain classes <-> PostgreSQL tables while tracking entity changes in a Persistence Context
`SessionFactory` (`EntityManagerFactory`), `Session` (`EntityManager`), `Transaction`, JDBC/HikariCP integration, PostgreSQL dialect, DDL validation (`validate` vs `update`)
12.2 Hibernate 6 Architecture and Configuration (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Hibernate 6 Architecture and Configuration (JPA & Hibernate) covers `SessionFactory` (`EntityManagerFactory`), `Session` (`EntityManager`), `Transaction`, JDBC/HikariCP integration, PostgreSQL dialect, DDL validation (`validate` vs `update`). It is required in backend engineering to...
Hibernate 6 Architecture and Configuration — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Hibernate 6 Architecture and Configuration': Configure Hibernate 6 against PostgreSQL `academy_hr` with SQL logging and schema `validate` m...
Hibernate 6 Architecture and Configuration — Hands-On Coding Exercise
// Production rule: use Flyway/SQL migrations for DDL + hibernate.hbm2ddl.auto = validate
`jakarta.persistence.*` standard API vs Hibernate provider implementation, portability, and `javax` -> `jakarta` namespace in Java 17/21 & Spring Boot 3
12.3 Jakarta Persistence (JPA) Specification vs Hibernate (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Jakarta Persistence (JPA) Specification vs Hibernate (JPA & Hibernate) covers `jakarta.persistence.*` standard API vs Hibernate provider implementation, portability, and `javax` -> `jakarta` namespace in Java 17/21 & Spring Boot 3. It is required in backend engineer...
Jakarta Persistence (JPA) Specification vs Hibernate — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Jakarta Persistence (JPA) Specification vs Hibernate': Verify `jakarta.persistence` imports and bootstrap a standalone `EntityManagerFactor...
Jakarta Persistence (JPA) Specification vs Hibernate — Hands-On Coding Exercise
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
`@Entity` rules (protected/public no-arg constructor, non-final class), Transient -> Managed -> Detached -> Removed states
12.4 Entity Classes and Entity Lifecycle (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Entity Classes and Entity Lifecycle (JPA & Hibernate) covers `@Entity` rules (protected/public no-arg constructor, non-final class), Transient -> Managed -> Detached -> Removed states. It is required in backend engineering to Understanding why modifying a Managed entity inside a t...
Entity Classes and Entity Lifecycle — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Entity Classes and Entity Lifecycle': Write clean `@Entity` classes for `Department` and `Employee` and trace all 4 lifecycle states. Inclu...
Entity Classes and Entity Lifecycle — Hands-On Coding Exercise
@Entity
@Table(name = "departments", schema = "hr")
public class Department {
@Id @jakarta.persistence.GeneratedValue(strategy = jakarta.persistence.GenerationType.IDENTITY)
private Long id;
private String code;
private String name;
protected Department() {}
}
`EntityManager` thread-unsafety (one per request/transaction), unit-of-work transactional write-behind, `flush()`, `clear()`, `detach()`
12.5 EntityManager and Persistence Context Operations (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works EntityManager and Persistence Context Operations (JPA & Hibernate) covers `EntityManager` thread-unsafety (one per request/transaction), unit-of-work transactional write-behind, `flush()`, `clear()`, `detach()`. It is required in backend engineering to Batch-persisting entitie...
EntityManager and Persistence Context Operations — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'EntityManager and Persistence Context Operations': Trace when Hibernate actually sends `INSERT`/`UPDATE` SQL to PostgreSQL during a transac...
EntityManager and Persistence Context Operations — Hands-On Coding Exercise
// EntityManager buffers SQL writes until transaction commit or explicit em.flush()
`persist` (new entity), `find` vs `getReference` (lazy proxy), `merge` (returns managed copy!), and `remove`
12.6 Persistence Operations (persist, find, merge, remove) (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Persistence Operations (persist, find, merge, remove) (JPA & Hibernate) covers `persist` (new entity), `find` vs `getReference` (lazy proxy), `merge` (returns managed copy!), and `remove`. It is required in backend engineering to Using `em.getReference(Department.class, d...
Persistence Operations (persist, find, merge, remove) — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Persistence Operations (persist, find, merge, remove)': Implement `persist`, `find`, `getReference` FK linking, `merge`, and `remove` in an...
Persistence Operations (persist, find, merge, remove) — Hands-On Coding Exercise
Department deptRef = em.getReference(Department.class, deptId); // Zero SELECT needed just to set FK!
employee.assignDepartment(deptRef);
em.persist(employee);
`GenerationType.IDENTITY`, `SEQUENCE` (`@SequenceGenerator` with `allocationSize` for JDBC batching!), `UUID`
12.7 Primary Key Identifier Generation Strategies (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Primary Key Identifier Generation Strategies (JPA & Hibernate) covers `GenerationType.IDENTITY`, `SEQUENCE` (`@SequenceGenerator` with `allocationSize` for JDBC batching!), `UUID`. It is required in backend engineering to Choosing PostgreSQL `SEQUENCE` when high-throughput Hiberna...
Primary Key Identifier Generation Strategies — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Primary Key Identifier Generation Strategies': Compare `IDENTITY` vs PostgreSQL `SEQUENCE` SQL logs during a 50-entity batch persist. Inclu...
Primary Key Identifier Generation Strategies — Hands-On Coding Exercise
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "emp_seq")
@SequenceGenerator(name = "emp_seq", sequenceName = "hr.employee_id_seq", allocationSize = 25)
private Long id;
Owning side (holds `@JoinColumn` FK) vs inverse `mappedBy` side, bidirectional helper methods (`addEmployee`), `@JoinTable` vs explicit join entity
12.8 Entity Relationships (OneToOne, OneToMany, ManyToOne, ManyToMany) (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Entity Relationships (OneToOne, OneToMany, ManyToOne, ManyToMany) (JPA & Hibernate) covers Owning side (holds `@JoinColumn` FK) vs inverse `mappedBy` side, bidirectional helper methods (`addEmployee`), `@JoinTable` vs explicit join entity. It is required in ba...
Entity Relationships (OneToOne, OneToMany, ManyToOne, ManyToMany) — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Entity Relationships (OneToOne, OneToMany, ManyToOne, ManyToMany)': Map bidirectional `Department` <-> `Employee` and `Employee` <-> `Proje...
Entity Relationships (OneToOne, OneToMany, ManyToOne, ManyToMany) — Hands-On Coding Exercise
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@jakarta.persistence.JoinColumn(name = "department_id", nullable = false)
private Department department;
Schema/index metadata on `@Table`, `@Column(nullable, length, unique, precision, scale)`, `@Enumerated(EnumType.STRING)`
12.9 Mapping Annotations (@Table, @Column, @JoinColumn, @Enumerated) (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Mapping Annotations (@Table, @Column, @JoinColumn, @Enumerated) (JPA & Hibernate) covers Schema/index metadata on `@Table`, `@Column(nullable, length, unique, precision, scale)`, `@Enumerated(EnumType.STRING)`. It is required in backend engineering to Persisting...
Mapping Annotations (@Table, @Column, @JoinColumn, @Enumerated) — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Mapping Annotations (@Table, @Column, @JoinColumn, @Enumerated)': Annotate `EmploymentStatus` with `@Enumerated(EnumType.STRING)` and `sala...
Mapping Annotations (@Table, @Column, @JoinColumn, @Enumerated) — Hands-On Coding Exercise
@Enumerated(jakarta.persistence.EnumType.STRING)
@Column(name = "status", nullable = false, length = 24)
private EmploymentStatus status;
JPA defaults (`@ManyToOne`/`@OneToOne` default to EAGER!; `@OneToMany`/`@ManyToMany` default to LAZY), why ALL associations should be `LAZY`, `LazyInitializationException`
12.10 Fetching Strategies (Lazy vs Eager Loading) (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Fetching Strategies (Lazy vs Eager Loading) (JPA & Hibernate) covers JPA defaults (`@ManyToOne`/`@OneToOne` default to EAGER!; `@OneToMany`/`@ManyToMany` default to LAZY), why ALL associations should be `LAZY`, `LazyInitializationException`. It is required in backend engineering t...
Fetching Strategies (Lazy vs Eager Loading) — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Fetching Strategies (Lazy vs Eager Loading)': Override `@ManyToOne` to `LAZY`, reproduce `LazyInitializationException`, and fix it cleanly...
Fetching Strategies (Lazy vs Eager Loading) — Hands-On Coding Exercise
// Golden JPA Rule: Set FetchType.LAZY on @ManyToOne and @OneToOne; fetch associations per use-case via JOIN FETCH or DTOs
`CascadeType.PERSIST`, `MERGE`, `REMOVE`, `ALL`, `orphanRemoval = true` on true parent-child aggregates (`Order` -> `OrderItem`)
12.11 Cascading and Orphan Removal (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Cascading and Orphan Removal (JPA & Hibernate) covers `CascadeType.PERSIST`, `MERGE`, `REMOVE`, `ALL`, `orphanRemoval = true` on true parent-child aggregates (`Order` -> `OrderItem`). It is required in backend engineering to Saving an `Order` together with its `OrderItem` children atomically...
Cascading and Orphan Removal — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Cascading and Orphan Removal': Configure `CascadeType.ALL` + `orphanRemoval = true` on `Employee` -> `EmergencyContact` while keeping `Depa...
Cascading and Orphan Removal — Hands-On Coding Exercise
@OneToMany(mappedBy = "order", cascade = CascadeType.ALL, orphanRemoval = true)
private List<OrderItem> items = new ArrayList<>();
Entity/field-centric query syntax, named `:param` bindings, `JOIN` / `LEFT JOIN FETCH`, constructor DTO expressions (`SELECT new ...EmployeeSummaryDto(...)`)
12.12 JPQL (Java Persistence Query Language) (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works JPQL (Java Persistence Query Language) (JPA & Hibernate) covers Entity/field-centric query syntax, named `:param` bindings, `JOIN` / `LEFT JOIN FETCH`, constructor DTO expressions (`SELECT new ...EmployeeSummaryDto(...)`). It is required in backend engineering to Projecting read-only s...
JPQL (Java Persistence Query Language) — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'JPQL (Java Persistence Query Language)': Write JPQL queries with named parameters and `SELECT new` record DTO projections for Mini-Project...
JPQL (Java Persistence Query Language) — Hands-On Coding Exercise
String jpql = """
SELECT new com.mockattempt.ems.dto.EmployeeRow(e.id, e.fullName, d.name, e.salary)
FROM Employee e JOIN e.department d
WHERE d.code = :deptCode AND e.salary >= :minSalary
ORDER BY e.salary DESC
""";
`createNativeQuery`, mapping scalar/tuple projections, when to drop down to PostgreSQL-specific SQL (window functions, recursive CTEs, bulk upserts)
12.13 Native SQL Queries through JPA (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Native SQL Queries through JPA (JPA & Hibernate) covers `createNativeQuery`, mapping scalar/tuple projections, when to drop down to PostgreSQL-specific SQL (window functions, recursive CTEs, bulk upserts). It is required in backend engineering to Running PostgreSQL recursive org-chart CTEs or...
Native SQL Queries through JPA — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Native SQL Queries through JPA': Execute the Top-3 earners per department PostgreSQL window query via `createNativeQuery`. Include clear me...
Native SQL Queries through JPA — Hands-On Coding Exercise
var rows = em.createNativeQuery("SELECT department_id, COUNT(*) FROM hr.employees GROUP BY department_id").getResultList();
Method-name query derivation concepts (`findByEmailIgnoreCase`, `existsByCode`, `findByDepartmentIdAndActiveTrue`), keeping method names readable vs `@Query`
12.14 Derived Repository Query Fundamentals (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Derived Repository Query Fundamentals (JPA & Hibernate) covers Method-name query derivation concepts (`findByEmailIgnoreCase`, `existsByCode`, `findByDepartmentIdAndActiveTrue`), keeping method names readable vs `@Query`. It is required in backend engineering to Preparing seamlessly for...
Derived Repository Query Fundamentals — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Derived Repository Query Fundamentals': Design clean repository method contracts for Mini-Project 3 (`findByEmail`, `searchByDepartmentAndK...
Derived Repository Query Fundamentals — Hands-On Coding Exercise
// Clean rule: <= 2 predicates -> derived method name; >= 3 predicates or joins -> explicit JPQL @Query
Read-write vs read-only transactions, why all writes require an active transaction, rollback on `RuntimeException`, keeping transactions short
12.15 JPA Transaction Boundaries (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works JPA Transaction Boundaries (JPA & Hibernate) covers Read-write vs read-only transactions, why all writes require an active transaction, rollback on `RuntimeException`, keeping transactions short. It is required in backend engineering to Marking read-only query transactions so Hibernate skips dirty...
JPA Transaction Boundaries — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'JPA Transaction Boundaries': Implement a reusable `inTransaction(Consumer<EntityManager>)` helper for Mini-Project 3. Include clear method/...
JPA Transaction Boundaries — Hands-On Coding Exercise
// Read-only queries skip Hibernate dirty-checking snapshot comparisons for faster throughput
Session-scoped identity map (`em.find(Emp, 1)` twice fires only ONE `SELECT`), repeatable entity reference identity (`e1 == e2`), write-behind flushing
12.16 Persistence Context and First-Level (L1) Cache (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Persistence Context and First-Level (L1) Cache (JPA & Hibernate) covers Session-scoped identity map (`em.find(Emp, 1)` twice fires only ONE `SELECT`), repeatable entity reference identity (`e1 == e2`), write-behind flushing. It is required in backend engineering to Guaranteeing...
Persistence Context and First-Level (L1) Cache — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Persistence Context and First-Level (L1) Cache': Write a test proving `em.find(Employee.class, id)` executes a single SQL `SELECT` when cal...
Persistence Context and First-Level (L1) Cache — Hands-On Coding Exercise
Employee first = em.find(Employee.class, 1L); // Fires SQL SELECT
Employee second = em.find(Employee.class, 1L); // Hit from L1 Persistence Context (first == second is true!)
SessionFactory-scoped shared cache vs L1 session cache, good candidates (rarely-mutated reference data like Countries/Departments) vs bad candidates (volatile balances), Redis comparison
12.17 Second-Level (L2) Cache Fundamentals (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Second-Level (L2) Cache Fundamentals (JPA & Hibernate) covers SessionFactory-scoped shared cache vs L1 session cache, good candidates (rarely-mutated reference data like Countries/Departments) vs bad candidates (volatile balances), Redis comparison. It is required in backend engineering...
Second-Level (L2) Cache Fundamentals — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Second-Level (L2) Cache Fundamentals': Categorize 6 tables in an HR/E-Commerce schema as L2-suitable vs Redis-cached vs direct-DB. Include...
Second-Level (L2) Cache Fundamentals — Hands-On Coding Exercise
// L1 Cache: per-EntityManager (automatic, mandatory)
// L2 Cache: across sessions for read-mostly reference entities
Loading `1` list of `N` Employees then lazily accessing `emp.getDepartment().getName()` in a loop (`1 + N` SQL round-trips!), fixing via `JOIN FETCH`, `@EntityGraph`, `@BatchSize`, or DTO projection
12.18 The N+1 Query Problem (Causes and Resolution) (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works The N+1 Query Problem (Causes and Resolution) (JPA & Hibernate) covers Loading `1` list of `N` Employees then lazily accessing `emp.getDepartment().getName()` in a loop (`1 + N` SQL round-trips!), fixing via `JOIN FETCH`, `@EntityGraph`, `@BatchSize`, or DTO projection. It is re...
The N+1 Query Problem (Causes and Resolution) — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'The N+1 Query Problem (Causes and Resolution)': Trigger a real 1+10 SQL storm on `Employee -> Department`, observe 11 SQL statements in log...
The N+1 Query Problem (Causes and Resolution) — Hands-On Coding Exercise
List<Employee> list = em.createQuery(
"SELECT e FROM Employee e JOIN FETCH e.department WHERE e.active = true", Employee.class
).getResultList(); // Exactly 1 SQL SELECT with INNER JOIN!
`@Version private Long version;`, `WHERE id = ? AND version = ?`, `OptimisticLockException` on concurrent lost-update collisions
12.19 Optimistic Locking (@Version) (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Optimistic Locking (@Version) (JPA & Hibernate) covers `@Version private Long version;`, `WHERE id = ? AND version = ?`, `OptimisticLockException` on concurrent lost-update collisions. It is required in backend engineering to Preventing two HR admins editing the same employee record simultaneou...
Optimistic Locking (@Version) — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Optimistic Locking (@Version)': Add `@Version` to `Employee` and write a test demonstrating `OptimisticLockException` on concurrent stale m...
Optimistic Locking (@Version) — Hands-On Coding Exercise
@jakarta.persistence.Version
private Long version; // Hibernate appends: UPDATE hr.employees SET ..., version = version + 1 WHERE id = ? AND version = ?
`setFirstResult(offset)` + `setMaxResults(size)` + deterministic `ORDER BY`, separate `COUNT(e.id)` total query, two-step ID pagination for collection graphs
12.20 Pagination and Sorting with JPA (Week 12 • JPA & Hibernate) 1. What It Is, Why It Is Required & How It Works Pagination and Sorting with JPA (JPA & Hibernate) covers `setFirstResult(offset)` + `setMaxResults(size)` + deterministic `ORDER BY`, separate `COUNT(e.id)` total query, two-step ID pagination for collection graphs. It is required in backend engineering to Powering fast, searchable, sortable...
Pagination and Sorting with JPA — Practical Implementation Assignment
Complete and push your working JPA & Hibernate solution for 'Pagination and Sorting with JPA': Implement paginated + sorted + filtered `searchEmployees(deptId, keyword, page, size, sortBy)` for Mini-P...
Pagination and Sorting with JPA — Hands-On Coding Exercise
List<EmployeeRow> pageItems = em.createQuery(jpql, EmployeeRow.class)
.setFirstResult(page * size)
.setMaxResults(size)
.getResultList();
Design a normalized PostgreSQL HR database and implement a production-grade persistence layer in Java 21 combining JDBC analytics/batch utilities with Jakarta Persistence (JPA 3.1) & Hibernate 6 ORM for Employee & Department management.
Module Learning & Hands-On Objectives
Spring Framework 6 baseline (Java 17/21 + Jakarta EE 10), modular ecosystem (Boot, Data, Security, Cloud, Kafka), POJO programming model
13.1 Spring Ecosystem and Architecture (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Spring Ecosystem and Architecture (Spring Framework) covers Spring Framework 6 baseline (Java 17/21 + Jakarta EE 10), modular ecosystem (Boot, Data, Security, Cloud, Kafka), POJO programming model. It is required in backend engineering to Building enterprise-grade Java backends without heavyweight...
Spring Ecosystem and Architecture — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Spring Ecosystem and Architecture': Bootstrap a standalone Maven project with `spring-context` and inspect loaded Spring 6 artifacts. Incl...
Spring Ecosystem and Architecture — Hands-On Coding Exercise
var ctx = new org.springframework.context.annotation.AnnotationConfigApplicationContext(AppConfig.class);
Responsibilities and dependency boundaries across Core Container, AOP/Instrumentation, Data Access/Transactions, Web Servlet/Reactive, and Security
13.2 Spring Modules Overview (Core, Context, AOP, Web, Data, Security) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Spring Modules Overview (Core, Context, AOP, Web, Data, Security) (Spring Framework) covers Responsibilities and dependency boundaries across Core Container, AOP/Instrumentation, Data Access/Transactions, Web Servlet/Reactive, and Security. It is required in backend...
Spring Modules Overview (Core, Context, AOP, Web, Data, Security) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Spring Modules Overview (Core, Context, AOP, Web, Data, Security)': Run `mvn dependency:tree` to inspect how Spring Core, Context, Beans,...
Spring Modules Overview (Core, Context, AOP, Web, Data, Security) — Hands-On Coding Exercise
// Core Container: spring-core, spring-beans, spring-context, spring-expression
Hollywood Principle ("Don’t call us, we’ll call you"), delegating object graph creation and lifecycle management to the IoC container
13.3 Inversion of Control (IoC) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Inversion of Control (IoC) (Spring Framework) covers Hollywood Principle ("Don’t call us, we’ll call you"), delegating object graph creation and lifecycle management to the IoC container. It is required in backend engineering to Decoupling business services from concrete infrastructure creation...
Inversion of Control (IoC) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Inversion of Control (IoC)': Demonstrate how manual `new` breaks Spring dependency wiring compared to container-managed retrieval. Include...
Inversion of Control (IoC) — Hands-On Coding Exercise
// IoC Container owns creation, wiring, proxy wrapping, and lifecycle of application components
Supplying dependencies via constructorcontracts, testability with mocks, loose coupling against interfaces
13.4 Dependency Injection (DI) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Dependency Injection (DI) (Spring Framework) covers Supplying dependencies via constructorcontracts, testability with mocks, loose coupling against interfaces. It is required in backend engineering to Injecting `PaymentGateway` and `OrderRepository` interfaces into `CheckoutService` so JUnit tests pass fas...
Dependency Injection (DI) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Dependency Injection (DI)': Refactor a tightly coupled `InvoiceGenerator` into constructor-injected interface collaborators. Include clear...
Dependency Injection (DI) — Hands-On Coding Exercise
public class CheckoutService {
private final PaymentGateway paymentGateway;
public CheckoutService(PaymentGateway paymentGateway) {
this.paymentGateway = paymentGateway;
}
}
What qualifies as a Spring-managed Bean vs domain entities/DTOs, bean names, `BeanDefinition` metadata
13.5 Spring Beans (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Spring Beans (Spring Framework) covers What qualifies as a Spring-managed Bean vs domain entities/DTOs, bean names, `BeanDefinition` metadata. It is required in backend engineering to Registering stateless services, repositories, controllers, and clients as Spring Beans while keeping request DTOs and JPA entities outsi...
Spring Beans — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Spring Beans': List all registered bean names in an `ApplicationContext` and distinguish infrastructure beans from domain objects. Include...
Spring Beans — Hands-On Coding Exercise
// Stateless collaborators (@Service, @Repository, @RestController) = Spring Beans
// Stateful data carriers (@Entity, Record DTO) = NOT Spring Beans
Root `BeanFactory` interface, lazy bean instantiation semantics vs eager `ApplicationContext` startup validation
13.6 BeanFactory Fundamentals (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works BeanFactory Fundamentals (Spring Framework) covers Root `BeanFactory` interface, lazy bean instantiation semantics vs eager `ApplicationContext` startup validation. It is required in backend engineering to Understanding Spring’s internal container hierarchy for senior Java interviews. Under the hood, unders...
BeanFactory Fundamentals — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'BeanFactory Fundamentals': Compare `BeanFactory` vs `ApplicationContext` capabilities (events, i18n, eager singleton startup verification)...
BeanFactory Fundamentals — Hands-On Coding Exercise
org.springframework.beans.factory.BeanFactory factory = ctx;
`AnnotationConfigApplicationContext`, `ConfigurableApplicationContext`, eager singleton pre-instantiation, `ApplicationEventPublisher`, `Environment`
13.7 ApplicationContext Container (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works ApplicationContext Container (Spring Framework) covers `AnnotationConfigApplicationContext`, `ConfigurableApplicationContext`, eager singleton pre-instantiation, `ApplicationEventPublisher`, `Environment`. It is required in backend engineering to Failing fast at startup if any dependency, property, or b...
ApplicationContext Container — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'ApplicationContext Container': Publish and handle a custom `EmployeeOnboardedEvent` via `ApplicationEventPublisher` inside `ApplicationCon...
ApplicationContext Container — Hands-On Coding Exercise
try (var ctx = new AnnotationConfigApplicationContext(AppConfig.class)) {
var svc = ctx.getBean(CheckoutService.class);
}
Default `singleton` (one instance per Spring container, NOT JVM!), `prototype` (new instance per lookup), web `request` & `session` scopes, thread-safety rules
13.8 Bean Scopes (Singleton, Prototype, Request, Session) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Bean Scopes (Singleton, Prototype, Request, Session) (Spring Framework) covers Default `singleton` (one instance per Spring container, NOT JVM!), `prototype` (new instance per lookup), web `request` & `session` scopes, thread-safety rules. It is required in backend engineerin...
Bean Scopes (Singleton, Prototype, Request, Session) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Bean Scopes (Singleton, Prototype, Request, Session)': Verify object identity (`b1 == b2`) between `singleton` and `@Scope("prototype")` b...
Bean Scopes (Singleton, Prototype, Request, Session) — Hands-On Coding Exercise
@org.springframework.context.annotation.Scope("prototype")
@org.springframework.stereotype.Component
public class ReportExportContext {}
Constructor -> DI -> BeanPostProcessors (AOP proxies) -> `@PostConstruct` -> Ready -> `@PreDestroy` / `AutoCloseable.close()` on graceful shutdown
13.9 Bean Lifecycle (Initialization and Destruction) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Bean Lifecycle (Initialization and Destruction) (Spring Framework) covers Constructor -> DI -> BeanPostProcessors (AOP proxies) -> `@PostConstruct` -> Ready -> `@PreDestroy` / `AutoCloseable.close()` on graceful shutdown. It is required in backend engineering to Warming...
Bean Lifecycle (Initialization and Destruction) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Bean Lifecycle (Initialization and Destruction)': Trace exact execution logs of Constructor, `@PostConstruct`, business call, and `@PreDes...
Bean Lifecycle (Initialization and Destruction) — Hands-On Coding Exercise
@jakarta.annotation.PostConstruct
void onInit() { /* cache warm-up */ }
@jakarta.annotation.PreDestroy
void onShutdown() { /* release resources */ }
Reading legacy `beans.xml` in brownfield banking apps vs type-safe `@Configuration` + `@Bean` factory methods for third-party SDK classes (`ObjectMapper`, `PasswordEncoder`, `RestClient`)
13.10 Configuration Styles (Legacy XML vs Modern Java @Configuration) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Configuration Styles (Legacy XML vs Modern Java @Configuration) (Spring Framework) covers Reading legacy `beans.xml` in brownfield banking apps vs type-safe `@Configuration` + `@Bean` factory methods for third-party SDK classes (`ObjectMapper`, `PasswordEncoder`, `Res...
Configuration Styles (Legacy XML vs Modern Java @Configuration) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Configuration Styles (Legacy XML vs Modern Java @Configuration)': Write a `@Configuration` class registering `Clock.systemUTC()` and custo...
Configuration Styles (Legacy XML vs Modern Java @Configuration) — Hands-On Coding Exercise
@org.springframework.context.annotation.Configuration
public class InfraConfig {
@org.springframework.context.annotation.Bean
public java.time.Clock systemClock() { return java.time.Clock.systemUTC(); }
}
Base-package discovery rules, why placing `@SpringBootApplication` at root package `com.mockattempt.shop` scans all sub-packages automatically
13.11 Component Scanning (@ComponentScan) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Component Scanning (@ComponentScan) (Spring Framework) covers Base-package discovery rules, why placing `@SpringBootApplication` at root package `com.mockattempt.shop` scans all sub-packages automatically. It is required in backend engineering to Organizing packages cleanly so controllers, servi...
Component Scanning (@ComponentScan) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Component Scanning (@ComponentScan)': Test root vs sibling package placement and fix out-of-tree beans by aligning package hierarchy. Incl...
Component Scanning (@ComponentScan) — Hands-On Coding Exercise
// Root package com.mockattempt.app scans com.mockattempt.app.controller, .service, .repository
Semantic specialization of `@Component`, automatic SQL/JPA persistence exception translation (`DataAccessException`) enabled specifically by `@Repository`!
13.12 Stereotype Annotations (@Component, @Service, @Repository, @Controller) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Stereotype Annotations (@Component, @Service, @Repository, @Controller) (Spring Framework) covers Semantic specialization of `@Component`, automatic SQL/JPA persistence exception translation (`DataAccessException`) enabled specifically by `@Repository`!. It is...
Stereotype Annotations (@Component, @Service, @Repository, @Controller) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Stereotype Annotations (@Component, @Service, @Repository, @Controller)': Apply accurate `@Controller`, `@Service`, `@Repository`, and `@C...
Stereotype Annotations (@Component, @Service, @Repository, @Controller) — Hands-On Coding Exercise
@org.springframework.stereotype.Service
public class PayrollCalculationService {}
Why single-constructor injection (no `@Autowired` annotation even needed!) is Spring’s official standard: `final` immutability, NPE-proof, trivial JUnit construction, and fast circular-dependency detection
13.13 Autowiring (Constructor vs Setter vs Field Injection) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Autowiring (Constructor vs Setter vs Field Injection) (Spring Framework) covers Why single-constructor injection (no `@Autowired` annotation even needed!) is Spring’s official standard: `final` immutability, NPE-proof, trivial JUnit construction, and fast circular-dependency de...
Autowiring (Constructor vs Setter vs Field Injection) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Autowiring (Constructor vs Setter vs Field Injection)': Refactor field-injected classes into idiomatic single-constructor `private final`...
Autowiring (Constructor vs Setter vs Field Injection) — Hands-On Coding Exercise
@org.springframework.stereotype.Service
public class OrderPlacementService {
private final OrderRepository orderRepository;
public OrderPlacementService(OrderRepository orderRepository) {
this.orderRepository = orderRepository;
}
}
`NoUniqueBeanDefinitionException`, disambiguating `RazorpayGateway` vs `StripeGateway` explicitly via `@Qualifier("razorpayGateway")`
13.14 @Qualifier (Resolving Multiple Implementations) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works @Qualifier (Resolving Multiple Implementations) (Spring Framework) covers `NoUniqueBeanDefinitionException`, disambiguating `RazorpayGateway` vs `StripeGateway` explicitly via `@Qualifier("razorpayGateway")`. It is required in backend engineering to Injecting a specific not...
@Qualifier (Resolving Multiple Implementations) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for '@Qualifier (Resolving Multiple Implementations)': Implement `EmailNotifier` and `SmsNotifier` for `Notifier` and select explicitly with `@...
@Qualifier (Resolving Multiple Implementations) — Hands-On Coding Exercise
public AlertService(@org.springframework.beans.factory.annotation.Qualifier("smsNotifier") Notifier notifier) {
this.notifier = notifier;
}
Marking the standard default implementation with `@Primary` while allowing specialized callers to override via `@Qualifier`
13.15 @Primary (Default Bean Selection) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works @Primary (Default Bean Selection) (Spring Framework) covers Marking the standard default implementation with `@Primary` while allowing specialized callers to override via `@Qualifier`. It is required in backend engineering to Setting PostgreSQL primary `DataSource` or `EmailNotifier` as `@Primary`...
@Primary (Default Bean Selection) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for '@Primary (Default Bean Selection)': Combine `@Primary` on `EmailNotifier` with `@Qualifier("smsNotifier")` on an urgent OTP service. Inclu...
@Primary (Default Bean Selection) — Hands-On Coding Exercise
@org.springframework.context.annotation.Primary
@org.springframework.stereotype.Component
public class EmailNotifier implements Notifier {}
Environment-specific bean activation (`dev`, `test`, `prod`), `!prod` negation, `spring.profiles.active` via env vars `SPRING_PROFILES_ACTIVE`
13.16 Spring Profiles (@Profile) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Spring Profiles (@Profile) (Spring Framework) covers Environment-specific bean activation (`dev`, `test`, `prod`), `!prod` negation, `spring.profiles.active` via env vars `SPRING_PROFILES_ACTIVE`. It is required in backend engineering to Activating a sandbox mock payment gateway in `dev`/`test` and the l...
Spring Profiles (@Profile) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Spring Profiles (@Profile)': Configure `SandboxPaymentGateway` (`@Profile({"dev","test"})`) and `LivePaymentGateway` (`@Profile("prod")`)....
Spring Profiles (@Profile) — Hands-On Coding Exercise
@org.springframework.context.annotation.Profile("prod")
@org.springframework.stereotype.Component
public class LivePaymentGateway implements PaymentGateway {}
`@Value("${app.tax.gst-rate:18.0}")` safe defaults, `Environment`, and strongly-typed Java 21 `record` `@ConfigurationProperties`
13.17 Externalized Properties (@Value and @PropertySource) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Externalized Properties (@Value and @PropertySource) (Spring Framework) covers `@Value("${app.tax.gst-rate:18.0}")` safe defaults, `Environment`, and strongly-typed Java 21 `record` `@ConfigurationProperties`. It is required in backend engineering to Binding grouped JW...
Externalized Properties (@Value and @PropertySource) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Externalized Properties (@Value and @PropertySource)': Bind `app.jwt.*` settings into a Java 21 `@ConfigurationProperties(prefix = "app.jw...
Externalized Properties (@Value and @PropertySource) — Hands-On Coding Exercise
@org.springframework.boot.context.properties.ConfigurationProperties(prefix = "app.jwt")
public record JwtProperties(String issuer, long accessTtlSeconds) {}
Cross-cutting concerns (latency logging, auditing, security, transactions), `@Aspect`, `@Around` `ProceedingJoinPoint`, JDK Dynamic vs CGLIB proxies, self-invocation trap!
13.18 Spring AOP (Aspect, Advice, Pointcut and Join Point) (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Spring AOP (Aspect, Advice, Pointcut and Join Point) (Spring Framework) covers Cross-cutting concerns (latency logging, auditing, security, transactions), `@Aspect`, `@Around` `ProceedingJoinPoint`, JDK Dynamic vs CGLIB proxies, self-invocation trap!. It is required in backend e...
Spring AOP (Aspect, Advice, Pointcut and Join Point) — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Spring AOP (Aspect, Advice, Pointcut and Join Point)': Write an `@Around` `@ExecutionTimed` aspect that logs method signature and millisec...
Spring AOP (Aspect, Advice, Pointcut and Join Point) — Hands-On Coding Exercise
@Around("@annotation(ExecutionTimed)")
public Object timeCall(ProceedingJoinPoint pjp) throws Throwable {
long t0 = System.nanoTime();
try { return pjp.proceed(); }
finally { log.info("{} took {} ms", pjp.getSignature().toShortString(), (System.nanoTime() - t0) / 1_000_000); }
}
Front Controller pattern: `DispatcherServlet` -> `HandlerMapping` -> `HandlerInterceptor` -> `@Controller` -> `HttpMessageConverter` (Jackson) / `ExceptionResolver`
13.19 Spring MVC and DispatcherServlet Lifecycle (Week 13 • Spring Framework) 1. What It Is, Why It Is Required & How It Works Spring MVC and DispatcherServlet Lifecycle (Spring Framework) covers Front Controller pattern: `DispatcherServlet` -> `HandlerMapping` -> `HandlerInterceptor` -> `@Controller` -> `HttpMessageConverter` (Jackson) / `ExceptionResolver`. It is required in backend engineering to T...
Spring MVC and DispatcherServlet Lifecycle — Practical Implementation Assignment
Complete and push your working Spring Framework solution for 'Spring MVC and DispatcherServlet Lifecycle': Trace and log each stage of a request passing through a Servlet `Filter`, MVC `HandlerInterce...
Spring MVC and DispatcherServlet Lifecycle — Hands-On Coding Exercise
// HTTP Request -> Security FilterChain -> DispatcherServlet -> HandlerMapping -> RestController -> Jackson JSON
Build a constructor-injected Spring Framework 6 module switching cleanly between Sandbox and Production gateways via `@Profile`, `@Primary`, `@Qualifier`, `@ConfigurationProperties`, and an `@Around` latency-logging AOP aspect.
Module Learning & Hands-On Objectives
Opinionated convention-over-configuration, standalone executable JARs, production-ready Actuator metrics/health, zero XML
14.1 Spring Boot 3 Introduction and Architecture (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works Spring Boot 3 Introduction and Architecture (Spring Boot 3) covers Opinionated convention-over-configuration, standalone executable JARs, production-ready Actuator metrics/health, zero XML. It is required in backend engineering to Shipping standardized, cloud-ready Java 21 backend services i...
Spring Boot 3 Introduction and Architecture — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'Spring Boot 3 Introduction and Architecture': Inspect `@SpringBootApplication` meta-annotations and run a Spring Boot 3 app via `mvn spring-b...
Spring Boot 3 Introduction and Architecture — Hands-On Coding Exercise
@org.springframework.boot.autoconfigure.SpringBootApplication
public class CatalogApiApplication {
public static void main(String[] args) {
org.springframework.boot.SpringApplication.run(CatalogApiApplication.class, args);
}
}
Maven wrapper (`./mvnw`), `spring-boot-starter-parent` BOM, Java 21 target, choosing starters (`web`, `validation`, `data-jpa`, `actuator`)
14.2 Project Creation with Spring Initializr (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works Project Creation with Spring Initializr (Spring Boot 3) covers Maven wrapper (`./mvnw`), `spring-boot-starter-parent` BOM, Java 21 target, choosing starters (`web`, `validation`, `data-jpa`, `actuator`). It is required in backend engineering to Guaranteeing reproducible builds on every developer...
Project Creation with Spring Initializr — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'Project Creation with Spring Initializr': Generate a Java 21 + Maven Spring Boot 3.x project and build an executable JAR with `./mvnw package...
Project Creation with Spring Initializr — Hands-On Coding Exercise
<!-- Let spring-boot-starter-parent manage compatible Jackson, Hibernate, Tomcat & JUnit versions -->
Curated transitive dependency bundles (`spring-boot-starter-web`, `data-jpa`, `security`, `test`), Maven Bill of Materials (`dependencyManagement`)
14.3 Spring Boot Starters and BOM Dependency Management (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works Spring Boot Starters and BOM Dependency Management (Spring Boot 3) covers Curated transitive dependency bundles (`spring-boot-starter-web`, `data-jpa`, `security`, `test`), Maven Bill of Materials (`dependencyManagement`). It is required in backend engineering to Eliminating `NoSuchMe...
Spring Boot Starters and BOM Dependency Management — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'Spring Boot Starters and BOM Dependency Management': Inspect transitive dependencies of `spring-boot-starter-web` using `./mvnw dependency:tr...
Spring Boot Starters and BOM Dependency Management — Hands-On Coding Exercise
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
`AutoConfiguration.imports`, `@ConditionalOnClass`, `@ConditionalOnMissingBean`, `@ConditionalOnProperty`, `--debug` conditions evaluation report
14.4 Auto-Configuration Internals (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works Auto-Configuration Internals (Spring Boot 3) covers `AutoConfiguration.imports`, `@ConditionalOnClass`, `@ConditionalOnMissingBean`, `@ConditionalOnProperty`, `--debug` conditions evaluation report. It is required in backend engineering to Customizing Jackson `ObjectMapper` or `SecurityFilterChain` cleanly...
Auto-Configuration Internals — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'Auto-Configuration Internals': Run your app with `--debug` to read positive and negative auto-configuration matches. Include clear method/sch...
Auto-Configuration Internals — Hands-On Coding Exercise
// Boot auto-configures a default bean ONLY @ConditionalOnMissingBean — your custom @Bean seamlessly wins!
`server.port`, graceful shutdown (`server.shutdown=graceful`), Tomcat thread pool (`server.tomcat.threads.max`),Java 21 virtual threads toggle (`spring.threads.virtual.enabled`)
14.5 Embedded Tomcat Server Configuration (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works Embedded Tomcat Server Configuration (Spring Boot 3) covers `server.port`, graceful shutdown (`server.shutdown=graceful`), Tomcat thread pool (`server.tomcat.threads.max`),Java 21 virtual threads toggle (`spring.threads.virtual.enabled`). It is required in backend engineering to Enabling `server.sh...
Embedded Tomcat Server Configuration — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'Embedded Tomcat Server Configuration': Configure `server.shutdown=graceful`, compression, and context/port properties in `application.yml`. I...
Embedded Tomcat Server Configuration — Hands-On Coding Exercise
server:
port: ${PORT:8080}
shutdown: graceful
Clean separation across `controller`, `service`, `repository`, `domain`/`entity`, `dto`, `mapper`, `exception`, and `config` (plus feature-vertical packages)
14.6 Layered Application Package Structure (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works Layered Application Package Structure (Spring Boot 3) covers Clean separation across `controller`, `service`, `repository`, `domain`/`entity`, `dto`, `mapper`, `exception`, and `config` (plus feature-vertical packages). It is required in backend engineering to Enforcing strict inward dependency ru...
Layered Application Package Structure — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'Layered Application Package Structure': Scaffold clean package boundaries for the Month 4 E-Commerce Backend project. Include clear method/sc...
Layered Application Package Structure — Hands-On Coding Exercise
// Allowed flow: RestController (HTTP/DTO) -> Service (Transactions/Rules) -> Repository (JPA/SQL)
Hierarchical `application.yml`, `${ENV_VAR:default}` placeholders, external config precedence (CLI args > Env Vars > Profile YAML > Base YAML)
14.7 Configuration with application.properties and YAML (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works Configuration with application.properties and YAML (Spring Boot 3) covers Hierarchical `application.yml`, `${ENV_VAR:default}` placeholders, external config precedence (CLI args > Env Vars > Profile YAML > Base YAML). It is required in backend engineering to Injecting product...
Configuration with application.properties and YAML — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'Configuration with application.properties and YAML': Convert flat properties to structured `application.yml` using `${DB_URL:...}` environmen...
Configuration with application.properties and YAML — Hands-On Coding Exercise
spring:
application:
name: catalog-service
datasource:
url: ${DB_URL:jdbc:postgresql://localhost:5432/shop_db}
`application-dev.yml`, `application-test.yml`, `application-prod.yml`, hiding stack traces and disabling Swagger/SQL console dumps in `prod`
14.8 Environment Profiles (dev, test, prod) (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works Environment Profiles (dev, test, prod) (Spring Boot 3) covers `application-dev.yml`, `application-test.yml`, `application-prod.yml`, hiding stack traces and disabling Swagger/SQL console dumps in `prod`. It is required in backend engineering to Enabling verbose SQL logging in `dev`, Testcontainer...
Environment Profiles (dev, test, prod) — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'Environment Profiles (dev, test, prod)': Create `application-dev.yml`, `application-test.yml`, and hardened `application-prod.yml` files. Inc...
Environment Profiles (dev, test, prod) — Hands-On Coding Exercise
# application-prod.yml
server:
error:
include-stacktrace: never
include-message: always
Statelessness, plural noun resource URIs (`/api/v1/products/{id}`), representations, idempotency, safe methods, uniform interface
14.9 REST Architectural Principles and HTTP Semantics (Week 14 • REST APIs) 1. What It Is, Why It Is Required & How It Works REST Architectural Principles and HTTP Semantics (REST APIs) covers Statelessness, plural noun resource URIs (`/api/v1/products/{id}`), representations, idempotency, safe methods, uniform interface. It is required in backend engineering to Designing predictable enterprise APIs that mobile,...
REST Architectural Principles and HTTP Semantics — Practical Implementation Assignment
Complete and push your working REST APIs solution for 'REST Architectural Principles and HTTP Semantics': Redesign 8 poorly named RPC endpoints into clean, resource-oriented REST URIs. Include clear m...
REST Architectural Principles and HTTP Semantics — Hands-On Coding Exercise
// Bad : POST /api/deleteOrderById?orderId=42
// Good: DELETE /api/v1/orders/42
Safe & idempotent `GET`, non-idempotent `POST` (create/action), idempotent full replacement `PUT`, partial update `PATCH`, idempotent `DELETE`
14.10 HTTP Methods (GET, POST, PUT, PATCH, DELETE) (Week 14 • REST APIs) 1. What It Is, Why It Is Required & How It Works HTTP Methods (GET, POST, PUT, PATCH, DELETE) (REST APIs) covers Safe & idempotent `GET`, non-idempotent `POST` (create/action), idempotent full replacement `PUT`, partial update `PATCH`, idempotent `DELETE`. It is required in backend engineering to Understanding why network retries are saf...
HTTP Methods (GET, POST, PUT, PATCH, DELETE) — Practical Implementation Assignment
Complete and push your working REST APIs solution for 'HTTP Methods (GET, POST, PUT, PATCH, DELETE)': Implement all 5 HTTP methods (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`) on `/api/v1/products`. Incl...
HTTP Methods (GET, POST, PUT, PATCH, DELETE) — Hands-On Coding Exercise
// GET (safe, idempotent) | PUT & DELETE (idempotent) | POST (non-idempotent unless Idempotency-Key used)
`200 OK`, `201 Created` (+ `Location` header!), `204 No Content`, `400 Bad Request`, `401 Unauthorized`, `403 Forbidden`, `404 Not Found`, `409 Conflict`, `422 Unprocessable Content`, `429 Too Many Requests`, `500`/`503`
14.11 HTTP Status Codes (2xx, 3xx, 4xx, 5xx) (Week 14 • REST APIs) 1. What It Is, Why It Is Required & How It Works HTTP Status Codes (2xx, 3xx, 4xx, 5xx) (REST APIs) covers `200 OK`, `201 Created` (+ `Location` header!), `204 No Content`, `400 Bad Request`, `401 Unauthorized`, `403 Forbidden`, `404 Not Found`, `409 Conflict`, `422 Unprocessable Content`, `429 Too Many Requests`, `500`/`503`. It is required in ba...
HTTP Status Codes (2xx, 3xx, 4xx, 5xx) — Practical Implementation Assignment
Complete and push your working REST APIs solution for 'HTTP Status Codes (2xx, 3xx, 4xx, 5xx)': Return `201 Created` with `Location` URI on `POST`, `204 No Content` on `DELETE`, `404` on missing ID, a...
HTTP Status Codes (2xx, 3xx, 4xx, 5xx) — Hands-On Coding Exercise
URI location = URI.create("/api/v1/products/" + saved.id());
return ResponseEntity.created(location).body(saved);
`@RestController` (`@Controller` + `@ResponseBody`), automatic JSON message conversion vs view-template rendering
14.12 @RestController vs @Controller (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works @RestController vs @Controller (Spring Boot 3) covers `@RestController` (`@Controller` + `@ResponseBody`), automatic JSON message conversion vs view-template rendering. It is required in backend engineering to Writing thin, clean HTTP adapter controllers that delegate all business rules to `@Service` be...
@RestController vs @Controller — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for '@RestController vs @Controller': Create `ProductController` and `CategoryController` keeping every controller method <= 10 lines. Include cle...
@RestController vs @Controller — Hands-On Coding Exercise
@RestController
@RequestMapping("/api/v1/categories")
public class CategoryController {}
Class-level `@RequestMapping("/api/v1/products")` + method-level `@GetMapping`, `@PostMapping`, `@PutMapping`, `@PatchMapping`, `@DeleteMapping`, `produces`/`consumes`
14.13 @RequestMapping and Composed Method Mappings (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works @RequestMapping and Composed Method Mappings (Spring Boot 3) covers Class-level `@RequestMapping("/api/v1/products")` + method-level `@GetMapping`, `@PostMapping`, `@PutMapping`, `@PatchMapping`, `@DeleteMapping`, `produces`/`consumes`. It is required in backend engineering to Ke...
@RequestMapping and Composed Method Mappings — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for '@RequestMapping and Composed Method Mappings': Map hierarchical resource routes (`/api/v1/categories/{categoryId}/products`) cleanly. Include...
@RequestMapping and Composed Method Mappings — Hands-On Coding Exercise
@GetMapping("/{id}")
public ProductResponse getById(@PathVariable Long id) {
return productService.getById(id);
}
Resource identifiers in `@PathVariable`, optional filtering/pagination in `@RequestParam(defaultValue = ...)`, metadata like `Idempotency-Key` in `@RequestHeader`
14.14 Extracting @PathVariable, @RequestParam and @RequestHeader (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works Extracting @PathVariable, @RequestParam and @RequestHeader (Spring Boot 3) covers Resource identifiers in `@PathVariable`, optional filtering/pagination in `@RequestParam(defaultValue = ...)`, metadata like `Idempotency-Key` in `@RequestHeader`. It is required in backend engi...
Extracting @PathVariable, @RequestParam and @RequestHeader — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'Extracting @PathVariable, @RequestParam and @RequestHeader': Build a multi-filter `GET /api/v1/products` endpoint binding optional `category`...
Extracting @PathVariable, @RequestParam and @RequestHeader — Hands-On Coding Exercise
@GetMapping
public List<ProductResponse> search(
@RequestParam(required = false) String category,
@RequestParam(defaultValue = "0") int page
) { return productService.search(category, page); }
Binding JSON request payloads into immutable Java 21 `record` request DTOs, handling malformed JSON (`HttpMessageNotReadableException` -> HTTP 400)
14.15 @RequestBody Deserialization (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works @RequestBody Deserialization (Spring Boot 3) covers Binding JSON request payloads into immutable Java 21 `record` request DTOs, handling malformed JSON (`HttpMessageNotReadableException` -> HTTP 400). It is required in backend engineering to Accepting strongly-typed JSON payloads (`CreateProductRequest...
@RequestBody Deserialization — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for '@RequestBody Deserialization': Create `CreateProductRequest` and `UpdateProductRequest` Java 21 records bound with `@RequestBody`. Include cl...
@RequestBody Deserialization — Hands-On Coding Exercise
public record CreateProductRequest(String sku, String name, java.math.BigDecimal price, Long categoryId) {}
`ResponseEntity.ok()`, `.created(uri)`, `.noContent().build()`, `.status(HttpStatus.ACCEPTED)`, custom `Cache-Control` / `ETag` / `X-Request-Id` headers
14.16 ResponseEntity (Status Codes, Headers and Envelopes) (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works ResponseEntity (Status Codes, Headers and Envelopes) (Spring Boot 3) covers `ResponseEntity.ok()`, `.created(uri)`, `.noContent().build()`, `.status(HttpStatus.ACCEPTED)`, custom `Cache-Control` / `ETag` / `X-Request-Id` headers. It is required in backend engineering to Controlling...
ResponseEntity (Status Codes, Headers and Envelopes) — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'ResponseEntity (Status Codes, Headers and Envelopes)': Return `ResponseEntity<ProductResponse>` with custom `X-Correlation-Id` and `Location`...
ResponseEntity (Status Codes, Headers and Envelopes) — Hands-On Coding Exercise
@DeleteMapping("/{id}")
public ResponseEntity<Void> delete(@PathVariable Long id) {
productService.delete(id);
return ResponseEntity.noContent().build();
}
Why exposing `@Entity` directly causes mass-assignment security flaws (`role: "ADMIN"`), infinite bidirectional JSON recursion, `LazyInitializationException`, and breaking API coupling
14.17 DTO Pattern (Separating API Contracts from JPA Entities) (Week 14 • REST APIs) 1. What It Is, Why It Is Required & How It Works DTO Pattern (Separating API Contracts from JPA Entities) (REST APIs) covers Why exposing `@Entity` directly causes mass-assignment security flaws (`role: "ADMIN"`), infinite bidirectional JSON recursion, `LazyInitializationException`, and breaking API coupling. It is requ...
DTO Pattern (Separating API Contracts from JPA Entities) — Practical Implementation Assignment
Complete and push your working REST APIs solution for 'DTO Pattern (Separating API Contracts from JPA Entities)': Create separate Request and Response `record` DTOs for `User`, `Product`, and `Order`...
DTO Pattern (Separating API Contracts from JPA Entities) — Hands-On Coding Exercise
public record UserProfileResponse(Long id, String fullName, String email, java.time.Instant joinedAt) {}
`ObjectMapper`, `JavaTimeModule` ISO-8601 dates (`WRITE_DATES_AS_TIMESTAMPS: false`), `@JsonProperty`, `@JsonInclude(NON_NULL)`, `@JsonIgnore`, ignoring unknown fields safely
14.18 JSON Serialization with Jackson (Week 14 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works JSON Serialization with Jackson (Spring Boot 3) covers `ObjectMapper`, `JavaTimeModule` ISO-8601 dates (`WRITE_DATES_AS_TIMESTAMPS: false`), `@JsonProperty`, `@JsonInclude(NON_NULL)`, `@JsonIgnore`, ignoring unknown fields safely. It is required in backend engineering to Ensuring `Instant` and `LocalDa...
JSON Serialization with Jackson — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'JSON Serialization with Jackson': Customize Jackson snake_case/camelCase, null-inclusion, and `BigDecimal` plain-string formatting. Include c...
JSON Serialization with Jackson — Hands-On Coding Exercise
public record PriceView(
@com.fasterxml.jackson.annotation.JsonFormat(shape = com.fasterxml.jackson.annotation.JsonFormat.Shape.STRING)
java.math.BigDecimal amount
) {}
URI versioning (`/api/v1/...`), backward-compatible additive changes, filtering/sorting/pagination query conventions, idempotency keys
14.19 REST API Design Best Practices and Versioning (Week 14 • REST APIs) 1. What It Is, Why It Is Required & How It Works REST API Design Best Practices and Versioning (REST APIs) covers URI versioning (`/api/v1/...`), backward-compatible additive changes, filtering/sorting/pagination query conventions, idempotency keys. It is required in backend engineering to Evolving `/api/v1/orders` to `/api/v2/orders` clean...
REST API Design Best Practices and Versioning — Practical Implementation Assignment
Complete and push your working REST APIs solution for 'REST API Design Best Practices and Versioning': Document an API Design Style Guide for `/api/v1` covering naming, pagination envelope, and error...
REST API Design Best Practices and Versioning — Hands-On Coding Exercise
// Standard paginated envelope: { "items": [...], "page": 0, "size": 20, "totalElements": 142, "totalPages": 8 }
Postman Environments (`{{baseUrl}}`, `{{jwtToken}}`), Collection folders, automated post-response status/JSON schema assertions, exporting `postman_collection.json` to Git
14.20 API Testing with Postman (Week 14 • REST APIs) 1. What It Is, Why It Is Required & How It Works API Testing with Postman (REST APIs) covers Postman Environments (`{{baseUrl}}`, `{{jwtToken}}`), Collection folders, automated post-response status/JSON schema assertions, exporting `postman_collection.json` to Git. It is required in backend engineering to Sharing an executable Postman collection in every reposi...
API Testing with Postman — Practical Implementation Assignment
Complete and push your working REST APIs solution for 'API Testing with Postman': Build and export an automated Postman collection with environment variables and assertions for all Product/Category en...
API Testing with Postman — Hands-On Coding Exercise
// Postman post-response script:
// pm.test('Status is 201 Created', () => pm.response.to.have.status(201));
`springdoc-openapi-starter-webmvc-ui`, `@Tag`, `@Operation`, `@ApiResponses`, `@Schema`, Bearer JWT Authorize button in `/swagger-ui.html`
14.21 OpenAPI 3 and Swagger Documentation (springdoc-openapi) (Week 14 • REST APIs) 1. What It Is, Why It Is Required & How It Works OpenAPI 3 and Swagger Documentation (springdoc-openapi) (REST APIs) covers `springdoc-openapi-starter-webmvc-ui`, `@Tag`, `@Operation`, `@ApiResponses`, `@Schema`, Bearer JWT Authorize button in `/swagger-ui.html`. It is required in backend engineering to Generating live, always-up-...
OpenAPI 3 and Swagger Documentation (springdoc-openapi) — Practical Implementation Assignment
Complete and push your working REST APIs solution for 'OpenAPI 3 and Swagger Documentation (springdoc-openapi)': Configure `springdoc-openapi` with API metadata, example schemas, and Bearer JWT securi...
OpenAPI 3 and Swagger Documentation (springdoc-openapi) — Hands-On Coding Exercise
@io.swagger.v3.oas.annotations.Operation(summary = "Create a new catalog product")
Develop a resource-oriented `/api/v1/products` and `/api/v1/categories` Spring Boot 3 REST API using Java 21 `record` DTOs, `ResponseEntity` status semantics, OpenAPI 3 / Swagger UI, and an automated Postman test collection.
Module Learning & Hands-On Objectives
Thin HTTP Controller, transactional domain Service, persistence Repository, strict unidirectional layer contracts
15.1 Layered Backend Architecture (Controller, Service, Repository) (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Layered Backend Architecture (Controller, Service, Repository) (Spring Boot & JPA) covers Thin HTTP Controller, transactional domain Service, persistence Repository, strict unidirectional layer contracts. It is required in backend engineering to Keeping busines...
Layered Backend Architecture (Controller, Service, Repository) — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Layered Backend Architecture (Controller, Service, Repository)': Structure `ProductController` -> `ProductService` -> `ProductRepository`...
Layered Backend Architecture (Controller, Service, Repository) — Hands-On Coding Exercise
// Controller: HTTP & @Valid DTOs | Service: @Transactional & Domain Rules | Repository: JPA/SQL
`JpaRepository<Product, Long>`, `save`, `findById`, `existsBySku`, custom `@Query` JPQL & projections, `open-in-view: false` best practice!
15.2 Spring Data JpaRepository and CRUD Layer (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Spring Data JpaRepository and CRUD Layer (Spring Boot & JPA) covers `JpaRepository<Product, Long>`, `save`, `findById`, `existsBySku`, custom `@Query` JPQL & projections, `open-in-view: false` best practice!. It is required in backend engineering to Disabling `spring.jpa.o...
Spring Data JpaRepository and CRUD Layer — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Spring Data JpaRepository and CRUD Layer': Set `spring.jpa.open-in-view=false` and build `ProductRepository` & `CategoryRepository` with...
Spring Data JpaRepository and CRUD Layer — Hands-On Coding Exercise
public interface ProductRepository extends org.springframework.data.jpa.repository.JpaRepository<Product, Long> {
boolean existsBySkuIgnoreCase(String sku);
}
Orchestrating domain checks (stock availability, duplicate SKU guard, price computation), keeping entities rich rather than anemic
15.3 Service Layer Business Logic Design (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Service Layer Business Logic Design (Spring Boot & JPA) covers Orchestrating domain checks (stock availability, duplicate SKU guard, price computation), keeping entities rich rather than anemic. It is required in backend engineering to Validating category existence, SKU uniqueness, and s...
Service Layer Business Logic Design — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Service Layer Business Logic Design': Implement `createProduct`, `adjustStock`, and `archiveProduct` domain workflows in `ProductService`...
Service Layer Business Logic Design — Hands-On Coding Exercise
@Transactional
public ProductResponse create(CreateProductRequest req) {
if (productRepo.existsBySkuIgnoreCase(req.sku())) throw new DuplicateResourceException("SKU exists: " + req.sku());
// map, persist, and return DTO
}
Deterministic dedicated Mapper components / static factory methods (`ProductResponse.from(entity)`), MapStruct overview, avoiding reflection-heavy `BeanUtils`
15.4 DTO-to-Entity and Entity-to-DTO Mapping (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works DTO-to-Entity and Entity-to-DTO Mapping (Spring Boot & JPA) covers Deterministic dedicated Mapper components / static factory methods (`ProductResponse.from(entity)`), MapStruct overview, avoiding reflection-heavy `BeanUtils`. It is required in backend engineering to Compile-time-che...
DTO-to-Entity and Entity-to-DTO Mapping — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'DTO-to-Entity and Entity-to-DTO Mapping': Write clean, compile-time-safe mapper methods between `Product`/`Category` entities and Java 21...
DTO-to-Entity and Entity-to-DTO Mapping — Hands-On Coding Exercise
public static ProductResponse fromEntity(Product p) {
return new ProductResponse(p.getId(), p.getSku(), p.getName(), p.getPrice(), p.getCategory().getName());
}
`spring-boot-starter-validation` (Hibernate Validator), triggering validation via `@Valid` on `@RequestBody`, `@Validated` on path/query params
15.5 Jakarta Bean Validation Fundamentals (Week 15 • Validation & Errors) 1. What It Is, Why It Is Required & How It Works Jakarta Bean Validation Fundamentals (Validation & Errors) covers `spring-boot-starter-validation` (Hibernate Validator), triggering validation via `@Valid` on `@RequestBody`, `@Validated` on path/query params. It is required in backend engineering to Rejecting malformed client payloa...
Jakarta Bean Validation Fundamentals — Practical Implementation Assignment
Complete and push your working Validation & Errors solution for 'Jakarta Bean Validation Fundamentals': Enable `spring-boot-starter-validation` and verify `@Valid` triggers `MethodArgumentNotValidExce...
Jakarta Bean Validation Fundamentals — Hands-On Coding Exercise
@PostMapping
public ResponseEntity<ProductResponse> create(@jakarta.validation.Valid @RequestBody CreateProductRequest req) {
return ResponseEntity.status(201).body(productService.create(req));
}
Difference between `@NotNull`, `@NotEmpty`, and `@NotBlank` (trims whitespace!), `@DecimalMin`, `@Pattern`, nested `@Valid List<OrderItemRequest>`
15.6 Standard Validation Annotations (@NotNull, @NotBlank, @Size, @Email, @Min, @Max, @Positive) (Week 15 • Validation & Errors) 1. What It Is, Why It Is Required & How It Works Standard Validation Annotations (@NotNull, @NotBlank, @Size, @Email, @Min, @Max, @Positive) (Validation & Errors) covers Difference between `@NotNull`, `@NotEmpty`, and `@NotBlank` (trims whitespace!), `@DecimalMin`, `@Pattern`, n...
Standard Validation Annotations (@NotNull, @NotBlank, @Size, @Email, @Min, @Max, @Positive) — Practical Implementation Assignment
Complete and push your working Validation & Errors solution for 'Standard Validation Annotations (@NotNull, @NotBlank, @Size, @Email, @Min, @Max, @Positive)': Annotate `RegisterRequest`, `CreateProduc...
Standard Validation Annotations (@NotNull, @NotBlank, @Size, @Email, @Min, @Max, @Positive) — Hands-On Coding Exercise
public record CreateProductRequest(
@jakarta.validation.constraints.NotBlank @jakarta.validation.constraints.Size(max = 32) String sku,
@jakarta.validation.constraints.NotBlank @jakarta.validation.constraints.Size(max = 160) String name,
@jakarta.validation.constraints.NotNull @jakarta.validation.constraints.Positive java.math.BigDecimal price
) {}
Defining `@ValidSku` or class-level `@DateRangeValid` + `ConstraintValidator<A, T>` for reusable domain/cross-field rules
15.7 Custom Validation Annotations and ConstraintValidator (Week 15 • Validation & Errors) 1. What It Is, Why It Is Required & How It Works Custom Validation Annotations and ConstraintValidator (Validation & Errors) covers Defining `@ValidSku` or class-level `@DateRangeValid` + `ConstraintValidator<A, T>` for reusable domain/cross-field rules. It is required in backend engineering to Validating cros...
Custom Validation Annotations and ConstraintValidator — Practical Implementation Assignment
Complete and push your working Validation & Errors solution for 'Custom Validation Annotations and ConstraintValidator': Create a custom `@ValidPriceRange` record-level validator ensuring `salePrice <...
Custom Validation Annotations and ConstraintValidator — Hands-On Coding Exercise
public class SkuValidator implements jakarta.validation.ConstraintValidator<ValidSku, String> {
@Override
public boolean isValid(String value, jakarta.validation.ConstraintValidatorContext ctx) {
return value != null && value.matches("^[A-Z0-9-]{4,24}$");
}
}
Handling specific exceptions locally inside a controller vs why cross-controller duplication leads to `@RestControllerAdvice`
15.8 Controller-Scoped @ExceptionHandler (Week 15 • Validation & Errors) 1. What It Is, Why It Is Required & How It Works Controller-Scoped @ExceptionHandler (Validation & Errors) covers Handling specific exceptions locally inside a controller vs why cross-controller duplication leads to `@RestControllerAdvice`. It is required in backend engineering to Handling a specialized payment webhook signature exce...
Controller-Scoped @ExceptionHandler — Practical Implementation Assignment
Complete and push your working Validation & Errors solution for 'Controller-Scoped @ExceptionHandler': Test a local `@ExceptionHandler` then promote shared handlers into a global `@RestControllerAdvic...
Controller-Scoped @ExceptionHandler — Hands-On Coding Exercise
@ExceptionHandler(IllegalArgumentException.class)
public ResponseEntity<ApiError> handleBadArg(IllegalArgumentException ex) { /* ... */ }
Centralized exception translation for `ResourceNotFoundException` (404), `DuplicateResourceException` (409), `MethodArgumentNotValidException` (400 field map), `OptimisticLockingFailureException` (409), fallback `Exception` (500 logged with traceId)
15.9 Global Exception Handling (@ControllerAdvice and @RestControllerAdvice) (Week 15 • Validation & Errors) 1. What It Is, Why It Is Required & How It Works Global Exception Handling (@ControllerAdvice and @RestControllerAdvice) (Validation & Errors) covers Centralized exception translation for `ResourceNotFoundException` (404), `DuplicateResourceException` (409), `MethodArgumentNotValidException` (400 f...
Global Exception Handling (@ControllerAdvice and @RestControllerAdvice) — Practical Implementation Assignment
Complete and push your working Validation & Errors solution for 'Global Exception Handling (@ControllerAdvice and @RestControllerAdvice)': Implement `GlobalExceptionHandler` (`@RestControllerAdvice`)...
Global Exception Handling (@ControllerAdvice and @RestControllerAdvice) — Hands-On Coding Exercise
@RestControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(ResourceNotFoundException.class)
public org.springframework.http.ProblemDetail handleNotFound(ResourceNotFoundException ex) {
return org.springframework.http.ProblemDetail.forStatusAndDetail(org.springframework.http.HttpStatus.NOT_FOUND, ex.getMessage());
}
}
Spring 6 native `ProblemDetail` (`type`, `title`, `status`, `detail`, `instance`, custom `errors` field map & `timestamp`)
15.10 Standard Error Response Design (RFC 7807 ProblemDetail) (Week 15 • Validation & Errors) 1. What It Is, Why It Is Required & How It Works Standard Error Response Design (RFC 7807 ProblemDetail) (Validation & Errors) covers Spring 6 native `ProblemDetail` (`type`, `title`, `status`, `detail`, `instance`, custom `errors` field map & `timestamp`). It is required in backend engineering to Returning s...
Standard Error Response Design (RFC 7807 ProblemDetail) — Practical Implementation Assignment
Complete and push your working Validation & Errors solution for 'Standard Error Response Design (RFC 7807 ProblemDetail)': Enrich `MethodArgumentNotValidException` into a `ProblemDetail` carrying a `M...
Standard Error Response Design (RFC 7807 ProblemDetail) — Hands-On Coding Exercise
ProblemDetail pd = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, "Validation failed");
pd.setProperty("fieldErrors", fieldErrorMap);
`PageRequest.of(page, Math.min(size, 100), sort)`, `Page<T>` (with total count) vs `Slice<T>` (no `COUNT(*)` query — great for "Load More"!), capping max page size
15.11 Spring Data Pagination (Page, Slice, PageRequest and Pageable) (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Spring Data Pagination (Page, Slice, PageRequest and Pageable) (Spring Boot & JPA) covers `PageRequest.of(page, Math.min(size, 100), sort)`, `Page<T>` (with total count) vs `Slice<T>` (no `COUNT(*)` query — great for "Load More"!), cappin...
Spring Data Pagination (Page, Slice, PageRequest and Pageable) — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Spring Data Pagination (Page, Slice, PageRequest and Pageable)': Configure `max-page-size: 50` and return a clean `PagedResponse<ProductR...
Spring Data Pagination (Page, Slice, PageRequest and Pageable) — Hands-On Coding Exercise
Pageable safePage = PageRequest.of(Math.max(0, page), Math.clamp(size, 1, 50), Sort.by("id").descending());
`Sort.by(Sort.Order.desc("price"), Sort.Order.asc("id"))`, validating client `sortBy` strings against allowed entity fields to prevent `PropertyReferenceException` (500)
15.12 Dynamic Sorting (Sort and Whitelisted Sort Fields) (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Dynamic Sorting (Sort and Whitelisted Sort Fields) (Spring Boot & JPA) covers `Sort.by(Sort.Order.desc("price"), Sort.Order.asc("id"))`, validating client `sortBy` strings against allowed entity fields to prevent `PropertyReferenceException` (500). It...
Dynamic Sorting (Sort and Whitelisted Sort Fields) — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Dynamic Sorting (Sort and Whitelisted Sort Fields)': Build a safe sort mapper translating client sort keys (`price`, `newest`, `name`) in...
Dynamic Sorting (Sort and Whitelisted Sort Fields) — Hands-On Coding Exercise
Sort sort = switch (sortKey) {
case "price_asc" -> Sort.by("price").ascending().and(Sort.by("id").ascending());
case "price_desc" -> Sort.by("price").descending().and(Sort.by("id").descending());
default -> Sort.by("createdAt").descending().and(Sort.by("id").descending());
};
`JpaSpecificationExecutor<Product>`, composable `Specification<Product>` predicates (`hasCategory`, `priceBetween`, `nameContains`, `isActive`), combining via `Specification.allOf(...)`
15.13 Dynamic Query Filtering with JPA Specifications (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Dynamic Query Filtering with JPA Specifications (Spring Boot & JPA) covers `JpaSpecificationExecutor<Product>`, composable `Specification<Product>` predicates (`hasCategory`, `priceBetween`, `nameContains`, `isActive`), combining via `Specification.allOf(...)`. I...
Dynamic Query Filtering with JPA Specifications — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Dynamic Query Filtering with JPA Specifications': Implement composable `ProductSpecifications` for multi-filter search + pagination on `/...
Dynamic Query Filtering with JPA Specifications — Hands-On Coding Exercise
Specification<Product> spec = Specification.allOf(
ProductSpecs.isActive(),
ProductSpecs.categoryEquals(categorySlug),
ProductSpecs.priceBetween(minPrice, maxPrice)
);
`@Transactional` vs `@Transactional(readOnly = true)`, default rollback on unchecked `RuntimeException`/`Error` ONLY (`rollbackFor = Exception.class` for checked!), proxy self-invocation rule
15.14 Declarative Transactions (@Transactional) (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Declarative Transactions (@Transactional) (Spring Boot & JPA) covers `@Transactional` vs `@Transactional(readOnly = true)`, default rollback on unchecked `RuntimeException`/`Error` ONLY (`rollbackFor = Exception.class` for checked!), proxy self-invocation rule. It is required in b...
Declarative Transactions (@Transactional) — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Declarative Transactions (@Transactional)': Verify atomic rollback of `Order` + `StockDeduction` when payment validation fails mid-method...
Declarative Transactions (@Transactional) — Hands-On Coding Exercise
@Service
@Transactional(readOnly = true)
public class OrderService {
@Transactional
public OrderResponse placeOrder(CreateOrderRequest req) { /* atomic write */ }
}
`Propagation.REQUIRED` (join existing or start new), `REQUIRES_NEW` (suspend outer tx and commit independent tx — e.g., failed-login security audit!), `MANDATORY`
15.15 Transaction Propagation (REQUIRED, REQUIRES_NEW, MANDATORY) (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Transaction Propagation (REQUIRED, REQUIRES_NEW, MANDATORY) (Spring Boot & JPA) covers `Propagation.REQUIRED` (join existing or start new), `REQUIRES_NEW` (suspend outer tx and commit independent tx — e.g., failed-login security audit!), `MANDATORY`. It is requir...
Transaction Propagation (REQUIRED, REQUIRES_NEW, MANDATORY) — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Transaction Propagation (REQUIRED, REQUIRES_NEW, MANDATORY)': Extract `AuditLogWriter` with `@Transactional(propagation = Propagation.REQ...
Transaction Propagation (REQUIRED, REQUIRES_NEW, MANDATORY) — Hands-On Coding Exercise
@Transactional(propagation = org.springframework.transaction.annotation.Propagation.REQUIRES_NEW)
public void recordAuditAttempt(String actor, String outcome) { /* commits independently */ }
`@Transactional(isolation = Isolation.READ_COMMITTED / REPEATABLE_READ / SERIALIZABLE)`, combining with `@Lock(LockModeType.PESSIMISTIC_WRITE)` or `@Version`
15.16 Transaction Isolation Configuration in Spring (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Transaction Isolation Configuration in Spring (Spring Boot & JPA) covers `@Transactional(isolation = Isolation.READ_COMMITTED / REPEATABLE_READ / SERIALIZABLE)`, combining with `@Lock(LockModeType.PESSIMISTIC_WRITE)` or `@Version`. It is required in backend engineering to Prev...
Transaction Isolation Configuration in Spring — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Transaction Isolation Configuration in Spring': Protect inventory deduction in `OrderService` against concurrent overselling using `@Lock...
Transaction Isolation Configuration in Spring — Hands-On Coding Exercise
@org.springframework.data.jpa.repository.Lock(jakarta.persistence.LockModeType.PESSIMISTIC_WRITE)
@Query("SELECT p FROM Product p WHERE p.id = :id")
Optional<Product> findByIdForUpdate(Long id);
`LoggerFactory.getLogger`, parameterized placeholders `log.info("Order {} placed by user {}", orderId, userId)` (never string `+`!), MDC `traceId`/`requestId`, log levels (`ERROR`, `WARN`, `INFO`, `DEBUG`), never logging passwords/JWTs/PII!
15.17 Structured Application Logging (SLF4J and Logback) (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Structured Application Logging (SLF4J and Logback) (Spring Boot & JPA) covers `LoggerFactory.getLogger`, parameterized placeholders `log.info("Order {} placed by user {}", orderId, userId)` (never string `+`!), MDC `traceId`/`requestId`, log levels (`ERROR`, `WA...
Structured Application Logging (SLF4J and Logback) — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Structured Application Logging (SLF4J and Logback)': Add an SLF4J MDC `CorrelationIdFilter` and replace any `System.out` calls with struc...
Structured Application Logging (SLF4J and Logback) — Hands-On Coding Exercise
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(OrderService.class);
log.info("Created order id={} total={}", order.getId(), order.getTotalAmount());
12-Factor App config via OS env vars (`DB_PASSWORD`, `JWT_SECRET`), `.env.example` template committed while `.env` is git-ignored, fail-fast `@NotBlank` startup validation on `@ConfigurationProperties`
15.18 Configuration Security and External Secrets (Week 15 • Spring Boot & JPA) 1. What It Is, Why It Is Required & How It Works Configuration Security and External Secrets (Spring Boot & JPA) covers 12-Factor App config via OS env vars (`DB_PASSWORD`, `JWT_SECRET`), `.env.example` template committed while `.env` is git-ignored, fail-fast `@NotBlank` startup validation on `@ConfigurationProperties`. It is...
Configuration Security and External Secrets — Practical Implementation Assignment
Complete and push your working Spring Boot & JPA solution for 'Configuration Security and External Secrets': Add `@Validated` `@ConfigurationProperties` startup validation enforcing strong `JWT_SECRET...
Configuration Security and External Secrets — Hands-On Coding Exercise
@Validated
@ConfigurationProperties(prefix = "security.jwt")
public record JwtSecurityProps(@NotBlank @Size(min = 32) String signingKey, long expirationSeconds) {}
Connect your Catalog & Order REST API to PostgreSQL with `JpaRepository`, composable `Specification` filters, `Pageable` pagination, Jakarta Bean Validation, `@RestControllerAdvice` RFC-7807 error responses, and `@Transactional` stock safety.
Module Learning & Hands-On Objectives
Principal identity verification (AuthN -> 401 when missing/invalid) vs privilege verification (AuthZ -> 403 when insufficient), Defense-in-Depth, OWASP API Top 10 (BOLA/IDOR!)
16.1 Security Fundamentals (Authentication vs Authorization) (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works Security Fundamentals (Authentication vs Authorization) (Spring Security 6) covers Principal identity verification (AuthN -> 401 when missing/invalid) vs privilege verification (AuthZ -> 403 when insufficient), Defense-in-Depth, OWASP API Top 10 (BOLA/IDOR!). It is requ...
Security Fundamentals (Authentication vs Authorization) — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'Security Fundamentals (Authentication vs Authorization)': Audit all E-Commerce endpoints to classify Public vs Authenticated vs Role-Gate...
Security Fundamentals (Authentication vs Authorization) — Hands-On Coding Exercise
// AuthN: Who are you? (401 Unauthorized if unknown)
// AuthZ: Are you allowed to act on THIS resource? (403 Forbidden if denied)
`DelegatingFilterProxy` -> `FilterChainProxy` -> ordered `SecurityFilterChain` filters -> `SecurityContextHolder` -> `DispatcherServlet`
16.2 Spring Security 6 Filter Chain Architecture (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works Spring Security 6 Filter Chain Architecture (Spring Security 6) covers `DelegatingFilterProxy` -> `FilterChainProxy` -> ordered `SecurityFilterChain` filters -> `SecurityContextHolder` -> `DispatcherServlet`. It is required in backend engineering to Understanding why `@RestCo...
Spring Security 6 Filter Chain Architecture — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'Spring Security 6 Filter Chain Architecture': Configure JSON `AuthenticationEntryPoint` (401) and `AccessDeniedHandler` (403) returning `...
Spring Security 6 Filter Chain Architecture — Hands-On Coding Exercise
// Servlet Container -> DelegatingFilterProxy -> SecurityFilterChain (JWT Filter) -> DispatcherServlet
Modern Spring Security 6 `@Bean SecurityFilterChain` lambda DSL (`authorizeHttpRequests`, `requestMatchers`, `sessionManagement`, `exceptionHandling`), zero deprecated `WebSecurityConfigurerAdapter`
16.3 SecurityFilterChain Configuration (Lambda DSL) (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works SecurityFilterChain Configuration (Lambda DSL) (Spring Security 6) covers Modern Spring Security 6 `@Bean SecurityFilterChain` lambda DSL (`authorizeHttpRequests`, `requestMatchers`, `sessionManagement`, `exceptionHandling`), zero deprecated `WebSecurityConfigurerAdapter`. It is requi...
SecurityFilterChain Configuration (Lambda DSL) — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'SecurityFilterChain Configuration (Lambda DSL)': Write a Spring Security 6 `SecurityFilterChain` bean with ordered URL rules for E-Commer...
SecurityFilterChain Configuration (Lambda DSL) — Hands-On Coding Exercise
@Bean
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
return http
.csrf(AbstractHttpConfigurer::disable)
.sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.authorizeHttpRequests(auth -> auth
.requestMatchers("/api/v1/auth/**", "/v3/api-docs/**", "/swagger-ui/**").permitAll()
.requestMatchers(HttpMethod.GET, "/api/v1/products/**").permitAll()
.requestMatchers("/api/v1/admin/**").hasRole("AD...
Why MD5/SHA-256 are broken for passwords, adaptive salted work-factor hashing with `BCryptPasswordEncoder(12)`, `encode()` on registration vs `matches()` on login
16.4 Password Security (PasswordEncoder and BCrypt) (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works Password Security (PasswordEncoder and BCrypt) (Spring Security 6) covers Why MD5/SHA-256 are broken for passwords, adaptive salted work-factor hashing with `BCryptPasswordEncoder(12)`, `encode()` on registration vs `matches()` on login. It is required in backend engineering to Guaran...
Password Security (PasswordEncoder and BCrypt) — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'Password Security (PasswordEncoder and BCrypt)': Register `BCryptPasswordEncoder` bean and write unit tests verifying unique salts and `m...
Password Security (PasswordEncoder and BCrypt) — Hands-On Coding Exercise
@Bean
public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder() {
return new org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder(12);
}
Implementing/adapting `UserDetails` (`getUsername`, `getPassword`, `getAuthorities`, `isEnabled`, `isAccountNonLocked`), `ROLE_` authority prefix convention
16.5 UserDetails Identity Model (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works UserDetails Identity Model (Spring Security 6) covers Implementing/adapting `UserDetails` (`getUsername`, `getPassword`, `getAuthorities`, `isEnabled`, `isAccountNonLocked`), `ROLE_` authority prefix convention. It is required in backend engineering to Creating a clean `AuthenticatedUser` principal recor...
UserDetails Identity Model — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'UserDetails Identity Model': Create an immutable `AppUserPrincipal` implementing `UserDetails` carrying `Long userId` and `ROLE_*` author...
UserDetails Identity Model — Hands-On Coding Exercise
// hasRole("ADMIN") -> matches SimpleGrantedAuthority("ROLE_ADMIN")
Loading user credentials & roles from PostgreSQL via `UserRepository.findByEmailIgnoreCase`, throwing `UsernameNotFoundException` without user-enumeration leaks
16.6 UserDetailsService Implementation (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works UserDetailsService Implementation (Spring Security 6) covers Loading user credentials & roles from PostgreSQL via `UserRepository.findByEmailIgnoreCase`, throwing `UsernameNotFoundException` without user-enumeration leaks. It is required in backend engineering to Bridging PostgreSQL `users` +...
UserDetailsService Implementation — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'UserDetailsService Implementation': Implement `CustomUserDetailsService` backed by `UserRepository` with case-insensitive email lookup. I...
UserDetailsService Implementation — Hands-On Coding Exercise
@Override
public UserDetails loadUserByUsername(String email) {
return userRepo.findByEmailIgnoreCase(email.strip())
.map(AppUserPrincipal::fromEntity)
.orElseThrow(() -> new UsernameNotFoundException("Invalid credentials"));
}
`AuthenticationConfiguration.getAuthenticationManager()`, `UsernamePasswordAuthenticationToken`, credential verification, disabled/locked account checks
16.7 AuthenticationManager and DaoAuthenticationProvider Workflow (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works AuthenticationManager and DaoAuthenticationProvider Workflow (Spring Security 6) covers `AuthenticationConfiguration.getAuthenticationManager()`, `UsernamePasswordAuthenticationToken`, credential verification, disabled/locked account checks. It is required in backend eng...
AuthenticationManager and DaoAuthenticationProvider Workflow — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'AuthenticationManager and DaoAuthenticationProvider Workflow': Implement `/api/v1/auth/register` and `/api/v1/auth/login` using `Authenti...
AuthenticationManager and DaoAuthenticationProvider Workflow — Hands-On Coding Exercise
Authentication auth = authenticationManager.authenticate(
new UsernamePasswordAuthenticationToken(req.email().strip(), req.password())
);
Coarse roles (`ROLE_ADMIN`, `ROLE_CUSTOMER`) vs fine-grained authorities (`product:write`, `order:refund`), `@AuthenticationPrincipal` in controllers
16.8 Role-Based and Permission-Based Authorization (RBAC) (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works Role-Based and Permission-Based Authorization (RBAC) (Spring Security 6) covers Coarse roles (`ROLE_ADMIN`, `ROLE_CUSTOMER`) vs fine-grained authorities (`product:write`, `order:refund`), `@AuthenticationPrincipal` in controllers. It is required in backend engineering to Extract...
Role-Based and Permission-Based Authorization (RBAC) — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'Role-Based and Permission-Based Authorization (RBAC)': Bind `@AuthenticationPrincipal AppUserPrincipal user` across Cart and Order endpoi...
Role-Based and Permission-Based Authorization (RBAC) — Hands-On Coding Exercise
@PostMapping
public OrderResponse checkout(@AuthenticationPrincipal AppUserPrincipal user, @Valid @RequestBody CheckoutRequest req) {
return orderService.checkout(user.userId(), req);
}
Base64Url `header.payload.signature`, standard claims (`sub`, `iss`, `iat`, `exp`, `jti`), custom `roles`/`uid` claims, why JWT payload is signed (tamper-evident) NOT encrypted!
16.9 JWT Structure and Claims (Header, Payload, Signature) (Week 16 • JWT & Stateless Auth) 1. What It Is, Why It Is Required & How It Works JWT Structure and Claims (Header, Payload, Signature) (JWT & Stateless Auth) covers Base64Url `header.payload.signature`, standard claims (`sub`, `iss`, `iat`, `exp`, `jti`), custom `roles`/`uid` claims, why JWT payload is signed (tamper-evident) NOT encrypted!. It i...
JWT Structure and Claims (Header, Payload, Signature) — Practical Implementation Assignment
Complete and push your working JWT & Stateless Auth solution for 'JWT Structure and Claims (Header, Payload, Signature)': Inspect a generated JWT’s 3 dot-separated segments and verify `iss`, `sub`, `i...
JWT Structure and Claims (Header, Payload, Signature) — Hands-On Coding Exercise
// JWT Payload is Base64Url-encoded (readable!), NOT encrypted — never store secrets/PII in claims!
256-bit+ HMAC-SHA256 (`HS256`) / RSA (`RS256` in microservices) signing with `jjwt` or `spring-boot-starter-oauth2-resource-server` `NimbusJwtEncoder`/`Decoder`, strict algorithm/expiry/issuer checks, refresh-token concept
16.10 JWT Creation and Cryptographic Validation (Week 16 • JWT & Stateless Auth) 1. What It Is, Why It Is Required & How It Works JWT Creation and Cryptographic Validation (JWT & Stateless Auth) covers 256-bit+ HMAC-SHA256 (`HS256`) / RSA (`RS256` in microservices) signing with `jjwt` or `spring-boot-starter-oauth2-resource-server` `NimbusJwtEncoder`/`Decoder`, strict algorithm/expiry/issuer checks, refre...
JWT Creation and Cryptographic Validation — Practical Implementation Assignment
Complete and push your working JWT & Stateless Auth solution for 'JWT Creation and Cryptographic Validation': Implement `JwtTokenService` (`generateToken` + `parseAndValidate`) with unit tests for val...
JWT Creation and Cryptographic Validation — Hands-On Coding Exercise
// Verify signature + issuer + expiration on every token parse; reject tampered payloads immediately
Extending `OncePerRequestFilter`, extracting `Authorization: Bearer <token>`, validating token, setting `UsernamePasswordAuthenticationToken` on `SecurityContextHolder`, `addFilterBefore(..., UsernamePasswordAuthenticationFilter.class)`
16.11 Custom JWT OncePerRequestFilter (Week 16 • JWT & Stateless Auth) 1. What It Is, Why It Is Required & How It Works Custom JWT OncePerRequestFilter (JWT & Stateless Auth) covers Extending `OncePerRequestFilter`, extracting `Authorization: Bearer <token>`, validating token, setting `UsernamePasswordAuthenticationToken` on `SecurityContextHolder`, `addFilterBefore(..., UsernamePasswordAuthenticati...
Custom JWT OncePerRequestFilter — Practical Implementation Assignment
Complete and push your working JWT & Stateless Auth solution for 'Custom JWT OncePerRequestFilter': Implement `JwtAuthenticationFilter extends OncePerRequestFilter` and wire it into `SecurityFilterCha...
Custom JWT OncePerRequestFilter — Hands-On Coding Exercise
String header = request.getHeader("Authorization");
if (header != null && header.startsWith("Bearer ")) {
String token = header.substring(7);
// validate token & populate SecurityContextHolder.getContext().setAuthentication(...)
}
filterChain.doFilter(request, response);
`SessionCreationPolicy.STATELESS`, ensuring zero `JSESSIONID` cookies or server-side `HttpSession` memory growth
16.12 Stateless Session Configuration (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works Stateless Session Configuration (Spring Security 6) covers `SessionCreationPolicy.STATELESS`, ensuring zero `JSESSIONID` cookies or server-side `HttpSession` memory growth. It is required in backend engineering to Running 5 stateless Spring Boot containers behind a load balancer where any container...
Stateless Session Configuration — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'Stateless Session Configuration': Assert in an integration test that responses from your API never emit a `Set-Cookie: JSESSIONID` header...
Stateless Session Configuration — Hands-On Coding Exercise
.sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
Browser Same-Origin Policy, `OPTIONS` preflight requests, configuring explicit `CorsConfigurationSource` (`allowedOrigins` from env config, `allowedMethods`, `Authorization` header)
16.13 CORS (Cross-Origin Resource Sharing) (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works CORS (Cross-Origin Resource Sharing) (Spring Security 6) covers Browser Same-Origin Policy, `OPTIONS` preflight requests, configuring explicit `CorsConfigurationSource` (`allowedOrigins` from env config, `allowedMethods`, `Authorization` header). It is required in backend engineering to Allowi...
CORS (Cross-Origin Resource Sharing) — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'CORS (Cross-Origin Resource Sharing)': Configure an env-driven `CorsConfigurationSource` integrated into `SecurityFilterChain`. Include c...
CORS (Cross-Origin Resource Sharing) — Hands-On Coding Exercise
// Always wire .cors(Customizer.withDefaults()) inside SecurityFilterChain so OPTIONS preflights succeed!
How Cross-Site Request Forgery exploits ambient browser cookies, why cookie-based web apps MUST keep CSRF enabled vs why pure `Authorization: Bearer` header APIs disable CSRF
16.14 CSRF Protection and Stateless API Trade-offs (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works CSRF Protection and Stateless API Trade-offs (Spring Security 6) covers How Cross-Site Request Forgery exploits ambient browser cookies, why cookie-based web apps MUST keep CSRF enabled vs why pure `Authorization: Bearer` header APIs disable CSRF. It is required in backend engineering...
CSRF Protection and Stateless API Trade-offs — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'CSRF Protection and Stateless API Trade-offs': Document and verify stateless `Bearer`-only auth headers with CSRF disabled vs cookie CSRF...
CSRF Protection and Stateless API Trade-offs — Hands-On Coding Exercise
// Safe ONLY when auth uses explicit Authorization: Bearer header and zero session/auth cookies
Authorization Code + PKCE flow, Client vs Authorization Server (Keycloak/Auth0/Google) vs Resource Server (`oauth2ResourceServer(oauth2 -> oauth2.jwt(...))`), JWKS public keys
16.15 OAuth2 and OpenID Connect (OIDC) Fundamentals (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works OAuth2 and OpenID Connect (OIDC) Fundamentals (Spring Security 6) covers Authorization Code + PKCE flow, Client vs Authorization Server (Keycloak/Auth0/Google) vs Resource Server (`oauth2ResourceServer(oauth2 -> oauth2.jwt(...))`), JWKS public keys. It is required in backend engine...
OAuth2 and OpenID Connect (OIDC) Fundamentals — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'OAuth2 and OpenID Connect (OIDC) Fundamentals': Diagram the Authorization Code + PKCE flow and inspect Spring Boot’s `oauth2ResourceServe...
OAuth2 and OpenID Connect (OIDC) Fundamentals — Hands-On Coding Exercise
// Resource Server verifies RS256 JWTs using cached public keys from issuer's /.well-known/jwks.json
`@EnableMethodSecurity`, SpEL expressions `@PreAuthorize("hasRole('ADMIN')")`, `@PreAuthorize("#userId == authentication.principal.userId or hasRole('ADMIN')")`
16.16 Method-Level Security (@EnableMethodSecurity, @PreAuthorize) (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works Method-Level Security (@EnableMethodSecurity, @PreAuthorize) (Spring Security 6) covers `@EnableMethodSecurity`, SpEL expressions `@PreAuthorize("hasRole('ADMIN')")`, `@PreAuthorize("#userId == authentication.principal.userId or hasRole('AD...
Method-Level Security (@EnableMethodSecurity, @PreAuthorize) — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'Method-Level Security (@EnableMethodSecurity, @PreAuthorize)': Add `@EnableMethodSecurity` and protect admin product mutations and custom...
Method-Level Security (@EnableMethodSecurity, @PreAuthorize) — Hands-On Coding Exercise
@org.springframework.security.access.prepost.PreAuthorize("hasRole('ADMIN')")
public ProductResponse updatePrice(Long productId, BigDecimal newPrice) { /* ... */ }
`@WithMockUser(roles = "ADMIN")`, testing unauthenticated `401`, wrong-role `403`, valid-JWT `200`/`201`, and cross-user BOLA `403`/`404` with `MockMvc`
16.17 Security Integration Testing (spring-security-test) (Week 16 • Spring Security 6) 1. What It Is, Why It Is Required & How It Works Security Integration Testing (spring-security-test) (Spring Security 6) covers `@WithMockUser(roles = "ADMIN")`, testing unauthenticated `401`, wrong-role `403`, valid-JWT `200`/`201`, and cross-user BOLA `403`/`404` with `MockMvc`. It is required in backend engineerin...
Security Integration Testing (spring-security-test) — Practical Implementation Assignment
Complete and push your working Spring Security 6 solution for 'Security Integration Testing (spring-security-test)': Write `MockMvc` security tests covering `401` (no token), `403` (CUSTOMER hitting A...
Security Integration Testing (spring-security-test) — Hands-On Coding Exercise
mockMvc.perform(delete("/api/v1/admin/products/10"))
.andExpect(status().isUnauthorized());
Architect and build a complete, production-style monolithic Spring Boot 3 REST backend for an E-Commerce platform featuring stateless JWT authentication, role-based access control (`ADMIN`, `CUSTOMER`), PostgreSQL/JPA persistence, shopping cart & atomic order checkout, Jakarta validation, RFC-7807 global exception handling, pagination/filtering, and OpenAPI/Swagger documentation.
Module Learning & Hands-On Objectives
Single deployable artifact, local ACID transactions, low operational overhead vs deployment contention, blast radius, and coupled scaling at large team sizes
17.1 Monolithic Architecture (Strengths, Modularity and Scaling Limits) (Week 17 • Microservices) 1. What It Is, Why It Is Required & How It Works Monolithic Architecture (Strengths, Modularity and Scaling Limits) (Microservices) covers Single deployable artifact, local ACID transactions, low operational overhead vs deployment contention, blast radius, and coupled scaling at large team sizes. It is required in ba...
Monolithic Architecture (Strengths, Modularity and Scaling Limits) — Practical Implementation Assignment
Complete and push your working Microservices solution for 'Monolithic Architecture (Strengths, Modularity and Scaling Limits)': Analyze your Month 4 E-Commerce monolith to identify tight coupling poin...
Monolithic Architecture (Strengths, Modularity and Scaling Limits) — Hands-On Coding Exercise
// Modular Monolith: single JVM & ACID DB | Microservices: independent deployment, scaling & DB per service
Independent deployability, fault isolation, per-service scaling, database-per-service autonomy vs network fallacies, eventual consistency, and observability needs
17.2 Microservices Architecture (Benefits and Distributed Challenges) (Week 17 • Microservices) 1. What It Is, Why It Is Required & How It Works Microservices Architecture (Benefits and Distributed Challenges) (Microservices) covers Independent deployability, fault isolation, per-service scaling, database-per-service autonomy vs network fallacies, eventual consistency, and observability needs. It is required in b...
Microservices Architecture (Benefits and Distributed Challenges) — Practical Implementation Assignment
Complete and push your working Microservices solution for 'Microservices Architecture (Benefits and Distributed Challenges)': Design the target 6-service topology and database ownership map for Month...
Microservices Architecture (Benefits and Distributed Challenges) — Hands-On Coding Exercise
// Rule #1: Each microservice owns its private database schema; cross-service access happens ONLY via APIs/Events
Decomposing by business capability and subdomain rather than technical layers, sizing boundaries around transactional invariants
17.3 Service Decomposition Strategies (Week 17 • Microservices) 1. What It Is, Why It Is Required & How It Works Service Decomposition Strategies (Microservices) covers Decomposing by business capability and subdomain rather than technical layers, sizing boundaries around transactional invariants. It is required in backend engineering to Splitting `Catalog`, `Order`, `Inventory`, `Payment`, and `Notification` so...
Service Decomposition Strategies — Practical Implementation Assignment
Complete and push your working Microservices solution for 'Service Decomposition Strategies': Define owned tables, public REST endpoints, and emitted events for each of the 6 E-Commerce microservices....
Service Decomposition Strategies — Hands-On Coding Exercise
// Decompose by business capability: user-service, product-service, order-service, inventory-service, payment-service, notification-service
Ubiquitous Language, how `"Product"` means title/description/SEO in `Catalog` Context vs SKU/warehouse-bin/qty in `Inventory` Context, Anti-Corruption Layer
17.4 Bounded Context and DDD Fundamentals (Week 17 • Microservices) 1. What It Is, Why It Is Required & How It Works Bounded Context and DDD Fundamentals (Microservices) covers Ubiquitous Language, how `"Product"` means title/description/SEO in `Catalog` Context vs SKU/warehouse-bin/qty in `Inventory` Context, Anti-Corruption Layer. It is required in backend engineering to Avoiding one bloated 80-field...
Bounded Context and DDD Fundamentals — Practical Implementation Assignment
Complete and push your working Microservices solution for 'Bounded Context and DDD Fundamentals': Model distinct `CatalogProduct` vs `StockItem` representations in their respective Bounded Contexts. I...
Bounded Context and DDD Fundamentals — Hands-On Coding Exercise
// Catalog Context cares about name/price/category; Inventory Context cares only about skuCode & availableQty
Request-response HTTP/REST (immediate query/validation) vs event-driven Kafka messaging (temporal decoupling, resilience when downstream is offline)
17.5 Service Communication (Synchronous vs Asynchronous) (Week 17 • Microservices) 1. What It Is, Why It Is Required & How It Works Service Communication (Synchronous vs Asynchronous) (Microservices) covers Request-response HTTP/REST (immediate query/validation) vs event-driven Kafka messaging (temporal decoupling, resilience when downstream is offline). It is required in backend engineering to Validating SKU pri...
Service Communication (Synchronous vs Asynchronous) — Practical Implementation Assignment
Complete and push your working Microservices solution for 'Service Communication (Synchronous vs Asynchronous)': Classify every interaction in E-Commerce checkout as synchronous REST vs asynchronous e...
Service Communication (Synchronous vs Asynchronous) — Hands-On Coding Exercise
// Sync HTTP: immediate read needed now | Async Kafka: downstream reactions & eventual consistency
Contract DTOs, connection & read timeouts (NEVER leave infinite defaults!), propagating auth/correlation headers, handling downstream `4xx` vs `5xx`
17.6 Service-to-Service REST Communication (Week 17 • Microservices) 1. What It Is, Why It Is Required & How It Works Service-to-Service REST Communication (Microservices) covers Contract DTOs, connection & read timeouts (NEVER leave infinite defaults!), propagating auth/correlation headers, handling downstream `4xx` vs `5xx`. It is required in backend engineering to `order-service` verifying product pricing...
Service-to-Service REST Communication — Practical Implementation Assignment
Complete and push your working Microservices solution for 'Service-to-Service REST Communication': Configure explicit `connectTimeout(1s)` and `readTimeout(2s)` on inter-service HTTP clients. Include...
Service-to-Service REST Communication — Hands-On Coding Exercise
// Every outbound HTTP client in production MUST define explicit connect and read timeouts
`@EnableFeignClients`, `@FeignClient(name = "product-service")`, declarative Spring MVC annotations, `ErrorDecoder`, timeout & logging configuration
17.7 Spring Cloud OpenFeign (Declarative REST Clients) (Week 17 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Spring Cloud OpenFeign (Declarative REST Clients) (Spring Cloud) covers `@EnableFeignClients`, `@FeignClient(name = "product-service")`, declarative Spring MVC annotations, `ErrorDecoder`, timeout & logging configuration. It is required in backend engineering to Calling `p...
Spring Cloud OpenFeign (Declarative REST Clients) — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Spring Cloud OpenFeign (Declarative REST Clients)': Create `ProductFeignClient` and `InventoryFeignClient` inside `order-service`. Include cle...
Spring Cloud OpenFeign (Declarative REST Clients) — Hands-On Coding Exercise
@org.springframework.cloud.openfeign.FeignClient(name = "product-service", path = "/api/v1/products")
public interface ProductClient {
@GetMapping("/sku/{sku}")
ProductSnapshotDto getBySku(@PathVariable String sku);
}
Maintaining `RestTemplate` in existing codebases vs migrating to Spring 6.1+ fluent synchronous `RestClient`
17.8 RestTemplate Legacy Awareness & Modern Spring RestClient (Week 17 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works RestTemplate Legacy Awareness & Modern Spring RestClient (Spring Boot 3) covers Maintaining `RestTemplate` in existing codebases vs migrating to Spring 6.1+ fluent synchronous `RestClient`. It is required in backend engineering to Reading brownfield `RestTemplate` code c...
RestTemplate Legacy Awareness & Modern Spring RestClient — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'RestTemplate Legacy Awareness & Modern Spring RestClient': Refactor a legacy `RestTemplate.exchange(...)` snippet into Spring 6’s fluent `Res...
RestTemplate Legacy Awareness & Modern Spring RestClient — Hands-On Coding Exercise
ProductSnapshotDto dto = restClient.get()
.uri("http://product-service/api/v1/products/sku/{sku}", sku)
.retrieve()
.body(ProductSnapshotDto.class);
`WebClient.builder()`, `Mono`/`Flux` basics, parallel scatter-gather fan-out calls, timeout & error status handlers (`onStatus`)
17.9 WebClient (Non-Blocking & Reactive HTTP Client) (Week 17 • Spring Boot 3) 1. What It Is, Why It Is Required & How It Works WebClient (Non-Blocking & Reactive HTTP Client) (Spring Boot 3) covers `WebClient.builder()`, `Mono`/`Flux` basics, parallel scatter-gather fan-out calls, timeout & error status handlers (`onStatus`). It is required in backend engineering to Firing concurrent non-blocking HTT...
WebClient (Non-Blocking & Reactive HTTP Client) — Practical Implementation Assignment
Complete and push your working Spring Boot 3 solution for 'WebClient (Non-Blocking & Reactive HTTP Client)': Use `WebClient` with explicit `.timeout(Duration.ofSeconds(2))` and `.onStatus(...)` error...
WebClient (Non-Blocking & Reactive HTTP Client) — Hands-On Coding Exercise
Mono<ProductSnapshotDto> mono = webClient.get()
.uri("/api/v1/products/{id}", id)
.retrieve()
.bodyToMono(ProductSnapshotDto.class)
.timeout(java.time.Duration.ofSeconds(2));
Why hardcoded `localhost:8082` breaks in autoscaled container environments, client-side vs server-side service discovery, heartbeats & eviction
17.10 Service Discovery Concepts (Week 17 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Service Discovery Concepts (Spring Cloud) covers Why hardcoded `localhost:8082` breaks in autoscaled container environments, client-side vs server-side service discovery, heartbeats & eviction. It is required in backend engineering to Resolving logical service names (`lb://inventory-service`) dynamically...
Service Discovery Concepts — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Service Discovery Concepts': Compare client-side Eureka discovery with DNS/container-orchestrator service discovery. Include clear method/sche...
Service Discovery Concepts — Hands-On Coding Exercise
// Logical URI lb://inventory-service resolves dynamically to healthy registered host:port instances
Eureka Server registry dashboard (`8761`), instance registration, 30s heartbeats, self-preservation mode
17.11 Netflix Eureka Service Registry and Discovery (Week 17 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Netflix Eureka Service Registry and Discovery (Spring Cloud) covers Eureka Server registry dashboard (`8761`), instance registration, 30s heartbeats, self-preservation mode. It is required in backend engineering to Running a local & staging Eureka discovery registry where all microserv...
Netflix Eureka Service Registry and Discovery — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Netflix Eureka Service Registry and Discovery': Boot `discovery-server` on port `8761` and verify `product-service` & `order-service` appear U...
Netflix Eureka Service Registry and Discovery — Hands-On Coding Exercise
@EnableEurekaServer
@SpringBootApplication
public class DiscoveryServerApplication {}
Single public edge entry point, path routing, centralized JWT verification, rate limiting, CORS handling, hiding internal microservice ports
17.12 API Gateway Responsibilities (Week 17 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works API Gateway Responsibilities (Spring Cloud) covers Single public edge entry point, path routing, centralized JWT verification, rate limiting, CORS handling, hiding internal microservice ports. It is required in backend engineering to Exposing only `api-gateway:8080` to external clients while keeping intern...
API Gateway Responsibilities — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'API Gateway Responsibilities': Map public `/api/v1/users/**`, `/api/v1/products/**`, and `/api/v1/orders/**` routes through a single gateway....
API Gateway Responsibilities — Hands-On Coding Exercise
// External Client -> API Gateway (:8080) -> lb://user-service | lb://product-service | lb://order-service
`spring-cloud-starter-gateway`, Route Predicates (`Path`), GatewayFilters (`AddRequestHeader`, `StripPrefix`, `RequestRateLimiter`), `lb://` Eureka integration
17.13 Spring Cloud Gateway Implementation (Week 17 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Spring Cloud Gateway Implementation (Spring Cloud) covers `spring-cloud-starter-gateway`, Route Predicates (`Path`), GatewayFilters (`AddRequestHeader`, `StripPrefix`, `RequestRateLimiter`), `lb://` Eureka integration. It is required in backend engineering to Configuring declarative YAML routes forw...
Spring Cloud Gateway Implementation — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Spring Cloud Gateway Implementation': Build `api-gateway` routing traffic to `product-service` and `order-service` via `lb://`. Include clear...
Spring Cloud Gateway Implementation — Hands-On Coding Exercise
spring:
cloud:
gateway:
routes:
- id: order-service
uri: lb://order-service
predicates:
- Path=/api/v1/orders/**
Spring Cloud LoadBalancer (`@LoadBalanced`), Round-Robin instance selection across multiple running ports (`--server.port=0`)
17.14 Client-Side Load Balancing (Week 17 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Client-Side Load Balancing (Spring Cloud) covers Spring Cloud LoadBalancer (`@LoadBalanced`), Round-Robin instance selection across multiple running ports (`--server.port=0`). It is required in backend engineering to Distributing `order-service` traffic evenly across two running `product-service` instances a...
Client-Side Load Balancing — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Client-Side Load Balancing': Launch 2 instances of `product-service` on different ports and verify Round-Robin load balancing through Gateway...
Client-Side Load Balancing — Hands-On Coding Exercise
@Bean
@org.springframework.cloud.client.loadbalancer.LoadBalanced
public RestClient.Builder loadBalancedRestClientBuilder() { return RestClient.builder(); }
Why managing 12 separate `application.yml` files across 6 services x 3 environments drifts without centralized config
17.15 Centralized Configuration Management Concepts (Week 17 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Centralized Configuration Management Concepts (Spring Cloud) covers Why managing 12 separate `application.yml` files across 6 services x 3 environments drifts without centralized config. It is required in backend engineering to Storing version-controlled service configuration in a central...
Centralized Configuration Management Concepts — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Centralized Configuration Management Concepts': Structure shared (`application.yml`) vs service-specific (`order-service-dev.yml`) centralized...
Centralized Configuration Management Concepts — Hands-On Coding Exercise
# config-repo/
# application.yml (shared Eureka/logging defaults)
# order-service.yml (service-specific settings)
`@EnableConfigServer`, `spring.config.import=optional:configserver:http://localhost:8888`, actuator `/refresh` awareness
17.16 Spring Cloud Config Server & Client (Week 17 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Spring Cloud Config Server & Client (Spring Cloud) covers `@EnableConfigServer`, `spring.config.import=optional:configserver:http://localhost:8888`, actuator `/refresh` awareness. It is required in backend engineering to Serving environment-specific configuration from `config-server` to all...
Spring Cloud Config Server & Client — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Spring Cloud Config Server & Client': Boot `config-server` (`8888`) and verify `product-service` pulls its configuration cleanly. Include clea...
Spring Cloud Config Server & Client — Hands-On Coding Exercise
spring:
config:
import: "optional:configserver:${CONFIG_SERVER_URL:http://localhost:8888}"
Trace ID (spans entire multi-service request) vs Span ID (single hop/operation), W3C `traceparent` header propagation
17.17 Distributed Tracing Concepts (Week 17 • Observability) 1. What It Is, Why It Is Required & How It Works Distributed Tracing Concepts (Observability) covers Trace ID (spans entire multi-service request) vs Span ID (single hop/operation), W3C `traceparent` header propagation. It is required in backend engineering to Reconstructing exact millisecond timelines across `Gateway -> Order -> Inventory -> P...
Distributed Tracing Concepts — Practical Implementation Assignment
Complete and push your working Observability solution for 'Distributed Tracing Concepts': Trace a single HTTP checkout call across 3 microservice logs using shared Trace IDs. Include clear method/sche...
Distributed Tracing Concepts — Hands-On Coding Exercise
// W3C traceparent header propagates traceId across Gateway -> Feign/RestClient -> Kafka
Gateway GlobalFilter generating `X-Correlation-Id` if absent, propagating via Feign `RequestInterceptor` and SLF4J MDC into every log line & error response
17.18 Correlation ID Request Tracking (Week 17 • Observability) 1. What It Is, Why It Is Required & How It Works Correlation ID Request Tracking (Observability) covers Gateway GlobalFilter generating `X-Correlation-Id` if absent, propagating via Feign `RequestInterceptor` and SLF4J MDC into every log line & error response. It is required in backend engineering to Giving support engineers a `correlationId` in...
Correlation ID Request Tracking — Practical Implementation Assignment
Complete and push your working Observability solution for 'Correlation ID Request Tracking': Implement a Gateway `X-Correlation-Id` generator + downstream MDC filter with `finally { MDC.clear(); }`. I...
Correlation ID Request Tracking — Hands-On Coding Exercise
try {
org.slf4j.MDC.put("correlationId", correlationId);
chain.doFilter(req, res);
} finally {
org.slf4j.MDC.remove("correlationId");
}
Extract `product-service` and `order-service` behind `api-gateway` and `discovery-server` (Eureka) with declarative `OpenFeign` calls, Spring Cloud Config externalization, and `X-Correlation-Id` request propagation.
Module Learning & Hands-On Objectives
Spring Cloud 2023/2024 release trains compatible with Spring Boot 3.x, BOM alignment (`spring-cloud-dependencies`), key cloud-native starters
18.1 Spring Cloud Ecosystem and Release Train Compatibility (Week 18 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Spring Cloud Ecosystem and Release Train Compatibility (Spring Cloud) covers Spring Cloud 2023/2024 release trains compatible with Spring Boot 3.x, BOM alignment (`spring-cloud-dependencies`), key cloud-native starters. It is required in backend engineering to Importing `spring-clo...
Spring Cloud Ecosystem and Release Train Compatibility — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Spring Cloud Ecosystem and Release Train Compatibility': Verify `spring-cloud-dependencies` BOM configuration in parent/service `pom.xml` file...
Spring Cloud Ecosystem and Release Train Compatibility — Hands-On Coding Exercise
<!-- Import spring-cloud-dependencies in <dependencyManagement> matching your Spring Boot 3.x minor version -->
Standalone & peer-aware Eureka Server config, Actuator health endpoints, lease expiration & renewal intervals in dev vs prod
18.2 Eureka Server Registry Setup and Health Tuning (Week 18 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Eureka Server Registry Setup and Health Tuning (Spring Cloud) covers Standalone & peer-aware Eureka Server config, Actuator health endpoints, lease expiration & renewal intervals in dev vs prod. It is required in backend engineering to Keeping a clean service registry health view a...
Eureka Server Registry Setup and Health Tuning — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Eureka Server Registry Setup and Health Tuning': Configure Eureka Server with Actuator health probes and clean dev lease intervals. Include cl...
Eureka Server Registry Setup and Health Tuning — Hands-On Coding Exercise
eureka:
client:
register-with-eureka: false
fetch-registry: false
`spring.application.name` (critical service ID!), `prefer-ip-address: true` in Docker containers, graceful deregistration on shutdown
18.3 Eureka Client Registration and Metadata (Week 18 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Eureka Client Registration and Metadata (Spring Cloud) covers `spring.application.name` (critical service ID!), `prefer-ip-address: true` in Docker containers, graceful deregistration on shutdown. It is required in backend engineering to Setting `prefer-ip-address: true` so Docker containers adve...
Eureka Client Registration and Metadata — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Eureka Client Registration and Metadata': Configure `prefer-ip-address: true` and Actuator health status propagation on all Eureka clients. In...
Eureka Client Registration and Metadata — Hands-On Coding Exercise
eureka:
instance:
prefer-ip-address: true
Path/Method/Header predicates, `RewritePath`, custom `GlobalFilter` & `GatewayFilterFactory` for request logging and header sanitization
18.4 Spring Cloud Gateway Routing and Custom Filters (Week 18 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Spring Cloud Gateway Routing and Custom Filters (Spring Cloud) covers Path/Method/Header predicates, `RewritePath`, custom `GlobalFilter` & `GatewayFilterFactory` for request logging and header sanitization. It is required in backend engineering to Stripping spoofed client-supplied `X...
Spring Cloud Gateway Routing and Custom Filters — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Spring Cloud Gateway Routing and Custom Filters': Write a Gateway `GlobalFilter` that strips untrusted `X-Auth-*` headers before authenticatin...
Spring Cloud Gateway Routing and Custom Filters — Hands-On Coding Exercise
// SECURITY: Strip any inbound X-User-Id / X-User-Roles headers from external clients at the Gateway edge!
Validating Bearer JWTs at Spring Cloud Gateway (`SecurityWebFilterChain`) and propagating verified principal claims/tokens downstream
18.5 API Gateway Security (Edge JWT Authentication) (Week 18 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works API Gateway Security (Edge JWT Authentication) (Spring Cloud) covers Validating Bearer JWTs at Spring Cloud Gateway (`SecurityWebFilterChain`) and propagating verified principal claims/tokens downstream. It is required in backend engineering to Rejecting unauthenticated or expired tokens r...
API Gateway Security (Edge JWT Authentication) — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'API Gateway Security (Edge JWT Authentication)': Configure edge JWT validation on `api-gateway` allowing public catalog reads and gating `/api...
API Gateway Security (Edge JWT Authentication) — Hands-On Coding Exercise
// Public routes: /api/v1/auth/**, GET /api/v1/products/** | Protected routes: /api/v1/orders/**, /api/v1/payments/**
Round-Robin vs Random load balancing, health-check-aware instance filtering, caching discovered instance lists
18.6 Spring Cloud LoadBalancer Customization (Week 18 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Spring Cloud LoadBalancer Customization (Spring Cloud) covers Round-Robin vs Random load balancing, health-check-aware instance filtering, caching discovered instance lists. It is required in backend engineering to Routing inter-service calls only to `UP` instances without hitting crashed contain...
Spring Cloud LoadBalancer Customization — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Spring Cloud LoadBalancer Customization': Verify Spring Cloud LoadBalancer behavior when 1 of 2 `inventory-service` instances shuts down. Incl...
Spring Cloud LoadBalancer Customization — Hands-On Coding Exercise
// Spring Cloud LoadBalancer replaces legacy Netflix Ribbon in Spring Boot 3
Why a slow downstream service takes down the entire microservice fleet via thread-pool saturation; `CLOSED` -> `OPEN` -> `HALF_OPEN` state machine
18.7 Circuit Breaker Pattern (Preventing Cascading Failures) (Week 18 • Resilience) 1. What It Is, Why It Is Required & How It Works Circuit Breaker Pattern (Preventing Cascading Failures) (Resilience) covers Why a slow downstream service takes down the entire microservice fleet via thread-pool saturation; `CLOSED` -> `OPEN` -> `HALF_OPEN` state machine. It is required in backend engineering to Failing fast...
Circuit Breaker Pattern (Preventing Cascading Failures) — Practical Implementation Assignment
Complete and push your working Resilience solution for 'Circuit Breaker Pattern (Preventing Cascading Failures)': Diagram the `CLOSED -> OPEN -> HALF_OPEN -> CLOSED` transitions with sliding-window th...
Circuit Breaker Pattern (Preventing Cascading Failures) — Hands-On Coding Exercise
// CLOSED (normal) --failureRate>=50%--> OPEN (fail fast) --waitDuration--> HALF_OPEN (probe N calls)
`spring-cloud-starter-circuitbreaker-resilience4j`, `@CircuitBreaker(name = "inventory", fallbackMethod = "...")`, `slidingWindowSize`, `failureRateThreshold`, Actuator `/actuator/circuitbreakers`
18.8 Resilience4j CircuitBreaker Implementation (Week 18 • Resilience) 1. What It Is, Why It Is Required & How It Works Resilience4j CircuitBreaker Implementation (Resilience) covers `spring-cloud-starter-circuitbreaker-resilience4j`, `@CircuitBreaker(name = "inventory", fallbackMethod = "...")`, `slidingWindowSize`, `failureRateThreshold`, Actuator `/actuator/circuitbreakers`. It is required...
Resilience4j CircuitBreaker Implementation — Practical Implementation Assignment
Complete and push your working Resilience solution for 'Resilience4j CircuitBreaker Implementation': Add `@CircuitBreaker` to `OrderService` -> `InventoryClient` and verify `/actuator/circuitbreakers`...
Resilience4j CircuitBreaker Implementation — Hands-On Coding Exercise
@io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker(name = "inventory", fallbackMethod = "inventoryFallback")
public StockCheckResponse verifyStock(String sku, int qty) {
return inventoryClient.checkStock(sku, qty);
}
`@Retry` configuration, maxAttempts, exponential backoff + random jitter (preventing retry storms/thundering herd!), retrying ONLY transient idempotent operations
18.9 Retry Policies and Exponential Backoff with Jitter (Week 18 • Resilience) 1. What It Is, Why It Is Required & How It Works Retry Policies and Exponential Backoff with Jitter (Resilience) covers `@Retry` configuration, maxAttempts, exponential backoff + random jitter (preventing retry storms/thundering herd!), retrying ONLY transient idempotent operations. It is required in backend engineering to Retrying a t...
Retry Policies and Exponential Backoff with Jitter — Practical Implementation Assignment
Complete and push your working Resilience solution for 'Retry Policies and Exponential Backoff with Jitter': Configure Resilience4j `@Retry` with exponential backoff and `ignoreExceptions` for `4xx` v...
Retry Policies and Exponential Backoff with Jitter — Hands-On Coding Exercise
resilience4j.retry.instances.inventory:
maxAttempts: 3
waitDuration: 250ms
enableExponentialBackoff: true
Protecting login/OTP/checkout APIs from abuse and traffic spikes using Resilience4j `@RateLimiter` (`limitForPeriod`, `limitRefreshPeriod`) -> HTTP `429 Too Many Requests`
18.10 Rate Limiting and Request Throttling (Week 18 • Resilience) 1. What It Is, Why It Is Required & How It Works Rate Limiting and Request Throttling (Resilience) covers Protecting login/OTP/checkout APIs from abuse and traffic spikes using Resilience4j `@RateLimiter` (`limitForPeriod`, `limitRefreshPeriod`) -> HTTP `429 Too Many Requests`. It is required in backend engineering to Throttling `/api/v1/auth/lo...
Rate Limiting and Request Throttling — Practical Implementation Assignment
Complete and push your working Resilience solution for 'Rate Limiting and Request Throttling': Apply `@RateLimiter` and map `RequestNotPermitted` to HTTP `429 Too Many Requests`. Include clear method/...
Rate Limiting and Request Throttling — Hands-On Coding Exercise
@ExceptionHandler(io.github.resilience4j.ratelimiter.RequestNotPermitted.class)
public ProblemDetail handleRateLimit(Exception ex) {
return ProblemDetail.forStatusAndDetail(HttpStatus.TOO_MANY_REQUESTS, "Rate limit exceeded. Please retry shortly.");
}
Socket read timeouts, Resilience4j `@TimeLimiter` / `@Bulkhead` (isolating thread/semaphore pools per downstream dependency so one slow partner cannot starve healthy endpoints)
18.11 Timeouts and Bulkhead Isolation (Week 18 • Resilience) 1. What It Is, Why It Is Required & How It Works Timeouts and Bulkhead Isolation (Resilience) covers Socket read timeouts, Resilience4j `@TimeLimiter` / `@Bulkhead` (isolating thread/semaphore pools per downstream dependency so one slow partner cannot starve healthy endpoints). It is required in backend engineering to Capping concurrent outbound calls t...
Timeouts and Bulkhead Isolation — Practical Implementation Assignment
Complete and push your working Resilience solution for 'Timeouts and Bulkhead Isolation': Configure `@Bulkhead` semaphore limits alongside HTTP client connect/read timeouts. Include clear method/schem...
Timeouts and Bulkhead Isolation — Hands-On Coding Exercise
// Bulkhead isolates concurrency per downstream dependency so one slow service cannot sink the whole JVM
Cached stale read fallback, default degraded response, queuing order as `PENDING_VERIFICATION` vs explicit `503 Service Unavailable` when safety requires
18.12 Graceful Fallback Strategies (Week 18 • Resilience) 1. What It Is, Why It Is Required & How It Works Graceful Fallback Strategies (Resilience) covers Cached stale read fallback, default degraded response, queuing order as `PENDING_VERIFICATION` vs explicit `503 Service Unavailable` when safety requires. It is required in backend engineering to Serving cached product recommendations when the recommendation s...
Graceful Fallback Strategies — Practical Implementation Assignment
Complete and push your working Resilience solution for 'Graceful Fallback Strategies': Implement safe degraded fallbacks for catalog enrichment vs fail-safe status for stock reservation. Include clear...
Graceful Fallback Strategies — Hands-On Coding Exercise
private StockCheckResponse inventoryFallback(String sku, int qty, Throwable ex) {
log.warn("Inventory unavailable for sku={}, marking deferred check: {}", sku, ex.toString());
return new StockCheckResponse(sku, false, "DEFERRED_CHECK");
}
Why classic XA / Two-Phase Commit (2PC) locks resources across services and kills availability (CAP theorem trade-offs) in modern cloud microservices
18.13 Distributed Transactions Problem Space (Week 18 • Distributed Systems) 1. What It Is, Why It Is Required & How It Works Distributed Transactions Problem Space (Distributed Systems) covers Why classic XA / Two-Phase Commit (2PC) locks resources across services and kills availability (CAP theorem trade-offs) in modern cloud microservices. It is required in backend engineering to Coordinating `Order Creation`...
Distributed Transactions Problem Space — Practical Implementation Assignment
Complete and push your working Distributed Systems solution for 'Distributed Transactions Problem Space': Trace exact partial-failure scenarios across Order, Inventory, and Payment databases. Include...
Distributed Transactions Problem Space — Hands-On Coding Exercise
// @Transactional ONLY spans one local DataSource — cross-service consistency requires Sagas + Compensating Actions!
Local ACID transactions per service + compensating transactions (`ReleaseStock` if `PaymentFailed`, `CancelOrder`); Event Choreography (peer events) vs Saga Orchestrator
18.14 Saga Pattern (Choreography vs Orchestration) (Week 18 • Distributed Systems) 1. What It Is, Why It Is Required & How It Works Saga Pattern (Choreography vs Orchestration) (Distributed Systems) covers Local ACID transactions per service + compensating transactions (`ReleaseStock` if `PaymentFailed`, `CancelOrder`); Event Choreography (peer events) vs Saga Orchestrator. It is required in backend engineering t...
Saga Pattern (Choreography vs Orchestration) — Practical Implementation Assignment
Complete and push your working Distributed Systems solution for 'Saga Pattern (Choreography vs Orchestration)': Model the complete forward + compensating Saga state machine for E-Commerce Order Checko...
Saga Pattern (Choreography vs Orchestration) — Hands-On Coding Exercise
// Forward: OrderCreated -> StockReserved -> PaymentCaptured -> OrderConfirmed
// Compensate on PaymentFailed: ReleaseReservedStock -> MarkOrderPaymentFailed
Strong consistency within an aggregate vs eventual consistency across Bounded Contexts, intermediate lifecycle states (`PENDING_PAYMENT`), UI/API polling & webhooks
18.15 Eventual Consistency in Distributed Systems (Week 18 • Distributed Systems) 1. What It Is, Why It Is Required & How It Works Eventual Consistency in Distributed Systems (Distributed Systems) covers Strong consistency within an aggregate vs eventual consistency across Bounded Contexts, intermediate lifecycle states (`PENDING_PAYMENT`), UI/API polling & webhooks. It is required in backend engineering to R...
Eventual Consistency in Distributed Systems — Practical Implementation Assignment
Complete and push your working Distributed Systems solution for 'Eventual Consistency in Distributed Systems': Design clean `OrderStatus` state transitions (`CREATED`, `RESERVED`, `PAID`, `FAILED`, `C...
Eventual Consistency in Distributed Systems — Hands-On Coding Exercise
public enum OrderStatus { CREATED, STOCK_RESERVED, PAID, CONFIRMED, PAYMENT_FAILED, CANCELLED }
`Idempotency-Key` UUID header, `idempotency_keys` PostgreSQL unique constraint table storing `(key, user_id, request_hash, response_json, status_code)`
18.16 Idempotency in Distributed APIs (Week 18 • Distributed Systems) 1. What It Is, Why It Is Required & How It Works Idempotency in Distributed APIs (Distributed Systems) covers `Idempotency-Key` UUID header, `idempotency_keys` PostgreSQL unique constraint table storing `(key, user_id, request_hash, response_json, status_code)`. It is required in backend engineering to Guaranteeing that if a mobile app retries...
Idempotency in Distributed APIs — Practical Implementation Assignment
Complete and push your working Distributed Systems solution for 'Idempotency in Distributed APIs': Implement an `Idempotency-Key` guard backed by a unique PostgreSQL constraint on `POST /api/v1/orders...
Idempotency in Distributed APIs — Hands-On Coding Exercise
// Unique DB constraint on (user_id, idempotency_key) guarantees at-most-once side-effect execution
Environment profiles in Config Server, health checks, fail-fast vs optional config startup, encrypting sensitive config properties
18.17 Centralized Config Server Operations (Week 18 • Spring Cloud) 1. What It Is, Why It Is Required & How It Works Centralized Config Server Operations (Spring Cloud) covers Environment profiles in Config Server, health checks, fail-fast vs optional config startup, encrypting sensitive config properties. It is required in backend engineering to Managing shared Kafka broker addresses, Eureka URLs, and Resilience...
Centralized Config Server Operations — Practical Implementation Assignment
Complete and push your working Spring Cloud solution for 'Centralized Config Server Operations': Centralize Resilience4j and logging config across `order-service` and `inventory-service` in Config Ser...
Centralized Config Server Operations — Hands-On Coding Exercise
# Shared Resilience4j defaults served centrally from config-server
Spring Boot 3 `micrometer-tracing-bridge-brave` + `zipkin-reporter-brave` (replaces deprecated Spring Cloud Sleuth!), automatic `[service,traceId,spanId]` log pattern
18.18 Distributed Tracing with Micrometer Tracing (Week 18 • Observability) 1. What It Is, Why It Is Required & How It Works Distributed Tracing with Micrometer Tracing (Observability) covers Spring Boot 3 `micrometer-tracing-bridge-brave` + `zipkin-reporter-brave` (replaces deprecated Spring Cloud Sleuth!), automatic `[service,traceId,spanId]` log pattern. It is required in backend engineering to Visualizing end...
Distributed Tracing with Micrometer Tracing — Practical Implementation Assignment
Complete and push your working Observability solution for 'Distributed Tracing with Micrometer Tracing': Enable `micrometer-tracing-bridge-brave` and verify `[appName,traceId,spanId]` appears automati...
Distributed Tracing with Micrometer Tracing — Hands-On Coding Exercise
management:
tracing:
sampling:
probability: 1.0
Structured JSON logs (what happened), Actuator + Micrometer Prometheus metrics (`/actuator/health`, `/actuator/metrics`, JVM/HikariCP/HTTP p95 latency), and Traces (where latency occurred)
18.19 Three Pillars of Observability (Logs, Metrics and Traces) (Week 18 • Observability) 1. What It Is, Why It Is Required & How It Works Three Pillars of Observability (Logs, Metrics and Traces) (Observability) covers Structured JSON logs (what happened), Actuator + Micrometer Prometheus metrics (`/actuator/health`, `/actuator/metrics`, JVM/HikariCP/HTTP p95 latency), and Traces (where latency occurred). It is...
Three Pillars of Observability (Logs, Metrics and Traces) — Practical Implementation Assignment
Complete and push your working Observability solution for 'Three Pillars of Observability (Logs, Metrics and Traces)': Register a custom `Counter` (`orders.created.total`) via Micrometer `MeterRegistr...
Three Pillars of Observability (Logs, Metrics and Traces) — Hands-On Coding Exercise
meterRegistry.counter("orders.created.total", "status", "SUCCESS").increment();
Harden `order-service` -> `inventory-service` -> `payment-service` interactions using Resilience4j CircuitBreakers, exponential-backoff Retries, RateLimiters, `Idempotency-Key` deduplication, Saga compensating actions, and Micrometer Tracing.
Module Learning & Hands-On Objectives
Producers, brokers, consumers, point-to-point queues vs pub/sub event streams, temporal & runtime decoupling
19.1 Messaging Fundamentals and Event-Driven Architecture (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Messaging Fundamentals and Event-Driven Architecture (Apache Kafka) covers Producers, brokers, consumers, point-to-point queues vs pub/sub event streams, temporal & runtime decoupling. It is required in backend engineering to Allowing `order-service` to accept orders in 15ms even...
Messaging Fundamentals and Event-Driven Architecture — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Messaging Fundamentals and Event-Driven Architecture': Map producers, topics, and independent consumer groups across the E-Commerce order life...
Messaging Fundamentals and Event-Driven Architecture — Hands-On Coding Exercise
// Event carries immutable past-tense fact: OrderPlacedEvent(eventId, orderId, userId, items, occurredAt)
Latency decoupling, spike buffering/backpressure, multi-subscriber fan-out vs debugging complexity and eventual consistency
19.2 Synchronous REST vs Asynchronous Kafka Trade-offs (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Synchronous REST vs Asynchronous Kafka Trade-offs (Apache Kafka) covers Latency decoupling, spike buffering/backpressure, multi-subscriber fan-out vs debugging complexity and eventual consistency. It is required in backend engineering to Having `inventory-service`, `notification-service...
Synchronous REST vs Asynchronous Kafka Trade-offs — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Synchronous REST vs Asynchronous Kafka Trade-offs': Design topic names (`order.events`, `inventory.events`, `payment.events`) and event contra...
Synchronous REST vs Asynchronous Kafka Trade-offs — Hands-On Coding Exercise
public record OrderPlacedEvent(java.util.UUID eventId, Long orderId, Long userId, java.math.BigDecimal amount, java.time.Instant occurredAt) {}
Immutable append-only partition logs, partition keys (`hash(key) % numPartitions`), retention by time/size (messages are NOT deleted on read!), modern KRaft metadata mode
19.3 Kafka Architecture (Brokers, Topics, Partitions and KRaft) (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Kafka Architecture (Brokers, Topics, Partitions and KRaft) (Apache Kafka) covers Immutable append-only partition logs, partition keys (`hash(key) % numPartitions`), retention by time/size (messages are NOT deleted on read!), modern KRaft metadata mode. It is required in backend...
Kafka Architecture (Brokers, Topics, Partitions and KRaft) — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Kafka Architecture (Brokers, Topics, Partitions and KRaft)': Launch single-node Kafka (KRaft) in Docker and create a 3-partition `order-events...
Kafka Architecture (Brokers, Topics, Partitions and KRaft) — Hands-On Coding Exercise
# Messages with the same message key (e.g. orderId) always hash to the exact same partition
Key-based murmur2 partitioning, `acks=0` vs `acks=1` vs `acks=all`, `enable.idempotence=true` (default in modern Kafka!), `linger.ms` & `batch.size`
19.4 Kafka Producers (Partitioning, Batching and Acks) (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Kafka Producers (Partitioning, Batching and Acks) (Apache Kafka) covers Key-based murmur2 partitioning, `acks=0` vs `acks=1` vs `acks=all`, `enable.idempotence=true` (default in modern Kafka!), `linger.ms` & `batch.size`. It is required in backend engineering to Passing `String.valu...
Kafka Producers (Partitioning, Batching and Acks) — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Kafka Producers (Partitioning, Batching and Acks)': Publish keyed `OrderPlacedEvent` messages and inspect partition assignments and offsets. I...
Kafka Producers (Partitioning, Batching and Acks) — Hands-On Coding Exercise
kafkaTemplate.send("order-events", String.valueOf(event.orderId()), event);
Pull-based `poll()` model, `auto.offset.reset` (`earliest` vs `latest`), heartbeats vs `max.poll.interval.ms`
19.5 Kafka Consumers (Poll Loop and Deserialization) (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Kafka Consumers (Poll Loop and Deserialization) (Apache Kafka) covers Pull-based `poll()` model, `auto.offset.reset` (`earliest` vs `latest`), heartbeats vs `max.poll.interval.ms`. It is required in backend engineering to Setting `auto-offset-reset: earliest` in microservices so a newly d...
Kafka Consumers (Poll Loop and Deserialization) — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Kafka Consumers (Poll Loop and Deserialization)': Configure consumer properties (`group-id`, `auto-offset-reset: earliest`, trusted JSON packa...
Kafka Consumers (Poll Loop and Deserialization) — Hands-On Coding Exercise
spring:
kafka:
consumer:
group-id: notification-service
auto-offset-reset: earliest
Load-sharing partitions within one `group.id` vs independent broadcast across different `group.id`s, why `activeConsumers <= partitionCount`
19.6 Consumer Groups and Parallelism (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Consumer Groups and Parallelism (Apache Kafka) covers Load-sharing partitions within one `group.id` vs independent broadcast across different `group.id`s, why `activeConsumers <= partitionCount`. It is required in backend engineering to Running 3 `inventory-service` instances (`group.id=inventory`) sh...
Consumer Groups and Parallelism — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Consumer Groups and Parallelism': Demonstrate two distinct consumer groups (`inventory-group` and `notification-group`) both receiving the sam...
Consumer Groups and Parallelism — Hands-On Coding Exercise
// Same group.id = competing load-balanced partitions | Different group.id = independent pub-sub fan-out
Current offset vs committed offset (`__consumer_offsets`), auto-commit risks (data loss if crash before processing finishes!) vs Spring Kafka `RECORD`/`BATCH` commit-after-process
19.7 Offsets and Commit Strategies (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Offsets and Commit Strategies (Apache Kafka) covers Current offset vs committed offset (`__consumer_offsets`), auto-commit risks (data loss if crash before processing finishes!) vs Spring Kafka `RECORD`/`BATCH` commit-after-process. It is required in backend engineering to Ensuring offsets commit ONLY *aft...
Offsets and Commit Strategies — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Offsets and Commit Strategies': Configure `enable-auto-commit: false` and verify unprocessed messages replay after simulated exception. Includ...
Offsets and Commit Strategies — Hands-On Coding Exercise
spring.kafka.consumer.enable-auto-commit: false
Replication factor (`RF=3` in prod), Partition Leader vs Followers, In-Sync Replicas (`ISR`), `min.insync.replicas=2` + `acks=all` durability guarantee
19.8 Partition Replication, ISR and Fault Tolerance (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Partition Replication, ISR and Fault Tolerance (Apache Kafka) covers Replication factor (`RF=3` in prod), Partition Leader vs Followers, In-Sync Replicas (`ISR`), `min.insync.replicas=2` + `acks=all` durability guarantee. It is required in backend engineering to Guaranteeing zero committed...
Partition Replication, ISR and Fault Tolerance — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Partition Replication, ISR and Fault Tolerance': Explain the exact durability interaction of `replication.factor=3`, `min.insync.replicas=2`,...
Partition Replication, ISR and Fault Tolerance — Hands-On Coding Exercise
// Production durability triad: replication.factor=3 + min.insync.replicas=2 + producer acks=all
`JsonSerializer` / `ErrorHandlingDeserializer` wrapping `JsonDeserializer` (critical for poison pills!), backward/forward schema evolution & Avro Schema Registry overview
19.9 Message Serialization (JSON and Apache Avro Fundamentals) (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Message Serialization (JSON and Apache Avro Fundamentals) (Apache Kafka) covers `JsonSerializer` / `ErrorHandlingDeserializer` wrapping `JsonDeserializer` (critical for poison pills!), backward/forward schema evolution & Avro Schema Registry overview. It is required in backe...
Message Serialization (JSON and Apache Avro Fundamentals) — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Message Serialization (JSON and Apache Avro Fundamentals)': Configure `ErrorHandlingDeserializer` + `JsonDeserializer` with explicit DTO type...
Message Serialization (JSON and Apache Avro Fundamentals) — Hands-On Coding Exercise
// Always wrap JsonDeserializer in ErrorHandlingDeserializer to survive malformed poison-pill payloads!
`spring-kafka` starter, `KafkaTemplate<String, Object>`, `NewTopic` `@Bean` auto-creation, `CompletableFuture<SendResult>` callback logging
19.10 Spring for Apache Kafka Integration (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Spring for Apache Kafka Integration (Apache Kafka) covers `spring-kafka` starter, `KafkaTemplate<String, Object>`, `NewTopic` `@Bean` auto-creation, `CompletableFuture<SendResult>` callback logging. It is required in backend engineering to Auto-provisioning `order-events`, `inventory-eve...
Spring for Apache Kafka Integration — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Spring for Apache Kafka Integration': Declare `TopicBuilder.name("order-events").partitions(3).replicas(1).build()` `@Bean`s and log publish o...
Spring for Apache Kafka Integration — Hands-On Coding Exercise
@Bean
public org.apache.kafka.clients.admin.NewTopic orderEventsTopic() {
return org.springframework.kafka.config.TopicBuilder.name("order-events").partitions(3).replicas(1).build();
}
`@KafkaListener(topics = ..., groupId = ...)`, extracting `@Payload`, `@Header(KafkaHeaders.RECEIVED_KEY)`, `RECEIVED_PARTITION`, `OFFSET`
19.11 Kafka Listeners (@KafkaListener) (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Kafka Listeners (@KafkaListener) (Apache Kafka) covers `@KafkaListener(topics = ..., groupId = ...)`, extracting `@Payload`, `@Header(KafkaHeaders.RECEIVED_KEY)`, `RECEIVED_PARTITION`, `OFFSET`. It is required in backend engineering to Logging topic, partition, offset, and `eventId` cleanly in every co...
Kafka Listeners (@KafkaListener) — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Kafka Listeners (@KafkaListener)': Implement `@KafkaListener` handlers for `OrderPlaced`, `InventoryUpdated`, and `PaymentConfirmed` events. I...
Kafka Listeners (@KafkaListener) — Hands-On Coding Exercise
@org.springframework.kafka.annotation.KafkaListener(topics = "order-events", groupId = "inventory-service")
public void onOrderPlaced(OrderPlacedEvent event) {
inventoryService.reserveStockForOrder(event);
}
Transient errors (DB/network blip -> retry!) vs non-retryable errors (`IllegalArgumentException` / invalid data -> skip straight to DLT!), `DefaultErrorHandler` + `FixedBackOff` / `ExponentialBackOff`
19.12 Consumer Error Handling (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Consumer Error Handling (Apache Kafka) covers Transient errors (DB/network blip -> retry!) vs non-retryable errors (`IllegalArgumentException` / invalid data -> skip straight to DLT!), `DefaultErrorHandler` + `FixedBackOff` / `ExponentialBackOff`. It is required in backend engineering to Preventing a sing...
Consumer Error Handling — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Consumer Error Handling': Configure non-retryable exception classification so validation errors route directly to DLT without useless retries....
Consumer Error Handling — Hands-On Coding Exercise
// Classify transient infra exceptions as retryable and permanent payload errors as non-retryable -> DLT
Non-blocking delayed retries via Spring Kafka `@RetryableTopic(attempts = "4", backoff = @Backoff(delay = 1000, multiplier = 2.0))`, main partition stays unblocked!
19.13 Retry Topics (@RetryableTopic) (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Retry Topics (@RetryableTopic) (Apache Kafka) covers Non-blocking delayed retries via Spring Kafka `@RetryableTopic(attempts = "4", backoff = @Backoff(delay = 1000, multiplier = 2.0))`, main partition stays unblocked!. It is required in backend engineering to Retrying temporary SMTP/webhook fai...
Retry Topics (@RetryableTopic) — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Retry Topics (@RetryableTopic)': Annotate `NotificationConsumer` with `@RetryableTopic` and `@DltHandler` and test automatic backoff routing....
Retry Topics (@RetryableTopic) — Hands-On Coding Exercise
@org.springframework.kafka.annotation.RetryableTopic(attempts = "3", backoff = @org.springframework.retry.annotation.Backoff(delay = 1000, multiplier = 2.0))
@KafkaListener(topics = "notification-events", groupId = "notification-service")
public void sendEmail(NotificationEvent event) { /* ... */ }
`DeadLetterPublishingRecoverer`, `@DltHandler`, storing diagnostic failure headers (`kafka_dlt-exception-message`), alerting & replay runbooks
19.14 Dead Letter Queue (DLQ / DLT) (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Dead Letter Queue (DLQ / DLT) (Apache Kafka) covers `DeadLetterPublishingRecoverer`, `@DltHandler`, storing diagnostic failure headers (`kafka_dlt-exception-message`), alerting & replay runbooks. It is required in backend engineering to Capturing exhausted failed messages into `order-events.DLT` + per...
Dead Letter Queue (DLQ / DLT) — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Dead Letter Queue (DLQ / DLT)': Implement a `@DltHandler` method that logs and records failed poison messages with root-cause metadata. Includ...
Dead Letter Queue (DLQ / DLT) — Hands-On Coding Exercise
@org.springframework.kafka.annotation.DltHandler
public void handleDeadLetter(OrderPlacedEvent event, @org.springframework.messaging.handler.annotation.Header(org.springframework.kafka.support.KafkaHeaders.EXCEPTION_MESSAGE) String err) {
log.error("Order event {} routed to DLT: {}", event.eventId(), err);
}
Internal Domain Events vs public versioned cross-service Integration Events, thin notification events vs self-contained Event-Carried State Transfer, schema backward compatibility (additive optional fields!)
19.15 Event-Driven Design (Domain Events vs Integration Events) (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Event-Driven Design (Domain Events vs Integration Events) (Apache Kafka) covers Internal Domain Events vs public versioned cross-service Integration Events, thin notification events vs self-contained Event-Carried State Transfer, schema backward compatibility (additive optional...
Event-Driven Design (Domain Events vs Integration Events) — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Event-Driven Design (Domain Events vs Integration Events)': Define clean versioned Java 21 `record` integration event schemas for all 5 E-Comm...
Event-Driven Design (Domain Events vs Integration Events) — Hands-On Coding Exercise
// Additive evolution: adding nullable fields is backward-compatible when consumers ignore unknown JSON properties
Per-partition FIFO guarantee, choosing the right partition key (`orderId` for order lifecycle, `accountId` for ledger), `max.in.flight.requests.per.connection <= 5` with idempotent producer
19.16 Message Ordering Guarantees (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Message Ordering Guarantees (Apache Kafka) covers Per-partition FIFO guarantee, choosing the right partition key (`orderId` for order lifecycle, `accountId` for ledger), `max.in.flight.requests.per.connection <= 5` with idempotent producer. It is required in backend engineering to Ensuring `OrderPlaced -...
Message Ordering Guarantees — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Message Ordering Guarantees': Verify strict sequential processing of 20 rapid state transitions for the same `orderId` key. Include clear meth...
Message Ordering Guarantees — Hands-On Coding Exercise
// Partition key = aggregate ID whose state transitions MUST stay strictly ordered
Why network/rebalance hiccups cause duplicate deliveries in Kafka ("At-Least-Once"), inserting `event_id UUID PRIMARY KEY` into `processed_events` inside the SAME local `@Transactional` DB commit as the business write!
19.17 Idempotent Consumers (Deduplicating At-Least-Once Delivery) (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Idempotent Consumers (Deduplicating At-Least-Once Delivery) (Apache Kafka) covers Why network/rebalance hiccups cause duplicate deliveries in Kafka ("At-Least-Once"), inserting `event_id UUID PRIMARY KEY` into `processed_events` inside the SAME local `@Transactional...
Idempotent Consumers (Deduplicating At-Least-Once Delivery) — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Idempotent Consumers (Deduplicating At-Least-Once Delivery)': Add a `processed_events(event_id PK, processed_at)` idempotency guard to `Invent...
Idempotent Consumers (Deduplicating At-Least-Once Delivery) — Hands-On Coding Exercise
@Transactional
public void reserveStockForOrder(OrderPlacedEvent event) {
if (processedEventRepo.existsById(event.eventId())) return; // Already processed!
processedEventRepo.save(new ProcessedEvent(event.eventId()));
// deduct stock atomically in the same PostgreSQL transaction
}
The Dual-Write bug (`orderRepo.save()` commits in PostgreSQL, then JVM crashes 1ms before `kafkaTemplate.send()` -> lost event!), solving by writing `Order` + `OutboxEvent` row in ONE PostgreSQL transaction and relaying via `@Scheduled` poller / CDC
19.18 Transactional Outbox Pattern (Week 19 • Apache Kafka) 1. What It Is, Why It Is Required & How It Works Transactional Outbox Pattern (Apache Kafka) covers The Dual-Write bug (`orderRepo.save()` commits in PostgreSQL, then JVM crashes 1ms before `kafkaTemplate.send()` -> lost event!), solving by writing `Order` + `OutboxEvent` row in ONE PostgreSQL transaction and relaying via `@Scheduled` poller / CDC. It...
Transactional Outbox Pattern — Practical Implementation Assignment
Complete and push your working Apache Kafka solution for 'Transactional Outbox Pattern': Implement an `outbox_events` table + `@Scheduled` relay publisher (`FOR UPDATE SKIP LOCKED`) in `order-service`...
Transactional Outbox Pattern — Hands-On Coding Exercise
// 1) Same @Transactional: save(order) + save(outboxEvent[status=PENDING])
// 2) Background Poller: publish PENDING outbox rows to Kafka -> mark PUBLISHED (consumers deduplicate via eventId!)
Implement asynchronous `OrderPlaced`, `InventoryUpdated`, `PaymentConfirmed`, and `EmailNotification` workflows using Spring Kafka, partition keys, `@RetryableTopic`, `.DLT` Dead Letter Queue, idempotent `processed_events`, and Transactional Outbox.
Module Learning & Hands-On Objectives
Document, Key-Value, Wide-Column, and Graph stores vs RDBMS; choosing PostgreSQL for orders/payments vs MongoDB for variable product specs/audit logs vs Redis for hot cache/rate limits
20.1 NoSQL vs Relational Databases (Polyglot Persistence) (Week 20 • NoSQL & Redis) 1. What It Is, Why It Is Required & How It Works NoSQL vs Relational Databases (Polyglot Persistence) (NoSQL & Redis) covers Document, Key-Value, Wide-Column, and Graph stores vs RDBMS; choosing PostgreSQL for orders/payments vs MongoDB for variable product specs/audit logs vs Redis for hot cache/rate limits. It is require...
NoSQL vs Relational Databases (Polyglot Persistence) — Practical Implementation Assignment
Complete and push your working NoSQL & Redis solution for 'NoSQL vs Relational Databases (Polyglot Persistence)': Justify the optimal database choice for `orders`, `flexible_product_specs`, `jwt_denyl...
NoSQL vs Relational Databases (Polyglot Persistence) — Hands-On Coding Exercise
// Polyglot rule: PostgreSQL (ACID transactions) + Redis (sub-ms cache/TTL/locks) + MongoDB (flexible nested documents)
BSON binary JSON documents, collections, dynamic/schema-validated document structure, `ObjectId` 12-byte structure
20.2 MongoDB Fundamentals (Week 20 • MongoDB) 1. What It Is, Why It Is Required & How It Works MongoDB Fundamentals (MongoDB) covers BSON binary JSON documents, collections, dynamic/schema-validated document structure, `ObjectId` 12-byte structure. It is required in backend engineering to Storing polymorphic category attributes (laptops have `ramGb`/`cpu`; shirts have `fabric`/`chestIn`) without 40 nullable SQL c...
MongoDB Fundamentals — Practical Implementation Assignment
Complete and push your working MongoDB solution for 'MongoDB Fundamentals': Boot MongoDB via Docker and insert polymorphic electronics & apparel product specification documents. Include clear method/s...
MongoDB Fundamentals — Hands-On Coding Exercise
// BSON supports rich types (Date, Decimal128, ObjectId, nested arrays & sub-documents)
Embedding bounded 1:few sub-documents (`addresses` on `user`) vs Referencing unbounded 1:million collections (`reviews` referencing `productId`), 16MB BSON document limit!
20.3 MongoDB Data Modeling (Embedding vs Referencing) (Week 20 • MongoDB) 1. What It Is, Why It Is Required & How It Works MongoDB Data Modeling (Embedding vs Referencing) (MongoDB) covers Embedding bounded 1:few sub-documents (`addresses` on `user`) vs Referencing unbounded 1:million collections (`reviews` referencing `productId`), 16MB BSON document limit!. It is required in backend engineering to Embedding 3–8...
MongoDB Data Modeling (Embedding vs Referencing) — Practical Implementation Assignment
Complete and push your working MongoDB solution for 'MongoDB Data Modeling (Embedding vs Referencing)': Design embedded vs referenced document boundaries for Product Specs and Customer Reviews. Includ...
MongoDB Data Modeling (Embedding vs Referencing) — Hands-On Coding Exercise
// Bounded 1:few read together -> Embed | Unbounded 1:many growing forever -> Reference by ID
`insertOne`/`insertMany`, `find` projections, `$gt`/`$in` filters, atomic `$set` / `$inc` / `$push` updates (never overwrite whole doc blindly!), `deleteOne`
20.4 MongoDB CRUD Operations (Week 20 • MongoDB) 1. What It Is, Why It Is Required & How It Works MongoDB CRUD Operations (MongoDB) covers `insertOne`/`insertMany`, `find` projections, `$gt`/`$in` filters, atomic `$set` / `$inc` / `$push` updates (never overwrite whole doc blindly!), `deleteOne`. It is required in backend engineering to Atomically incrementing view counters (`$inc: { views: 1 }`) without read-mod...
MongoDB CRUD Operations — Practical Implementation Assignment
Complete and push your working MongoDB solution for 'MongoDB CRUD Operations': Execute filtered reads and atomic `$set` / `$inc` updates on a `product_reviews` collection. Include clear method/schema...
MongoDB CRUD Operations — Hands-On Coding Exercise
// Atomic field update in MongoDB: { $inc: { helpfulVotes: 1 }, $set: { updatedAt: ... } }
Default `_id` index, compound indexes & ESR rule (`Equality -> Sort -> Range`), text/TTL indexes (`expireAfterSeconds`), `.explain("executionStats")` (`IXSCAN` vs `COLLSCAN`)
20.5 MongoDB Indexing (Week 20 • MongoDB) 1. What It Is, Why It Is Required & How It Works MongoDB Indexing (MongoDB) covers Default `_id` index, compound indexes & ESR rule (`Equality -> Sort -> Range`), text/TTL indexes (`expireAfterSeconds`), `.explain("executionStats")` (`IXSCAN` vs `COLLSCAN`). It is required in backend engineering to Auto-expiring audit/OTP documents via a MongoDB TTL in...
MongoDB Indexing — Practical Implementation Assignment
Complete and push your working MongoDB solution for 'MongoDB Indexing': Add `@CompoundIndex` on `(productId, createdAt)` and verify `IXSCAN` vs `COLLSCAN`. Include clear method/schema naming, edge-cas...
MongoDB Indexing — Hands-On Coding Exercise
@org.springframework.data.mongodb.core.index.CompoundIndex(name = "idx_prod_created", def = "{'productId': 1, 'createdAt': -1}")
Multi-stage `$match` (push early to use indexes!) -> `$group` (`$avg`, `$sum`) -> `$sort` -> `$limit` -> `$project`
20.6 MongoDB Aggregation Pipeline Fundamentals (Week 20 • MongoDB) 1. What It Is, Why It Is Required & How It Works MongoDB Aggregation Pipeline Fundamentals (MongoDB) covers Multi-stage `$match` (push early to use indexes!) -> `$group` (`$avg`, `$sum`) -> `$sort` -> `$limit` -> `$project`. It is required in backend engineering to Computing average star rating and rating-count breakdown per `productId...
MongoDB Aggregation Pipeline Fundamentals — Practical Implementation Assignment
Complete and push your working MongoDB solution for 'MongoDB Aggregation Pipeline Fundamentals': Write an aggregation pipeline computing per-product average rating and review count. Include clear meth...
MongoDB Aggregation Pipeline Fundamentals — Hands-On Coding Exercise
// Pipeline order matters: always filter with $match FIRST so MongoDB uses indexes!
`@Document(collection = "reviews")`, `MongoRepository<ReviewDoc, String>`, derived queries, `MongoTemplate` for atomic `$inc` & `Aggregation`
20.7 Spring Data MongoDB (MongoRepository and MongoTemplate) (Week 20 • MongoDB) 1. What It Is, Why It Is Required & How It Works Spring Data MongoDB (MongoRepository and MongoTemplate) (MongoDB) covers `@Document(collection = "reviews")`, `MongoRepository<ReviewDoc, String>`, derived queries, `MongoTemplate` for atomic `$inc` & `Aggregation`. It is required in backend engineering to Integrati...
Spring Data MongoDB (MongoRepository and MongoTemplate) — Practical Implementation Assignment
Complete and push your working MongoDB solution for 'Spring Data MongoDB (MongoRepository and MongoTemplate)': Build a `ProductReviewService` using `@Document`, `MongoRepository`, and `MongoTemplate`...
Spring Data MongoDB (MongoRepository and MongoTemplate) — Hands-On Coding Exercise
@org.springframework.data.mongodb.core.mapping.Document(collection = "product_reviews")
public class ProductReviewDoc {
@org.springframework.data.annotation.Id private String id;
private Long productId;
private int rating;
}
Single-threaded event-loop command execution (atomic commands, sub-millisecond latency!), RDB snapshots & AOF persistence modes, Lettuce non-blocking Spring Boot client
20.8 Redis In-Memory Data Store Architecture (Week 20 • NoSQL & Redis) 1. What It Is, Why It Is Required & How It Works Redis In-Memory Data Store Architecture (NoSQL & Redis) covers Single-threaded event-loop command execution (atomic commands, sub-millisecond latency!), RDB snapshots & AOF persistence modes, Lettuce non-blocking Spring Boot client. It is required in backend engineering to Serving ho...
Redis In-Memory Data Store Architecture — Practical Implementation Assignment
Complete and push your working NoSQL & Redis solution for 'Redis In-Memory Data Store Architecture': Start Redis 7 via Docker, inspect `redis-cli PING` / `INFO memory`, and connect Spring Boot `spring...
Redis In-Memory Data Store Architecture — Hands-On Coding Exercise
# Never run KEYS * in production Redis! Use exact key namespaces like shop:product:42
Strings (`GET/SET EX/INCR`), Hashes (`HSET/HGETALL` for user carts!), Lists (`LPUSH/RPOP`), Sets (`SADD/SISMEMBER`), Sorted Sets (`ZADD/ZREVRANGE` leaderboards)
20.9 Redis Core Data Structures (Strings, Hashes, Lists, Sets, Sorted Sets) (Week 20 • NoSQL & Redis) 1. What It Is, Why It Is Required & How It Works Redis Core Data Structures (Strings, Hashes, Lists, Sets, Sorted Sets) (NoSQL & Redis) covers Strings (`GET/SET EX/INCR`), Hashes (`HSET/HGETALL` for user carts!), Lists (`LPUSH/RPOP`), Sets (`SADD/SISMEMBER`), Sorted Sets (`ZADD/ZREVRANGE` leaderboards). I...
Redis Core Data Structures (Strings, Hashes, Lists, Sets, Sorted Sets) — Practical Implementation Assignment
Complete and push your working NoSQL & Redis solution for 'Redis Core Data Structures (Strings, Hashes, Lists, Sets, Sorted Sets)': Implement a fast shopping-cart store using `StringRedisTemplate.opsF...
Redis Core Data Structures (Strings, Hashes, Lists, Sets, Sorted Sets) — Hands-On Coding Exercise
redisTemplate.opsForHash().increment("shop:cart:" + userId, String.valueOf(productId), deltaQty);
redisTemplate.expire("shop:cart:" + userId, java.time.Duration.ofDays(7));
Cache-Aside (Read: check Redis -> on miss read PostgreSQL -> populate Redis with TTL; Write: update PostgreSQL -> evict Redis key!), cache hit ratio formulas
20.10 Caching Patterns (Cache-Aside, Write-Through, Read-Through) (Week 20 • NoSQL & Redis) 1. What It Is, Why It Is Required & How It Works Caching Patterns (Cache-Aside, Write-Through, Read-Through) (NoSQL & Redis) covers Cache-Aside (Read: check Redis -> on miss read PostgreSQL -> populate Redis with TTL; Write: update PostgreSQL -> evict Redis key!), cache hit ratio formulas. It is required i...
Caching Patterns (Cache-Aside, Write-Through, Read-Through) — Practical Implementation Assignment
Complete and push your working NoSQL & Redis solution for 'Caching Patterns (Cache-Aside, Write-Through, Read-Through)': Implement manual Cache-Aside with `RedisTemplate` first so the exact hit/miss/e...
Caching Patterns (Cache-Aside, Write-Through, Read-Through) — Hands-On Coding Exercise
// Cache-Aside Write Rule: Commit PostgreSQL FIRST, then delete/evict the Redis key
`@EnableCaching`, configuring `RedisCacheManager` with `GenericJackson2JsonRedisSerializer` (not unreadable JDK binary serialization!), SpEL keys `key = "#id"`, `unless = "#result == null"`
20.11 Spring Cache Abstraction (@Cacheable, @CachePut, @CacheEvict) (Week 20 • NoSQL & Redis) 1. What It Is, Why It Is Required & How It Works Spring Cache Abstraction (@Cacheable, @CachePut, @CacheEvict) (NoSQL & Redis) covers `@EnableCaching`, configuring `RedisCacheManager` with `GenericJackson2JsonRedisSerializer` (not unreadable JDK binary serialization!), SpEL keys `key = "#id"`, `unless =...
Spring Cache Abstraction (@Cacheable, @CachePut, @CacheEvict) — Practical Implementation Assignment
Complete and push your working NoSQL & Redis solution for 'Spring Cache Abstraction (@Cacheable, @CachePut, @CacheEvict)': Configure JSON `RedisCacheManager` with per-cache TTLs and add `@Cacheable` +...
Spring Cache Abstraction (@Cacheable, @CachePut, @CacheEvict) — Hands-On Coding Exercise
@org.springframework.cache.annotation.Cacheable(cacheNames = "products", key = "#id")
public ProductResponse getById(Long id) { /* hits PostgreSQL only on cache miss */ }
@org.springframework.cache.annotation.CacheEvict(cacheNames = "products", key = "#id")
public ProductResponse update(Long id, UpdateProductRequest req) { /* ... */ }
Why cache invalidation is hard, Cache Penetration (caching short-TTL empty sentinel or Bloom filter for non-existent IDs), Cache Avalanche (adding random TTL jitter!), Cache Stampede (`sync = true` lock)
20.12 Cache Invalidation, Penetration and Stampede Protection (Week 20 • NoSQL & Redis) 1. What It Is, Why It Is Required & How It Works Cache Invalidation, Penetration and Stampede Protection (NoSQL & Redis) covers Why cache invalidation is hard, Cache Penetration (caching short-TTL empty sentinel or Bloom filter for non-existent IDs), Cache Avalanche (adding random TTL jitter!), Cache Stampede (`sync =...
Cache Invalidation, Penetration and Stampede Protection — Practical Implementation Assignment
Complete and push your working NoSQL & Redis solution for 'Cache Invalidation, Penetration and Stampede Protection': Add `@Cacheable(sync = true)` and randomized TTL jitter (`30m + 0..5m`) to `Product...
Cache Invalidation, Penetration and Stampede Protection — Hands-On Coding Exercise
Duration jitteredTtl = Duration.ofMinutes(30).plusSeconds(java.util.concurrent.ThreadLocalRandom.current().nextInt(300));
Mandatory TTL on every cache key (`EXPIRE`), `maxmemory` policies (`allkeys-lru`, `volatile-lru`, `noeviction`), bounding Redis RAM in production
20.13 Time-To-Live (TTL) and Eviction Policies (Week 20 • NoSQL & Redis) 1. What It Is, Why It Is Required & How It Works Time-To-Live (TTL) and Eviction Policies (NoSQL & Redis) covers Mandatory TTL on every cache key (`EXPIRE`), `maxmemory` policies (`allkeys-lru`, `volatile-lru`, `noeviction`), bounding Redis RAM in production. It is required in backend engineering to Setting 15-minute TTL on catalog p...
Time-To-Live (TTL) and Eviction Policies — Practical Implementation Assignment
Complete and push your working NoSQL & Redis solution for 'Time-To-Live (TTL) and Eviction Policies': Implement JWT logout revocation storing `blacklist:jti:{id}` in Redis with TTL equal to the token’...
Time-To-Live (TTL) and Eviction Policies — Hands-On Coding Exercise
redisTemplate.opsForValue().set("auth:revoked:" + jti, "1", remainingTtl);
Measuring p50/p95/p99 latency (not misleading averages!), SQL query count assertions, payload compression, avoiding chatty N-call loops, basic JMeter load-test runs
20.14 Backend Database and API Performance Profiling (Week 20 • Performance) 1. What It Is, Why It Is Required & How It Works Backend Database and API Performance Profiling (Performance) covers Measuring p50/p95/p99 latency (not misleading averages!), SQL query count assertions, payload compression, avoiding chatty N-call loops, basic JMeter load-test runs. It is required in backend engineering to Running a 50-co...
Backend Database and API Performance Profiling — Practical Implementation Assignment
Complete and push your working Performance solution for 'Backend Database and API Performance Profiling': Benchmark `GET /api/v1/products/{id}` p95 latency before and after `@Cacheable` Redis caching....
Backend Database and API Performance Profiling — Hands-On Coding Exercise
// Track p95 and p99 tail latency via Actuator http.server.requests histograms
Sizing HikariCP per microservice (`total_connections = replicas * maxPoolSize < PostgreSQL max_connections`), `leak-detection-threshold`, fast `connection-timeout`
20.15 Connection Pooling Tuning in Microservices (Week 20 • Performance) 1. What It Is, Why It Is Required & How It Works Connection Pooling Tuning in Microservices (Performance) covers Sizing HikariCP per microservice (`total_connections = replicas * maxPoolSize < PostgreSQL max_connections`), `leak-detection-threshold`, fast `connection-timeout`. It is required in backend engineering to Configuring `maximum-...
Connection Pooling Tuning in Microservices — Practical Implementation Assignment
Complete and push your working Performance solution for 'Connection Pooling Tuning in Microservices': Tune `spring.datasource.hikari.*` across all Major Project 5 services so all 6 services run smooth...
Connection Pooling Tuning in Microservices — Hands-On Coding Exercise
spring.datasource.hikari:
maximum-pool-size: 10
minimum-idle: 2
connection-timeout: 5000
`@EntityGraph(attributePaths = {"category"})`, constructor DTO projections, two-query ID-page + `IN (:ids)` collection fetch, Hibernate statistics check
20.16 Detecting and Eliminating N+1 Queries at Scale (Week 20 • Performance) 1. What It Is, Why It Is Required & How It Works Detecting and Eliminating N+1 Queries at Scale (Performance) covers `@EntityGraph(attributePaths = {"category"})`, constructor DTO projections, two-query ID-page + `IN (:ids)` collection fetch, Hibernate statistics check. It is required in backend engineering to Fetching 20 pagin...
Detecting and Eliminating N+1 Queries at Scale — Practical Implementation Assignment
Complete and push your working Performance solution for 'Detecting and Eliminating N+1 Queries at Scale': Optimize `OrderService.listMyOrders` using 2-step ID pagination + `JOIN FETCH` so SQL count st...
Detecting and Eliminating N+1 Queries at Scale — Hands-On Coding Exercise
// Step 1: Page<Long> ids = orderRepo.findOrderIdsByUserId(userId, pageable);
// Step 2: List<Order> orders = orderRepo.findWithItemsByIdIn(ids.getContent()); // Constant 2 queries!
`Slice<T>` (avoids expensive `SELECT COUNT(*)` on millions of rows!) and cursor-based `?afterId=1050&limit=20` pagination for feeds/events
20.17 High-Volume API Pagination Strategies (Week 20 • Performance) 1. What It Is, Why It Is Required & How It Works High-Volume API Pagination Strategies (Performance) covers `Slice<T>` (avoids expensive `SELECT COUNT(*)` on millions of rows!) and cursor-based `?afterId=1050&limit=20` pagination for feeds/events. It is required in backend engineering to Powering sub-5ms order history and job-listing fe...
High-Volume API Pagination Strategies — Practical Implementation Assignment
Complete and push your working Performance solution for 'High-Volume API Pagination Strategies': Add a cursor-paginated `GET /api/v1/orders/feed?beforeId=...&size=20` endpoint and compare SQL executio...
High-Volume API Pagination Strategies — Hands-On Coding Exercise
List<OrderSummary> nextCursorPage(Long userId, Long beforeId, Pageable limit);
Why JVM-local rate limiters leak `N * limit` across `N` replicas, atomic Redis fixed-window (`INCR` + `EXPIRE` Lua script) & Spring Cloud Gateway `RequestRateLimiter` token bucket
20.18 Redis-Based Distributed Rate Limiting (Week 20 • NoSQL & Redis) 1. What It Is, Why It Is Required & How It Works Redis-Based Distributed Rate Limiting (NoSQL & Redis) covers Why JVM-local rate limiters leak `N * limit` across `N` replicas, atomic Redis fixed-window (`INCR` + `EXPIRE` Lua script) & Spring Cloud Gateway `RequestRateLimiter` token bucket. It is required in backend engineering to En...
Redis-Based Distributed Rate Limiting — Practical Implementation Assignment
Complete and push your working NoSQL & Redis solution for 'Redis-Based Distributed Rate Limiting': Configure Redis-backed `RequestRateLimiter` on `api-gateway` and test `429 Too Many Requests` burst p...
Redis-Based Distributed Rate Limiting — Hands-On Coding Exercise
// Atomic Redis Lua / Spring Cloud Gateway RequestRateLimiter enforces global rate limits across all replicas
Evolve the commerce domain into a resilient, event-driven distributed Microservices system consisting of independently deployable Spring Boot 3 services (`API Gateway`, `Eureka Server`, `User Service`, `Product Service`, `Order Service`, `Inventory Service`, `Payment Service`, `Notification Service`) integrated with Apache Kafka, Redis caching/rate limiting, PostgreSQL database-per-service isolation, and Resilience4j fault tolerance.
Module Learning & Hands-On Objectives
Deterministic fast unit tests vs component/DB integration tests vs end-to-end API contract tests, Arrange-Act-Assert (Given-When-Then) discipline
21.1 Software Testing Fundamentals (Unit, Integration and System Testing) (Week 21 • Testing & QA) 1. What It Is, Why It Is Required & How It Works Software Testing Fundamentals (Unit, Integration and System Testing) (Testing & QA) covers Deterministic fast unit tests vs component/DB integration tests vs end-to-end API contract tests, Arrange-Act-Assert (Given-When-Then) discipline. It is required in back...
Software Testing Fundamentals (Unit, Integration and System Testing) — Practical Implementation Assignment
Complete and push your working Testing & QA solution for 'Software Testing Fundamentals (Unit, Integration and System Testing)': Classify 10 test scenarios from E-Commerce into Unit vs Slice vs Testco...
Software Testing Fundamentals (Unit, Integration and System Testing) — Hands-On Coding Exercise
// Given (Arrange) -> When (Act) -> Then (Assert): each test must be independent and repeatable
~70% fast Mockito/domain unit tests, ~20% `@WebMvcTest`/`@DataJpaTest`/`Testcontainers` slice & integration tests, ~10% E2E smoke workflows
21.2 The Testing Pyramid in Spring Boot Backends (Week 21 • Testing & QA) 1. What It Is, Why It Is Required & How It Works The Testing Pyramid in Spring Boot Backends (Testing & QA) covers ~70% fast Mockito/domain unit tests, ~20% `@WebMvcTest`/`@DataJpaTest`/`Testcontainers` slice & integration tests, ~10% E2E smoke workflows. It is required in backend engineering to Keeping `./mvnw test` under 30 se...
The Testing Pyramid in Spring Boot Backends — Practical Implementation Assignment
Complete and push your working Testing & QA solution for 'The Testing Pyramid in Spring Boot Backends': Structure `src/test/java` cleanly separating `*ServiceTest` (unit) from `*ControllerTest` and `*...
The Testing Pyramid in Spring Boot Backends — Hands-On Coding Exercise
// Fast Unit Tests (ms) > Focused Slice/DB Integration Tests (sec) > E2E Smoke Tests
`@Test`, `@DisplayName`, `@BeforeEach`, `@AfterEach`, `@BeforeAll`, `@AfterAll`, `@Nested` grouped behavioral specs, package-private test methods
21.3 JUnit 5 (Jupiter) Architecture and Lifecycle (Week 21 • JUnit 5 & Mockito) 1. What It Is, Why It Is Required & How It Works JUnit 5 (Jupiter) Architecture and Lifecycle (JUnit 5 & Mockito) covers `@Test`, `@DisplayName`, `@BeforeEach`, `@AfterEach`, `@BeforeAll`, `@AfterAll`, `@Nested` grouped behavioral specs, package-private test methods. It is required in backend engineering to Organizing `OrderSe...
JUnit 5 (Jupiter) Architecture and Lifecycle — Practical Implementation Assignment
Complete and push your working JUnit 5 & Mockito solution for 'JUnit 5 (Jupiter) Architecture and Lifecycle': Write a structured JUnit 5 `@Nested` test class for `DiscountCalculator` and `OrderPricing...
JUnit 5 (Jupiter) Architecture and Lifecycle — Hands-On Coding Exercise
import org.junit.jupiter.api.*;
class OrderPricingTest {
@Test @DisplayName("applies 10% loyalty discount above ₹2,000")
void appliesLoyaltyDiscount() { /* ... */ }
}
`assertEquals`, `assertTrue`, `assertNotNull`, `assertAll` (reports ALL failures at once!), `assertThrows(DuplicateSkuException.class, () -> ...)` + message check, AssertJ fluent `assertThat(...)`
21.4 JUnit 5 Assertions and Exception Verification (Week 21 • JUnit 5 & Mockito) 1. What It Is, Why It Is Required & How It Works JUnit 5 Assertions and Exception Verification (JUnit 5 & Mockito) covers `assertEquals`, `assertTrue`, `assertNotNull`, `assertAll` (reports ALL failures at once!), `assertThrows(DuplicateSkuException.class, () -> ...)` + message check, AssertJ fluent `assertThat(...)`. It i...
JUnit 5 Assertions and Exception Verification — Practical Implementation Assignment
Complete and push your working JUnit 5 & Mockito solution for 'JUnit 5 Assertions and Exception Verification': Test boundary conditions and exception paths on `ProductService` using `assertAll` and `a...
JUnit 5 Assertions and Exception Verification — Hands-On Coding Exercise
var ex = Assertions.assertThrows(DuplicateResourceException.class, () -> service.create(dupReq));
Assertions.assertTrue(ex.getMessage().contains(dupReq.sku()));
`@ValueSource`, `@CsvSource`, `@EnumSource`, `@MethodSource` for testing 10 boundary/invalid inputs with zero copy-pasted test methods
21.5 Parameterized Tests (@ParameterizedTest) (Week 21 • JUnit 5 & Mockito) 1. What It Is, Why It Is Required & How It Works Parameterized Tests (@ParameterizedTest) (JUnit 5 & Mockito) covers `@ValueSource`, `@CsvSource`, `@EnumSource`, `@MethodSource` for testing 10 boundary/invalid inputs with zero copy-pasted test methods. It is required in backend engineering to Testing tax slabs, coupon rules, SKU r...
Parameterized Tests (@ParameterizedTest) — Practical Implementation Assignment
Complete and push your working JUnit 5 & Mockito solution for 'Parameterized Tests (@ParameterizedTest)': Write `@ParameterizedTest` + `@CsvSource` covering 8 tax/discount boundary cases and invalid S...
Parameterized Tests (@ParameterizedTest) — Hands-On Coding Exercise
@org.junit.jupiter.params.ParameterizedTest
@org.junit.jupiter.params.provider.CsvSource({"499,0", "1000,50", "5000,500"})
void calculatesTieredDiscount(double cartTotal, double expectedDiscount) { /* ... */ }
Pure Java + Mockito unit tests (zero Spring context startup!), `@Mock`, `@InjectMocks`, stubbing `when(repo.findById(1L)).thenReturn(Optional.of(entity))`, `Strictness.STRICT_STUBS`
21.6 Mockito Fundamentals (@ExtendWith(MockitoExtension.class)) (Week 21 • JUnit 5 & Mockito) 1. What It Is, Why It Is Required & How It Works Mockito Fundamentals (@ExtendWith(MockitoExtension.class)) (JUnit 5 & Mockito) covers Pure Java + Mockito unit tests (zero Spring context startup!), `@Mock`, `@InjectMocks`, stubbing `when(repo.findById(1L)).thenReturn(Optional.of(entity))`, `Strictness.STRICT_STUB...
Mockito Fundamentals (@ExtendWith(MockitoExtension.class)) — Practical Implementation Assignment
Complete and push your working JUnit 5 & Mockito solution for 'Mockito Fundamentals (@ExtendWith(MockitoExtension.class))': Write complete Mockito unit tests for `ProductService` and `OrderService` co...
Mockito Fundamentals (@ExtendWith(MockitoExtension.class)) — Hands-On Coding Exercise
@org.junit.jupiter.api.extension.ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class)
class ProductServiceTest {
@org.mockito.Mock ProductRepository productRepository;
@org.mockito.InjectMocks ProductService productService;
}
Stubs (canned answers), Mocks (interaction verification), `@Spy` (partial real object — use sparingly!), in-memory Fakes (`FakeClock`, `Map`-backed repo)
21.7 Test Doubles (Mock vs Stub vs Spy vs Fake) (Week 21 • JUnit 5 & Mockito) 1. What It Is, Why It Is Required & How It Works Test Doubles (Mock vs Stub vs Spy vs Fake) (JUnit 5 & Mockito) covers Stubs (canned answers), Mocks (interaction verification), `@Spy` (partial real object — use sparingly!), in-memory Fakes (`FakeClock`, `Map`-backed repo). It is required in backend engineering to Passing `Clock....
Test Doubles (Mock vs Stub vs Spy vs Fake) — Practical Implementation Assignment
Complete and push your working JUnit 5 & Mockito solution for 'Test Doubles (Mock vs Stub vs Spy vs Fake)': Test time-sensitive JWT/coupon expiration deterministically using an injected `java.time.Clo...
Test Doubles (Mock vs Stub vs Spy vs Fake) — Hands-On Coding Exercise
Clock fixedClock = Clock.fixed(Instant.parse("2026-11-17T10:00:00Z"), ZoneOffset.UTC);
`verify(kafkaTemplate).send(...)`, `verify(repo, never()).save(any())` on validation failure, `ArgumentCaptor<Order>` to inspect exact saved fields
21.8 Interaction Verification (verify, ArgumentCaptor and Matchers) (Week 21 • JUnit 5 & Mockito) 1. What It Is, Why It Is Required & How It Works Interaction Verification (verify, ArgumentCaptor and Matchers) (JUnit 5 & Mockito) covers `verify(kafkaTemplate).send(...)`, `verify(repo, never()).save(any())` on validation failure, `ArgumentCaptor<Order>` to inspect exact saved fields. It is required i...
Interaction Verification (verify, ArgumentCaptor and Matchers) — Practical Implementation Assignment
Complete and push your working JUnit 5 & Mockito solution for 'Interaction Verification (verify, ArgumentCaptor and Matchers)': Use `ArgumentCaptor<Product>` to assert normalized uppercase SKU and tri...
Interaction Verification (verify, ArgumentCaptor and Matchers) — Hands-On Coding Exercise
var captor = org.mockito.ArgumentCaptor.forClass(Product.class);
org.mockito.Mockito.verify(productRepository).save(captor.capture());
Assertions.assertEquals("SKU-101", captor.getValue().getSku());
`WebEnvironment.RANDOM_PORT` vs `MOCK`, `TestRestTemplate` / `RestTestClient`, `@ActiveProfiles("test")`, minimizing context reloads across test classes via shared base config
21.9 Full Context Integration Testing (@SpringBootTest) (Week 21 • Spring Boot Test) 1. What It Is, Why It Is Required & How It Works Full Context Integration Testing (@SpringBootTest) (Spring Boot Test) covers `WebEnvironment.RANDOM_PORT` vs `MOCK`, `TestRestTemplate` / `RestTestClient`, `@ActiveProfiles("test")`, minimizing context reloads across test classes via shared base config. It is required in...
Full Context Integration Testing (@SpringBootTest) — Practical Implementation Assignment
Complete and push your working Spring Boot Test solution for 'Full Context Integration Testing (@SpringBootTest)': Write a shared `AbstractIntegrationTest` base class so the Spring context boots once...
Full Context Integration Testing (@SpringBootTest) — Hands-On Coding Exercise
@org.springframework.boot.test.context.SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@org.springframework.test.context.ActiveProfiles("test")
abstract class AbstractIntegrationTest {}
`mockMvc.perform(post(...).contentType(APPLICATION_JSON).content(...))`, `status()`, `header()`, `jsonPath("$.id")`, testing `GlobalExceptionHandler` `ProblemDetail` responses
21.10 Web Layer Testing with MockMvc (Week 21 • Spring Boot Test) 1. What It Is, Why It Is Required & How It Works Web Layer Testing with MockMvc (Spring Boot Test) covers `mockMvc.perform(post(...).contentType(APPLICATION_JSON).content(...))`, `status()`, `header()`, `jsonPath("$.id")`, testing `GlobalExceptionHandler` `ProblemDetail` responses. It is required in backend engineering to Asserting exact...
Web Layer Testing with MockMvc — Practical Implementation Assignment
Complete and push your working Spring Boot Test solution for 'Web Layer Testing with MockMvc': Test `POST /api/v1/products` valid `201`, blank-name `400` (`fieldErrors.name`), and duplicate-SKU `409`...
Web Layer Testing with MockMvc — Hands-On Coding Exercise
mockMvc.perform(post("/api/v1/products").contentType(MediaType.APPLICATION_JSON).content(badJson))
.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.fieldErrors.name").exists());
Focused JPA/Hibernate slice, automatic per-test transaction rollback, `TestEntityManager` (`persistAndFlush` + `clear` to test real DB reads rather than L1 cache!)
21.11 Repository Slice Testing (@DataJpaTest) (Week 21 • Spring Boot Test) 1. What It Is, Why It Is Required & How It Works Repository Slice Testing (@DataJpaTest) (Spring Boot Test) covers Focused JPA/Hibernate slice, automatic per-test transaction rollback, `TestEntityManager` (`persistAndFlush` + `clear` to test real DB reads rather than L1 cache!). It is required in backend engineering to Verifying custom `@Q...
Repository Slice Testing (@DataJpaTest) — Practical Implementation Assignment
Complete and push your working Spring Boot Test solution for 'Repository Slice Testing (@DataJpaTest)': Write `@DataJpaTest` specs for `ProductRepository` custom `@Query` and `ProductSpecifications` u...
Repository Slice Testing (@DataJpaTest) — Hands-On Coding Exercise
entityManager.persistAndFlush(product);
entityManager.clear(); // Forces next repository query to hit SQL instead of L1 cache!
Loading ONLY web layer (`@RestController`, `@RestControllerAdvice`, Jackson, Bean Validation, Security) while mocking `@Service` via `@MockitoBean` (`@MockBean`)
21.12 Controller Slice Testing (@WebMvcTest) (Week 21 • Spring Boot Test) 1. What It Is, Why It Is Required & How It Works Controller Slice Testing (@WebMvcTest) (Spring Boot Test) covers Loading ONLY web layer (`@RestController`, `@RestControllerAdvice`, Jackson, Bean Validation, Security) while mocking `@Service` via `@MockitoBean` (`@MockBean`). It is required in backend engineering to Testing all 25 HTTP endp...
Controller Slice Testing (@WebMvcTest) — Practical Implementation Assignment
Complete and push your working Spring Boot Test solution for 'Controller Slice Testing (@WebMvcTest)': Write `@WebMvcTest(OrderController.class)` verifying `201`, `400`, `401`, and `403` responses. In...
Controller Slice Testing (@WebMvcTest) — Hands-On Coding Exercise
@org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest(ProductController.class)
class ProductControllerSliceTest {
@org.springframework.beans.factory.annotation.Autowired MockMvc mockMvc;
}
End-to-end HTTP -> Service -> JPA -> PostgreSQL flow verification, test data isolation (`@Sql` / clean setup), testing real transaction rollbacks & optimistic locks
21.13 Database and API Integration Testing (Week 21 • Spring Boot Test) 1. What It Is, Why It Is Required & How It Works Database and API Integration Testing (Spring Boot Test) covers End-to-end HTTP -> Service -> JPA -> PostgreSQL flow verification, test data isolation (`@Sql` / clean setup), testing real transaction rollbacks & optimistic locks. It is required in backend engineering to Verifying th...
Database and API Integration Testing — Practical Implementation Assignment
Complete and push your working Spring Boot Test solution for 'Database and API Integration Testing': Write an end-to-end checkout & stock-rollback integration test across HTTP, Service, and Database....
Database and API Integration Testing — Hands-On Coding Exercise
// Note: RANDOM_PORT HTTP server threads run in separate transactions from the test thread!
`org.testcontainers:postgresql`, `@ServiceConnection` (Spring Boot 3.1+ zero-boilerplate wiring!), catching PostgreSQL-specific SQL/JSONB/constraint bugs that H2 misses
21.14 Testcontainers (Real PostgreSQL & Redis in Docker Tests) (Week 21 • Spring Boot Test) 1. What It Is, Why It Is Required & How It Works Testcontainers (Real PostgreSQL & Redis in Docker Tests) (Spring Boot Test) covers `org.testcontainers:postgresql`, `@ServiceConnection` (Spring Boot 3.1+ zero-boilerplate wiring!), catching PostgreSQL-specific SQL/JSONB/constraint bugs that H2 misses. It is required...
Testcontainers (Real PostgreSQL & Redis in Docker Tests) — Practical Implementation Assignment
Complete and push your working Spring Boot Test solution for 'Testcontainers (Real PostgreSQL & Redis in Docker Tests)': Configure a singleton PostgreSQL `Testcontainers` `@ServiceConnection` for your...
Testcontainers (Real PostgreSQL & Redis in Docker Tests) — Hands-On Coding Exercise
@Bean
@org.springframework.boot.testcontainers.service.connection.ServiceConnection
PostgreSQLContainer<?> postgresContainer() {
return new PostgreSQLContainer<>("postgres:16-alpine");
}
Chaining Postman requests (Register -> Login capture `token` -> Create Product capture `id` -> Place Order -> Assert Stock), CLI execution via Newman in CI
21.15 Automated API Contract Testing with Postman / Newman (Week 21 • Testing & QA) 1. What It Is, Why It Is Required & How It Works Automated API Contract Testing with Postman / Newman (Testing & QA) covers Chaining Postman requests (Register -> Login capture `token` -> Create Product capture `id` -> Place Order -> Assert Stock), CLI execution via Newman in CI. It is required in backend engin...
Automated API Contract Testing with Postman / Newman — Practical Implementation Assignment
Complete and push your working Testing & QA solution for 'Automated API Contract Testing with Postman / Newman': Build a chained end-to-end Postman E-Commerce workflow storing dynamic `accessToken` an...
Automated API Contract Testing with Postman / Newman — Hands-On Coding Exercise
// Save login token dynamically: pm.collectionVariables.set('accessToken', pm.response.json().accessToken);
Verifying `/v3/api-docs` generates valid OpenAPI 3.0/3.1 JSON without schema conflicts, documenting `400`/`401`/`403`/`404` responses accurately
21.16 OpenAPI & Swagger Contract Verification (Week 21 • Testing & QA) 1. What It Is, Why It Is Required & How It Works OpenAPI & Swagger Contract Verification (Testing & QA) covers Verifying `/v3/api-docs` generates valid OpenAPI 3.0/3.1 JSON without schema conflicts, documenting `400`/`401`/`403`/`404` responses accurately. It is required in backend engineering to Adding a fast `MockMvc` test as...
OpenAPI & Swagger Contract Verification — Practical Implementation Assignment
Complete and push your working Testing & QA solution for 'OpenAPI & Swagger Contract Verification': Add an automated `GET /v3/api-docs` health test and complete `@Operation` annotations on all endpoin...
OpenAPI & Swagger Contract Verification — Hands-On Coding Exercise
mockMvc.perform(get("/v3/api-docs")).andExpect(status().isOk());
Single Responsibility, Dependency Inversion, small pure functions, guard clauses, meaningful domain naming, eliminating magic numbers & dead code
21.17 Clean Code, SOLID Principles and Maintainability (Week 21 • Testing & QA) 1. What It Is, Why It Is Required & How It Works Clean Code, SOLID Principles and Maintainability (Testing & QA) covers Single Responsibility, Dependency Inversion, small pure functions, guard clauses, meaningful domain naming, eliminating magic numbers & dead code. It is required in backend engineering to Keeping backend...
Clean Code, SOLID Principles and Maintainability — Practical Implementation Assignment
Complete and push your working Testing & QA solution for 'Clean Code, SOLID Principles and Maintainability': Refactor a bloated checkout method into cohesive, well-named domain collaborator methods. I...
Clean Code, SOLID Principles and Maintainability — Hands-On Coding Exercise
// Clean code test: Can a teammate understand your service method in 15 seconds without scrolling?
`jacoco-maven-plugin`, line vs branch coverage (`if/else` paths!), excluding auto-generated DTOs/Application main, why meaningful assertions beat vanity 100% getter tests
21.18 Code Coverage with JaCoCo (Week 21 • Testing & QA) 1. What It Is, Why It Is Required & How It Works Code Coverage with JaCoCo (Testing & QA) covers `jacoco-maven-plugin`, line vs branch coverage (`if/else` paths!), excluding auto-generated DTOs/Application main, why meaningful assertions beat vanity 100% getter tests. It is required in backend engineering to Generating `target/site/jacoco/index.html...
Code Coverage with JaCoCo — Practical Implementation Assignment
Complete and push your working Testing & QA solution for 'Code Coverage with JaCoCo': Configure `jacoco-maven-plugin` in `pom.xml`, generate the HTML report, and cover missed error branches. Include c...
Code Coverage with JaCoCo — Hands-On Coding Exercise
./mvnw clean verify # Generates target/site/jacoco/index.html coverage report
Reproducing every reported bug as a failing automated test FIRST, fixing the code until green, and keeping that regression guard in CI permanently
21.19 Regression Testing Discipline (Bug -> Failing Test -> Fix) (Week 21 • Testing & QA) 1. What It Is, Why It Is Required & How It Works Regression Testing Discipline (Bug -> Failing Test -> Fix) (Testing & QA) covers Reproducing every reported bug as a failing automated test FIRST, fixing the code until green, and keeping that regression guard in CI permanently. It is required in backend en...
Regression Testing Discipline (Bug -> Failing Test -> Fix) — Practical Implementation Assignment
Complete and push your working Testing & QA solution for 'Regression Testing Discipline (Bug -> Failing Test -> Fix)': Take 3 seeded E-Commerce edge-case bugs, write failing JUnit tests first, fix eac...
Regression Testing Discipline (Bug -> Failing Test -> Fix) — Hands-On Coding Exercise
// Red (reproduce bug in test) -> Green (minimal clean fix) -> Refactor (keep suite green)
Verify a Spring Boot backend with >= 75% service coverage using JUnit 5 `@ParameterizedTest`, Mockito unit tests, `@WebMvcTest` + `MockMvc` security/validation slice tests, `@DataJpaTest`, and real Docker PostgreSQL `Testcontainers`.
Module Learning & Hands-On Objectives
Kernel vs shell/userland, Ubuntu/Debian vs RHEL/Rocky vs minimal Alpine containers, filesystem hierarchy (`/etc`, `/var/log`, `/opt`, `/tmp`, `/home`)
22.1 Linux Architecture and Server Distributions (Week 22 • Linux & DevOps) 1. What It Is, Why It Is Required & How It Works Linux Architecture and Server Distributions (Linux & DevOps) covers Kernel vs shell/userland, Ubuntu/Debian vs RHEL/Rocky vs minimal Alpine containers, filesystem hierarchy (`/etc`, `/var/log`, `/opt`, `/tmp`, `/home`). It is required in backend engineering to Understanding the Linu...
Linux Architecture and Server Distributions — Practical Implementation Assignment
Complete and push your working Linux & DevOps solution for 'Linux Architecture and Server Distributions': Explore `/etc`, `/var/log`, and `/tmp` inside an Ubuntu/Alpine Linux terminal or WSL/Docker sh...
Linux Architecture and Server Distributions — Hands-On Coding Exercise
uname -a && cat /etc/os-release
`pwd`, `ls -la`, `cd`, `mkdir -p`, `rm`, `cp`, `mv`, `cat`, `less`, `tail -f`, `grep -rn`, `find`, pipes `|` and output redirection
22.2 Essential Linux Terminal Commands (Week 22 • Linux & DevOps) 1. What It Is, Why It Is Required & How It Works Essential Linux Terminal Commands (Linux & DevOps) covers `pwd`, `ls -la`, `cd`, `mkdir -p`, `rm`, `cp`, `mv`, `cat`, `less`, `tail -f`, `grep -rn`, `find`, pipes `|` and output redirection. It is required in backend engineering to Tailing live Spring Boot logs (`tail -f app.log | grep ERROR`...
Essential Linux Terminal Commands — Practical Implementation Assignment
Complete and push your working Linux & DevOps solution for 'Essential Linux Terminal Commands': Inspect and filter live application logs using `tail`, `grep`, `wc -l`, and pipes. Include clear method/...
Essential Linux Terminal Commands — Hands-On Coding Exercise
grep -i "exception" /var/log/app/backend.log | tail -n 25
Owner / Group / Others (`rwx` = `4,2,1`), `chmod 755` (`mvnw` executable bit!), `chmod 600` (SSH keys & secret env files), `chown`, running Java as a non-root user!
22.3 Linux File Permissions (chmod and chown) (Week 22 • Linux & DevOps) 1. What It Is, Why It Is Required & How It Works Linux File Permissions (chmod and chown) (Linux & DevOps) covers Owner / Group / Others (`rwx` = `4,2,1`), `chmod 755` (`mvnw` executable bit!), `chmod 600` (SSH keys & secret env files), `chown`, running Java as a non-root user!. It is required in backend engineering to Fixing `Pe...
Linux File Permissions (chmod and chown) — Practical Implementation Assignment
Complete and push your working Linux & DevOps solution for 'Linux File Permissions (chmod and chown)': Set `chmod +x mvnw`, `chmod 600 .env`, and verify non-root user ownership. Include clear method/s...
Linux File Permissions (chmod and chown) — Hands-On Coding Exercise
chmod +x mvnw
chmod 600 .env
`ps aux | grep java`, `top`/`htop` CPU & RSS memory, JDK `jps`/`jstack`, graceful `kill -15` (`SIGTERM`) vs last-resort `kill -9` (`SIGKILL`)
22.4 Linux Process Management (ps, top, jps, kill) (Week 22 • Linux & DevOps) 1. What It Is, Why It Is Required & How It Works Linux Process Management (ps, top, jps, kill) (Linux & DevOps) covers `ps aux | grep java`, `top`/`htop` CPU & RSS memory, JDK `jps`/`jstack`, graceful `kill -15` (`SIGTERM`) vs last-resort `kill -9` (`SIGKILL`). It is required in backend engineering to Sending `SIGTERM` (`kil...
Linux Process Management (ps, top, jps, kill) — Practical Implementation Assignment
Complete and push your working Linux & DevOps solution for 'Linux Process Management (ps, top, jps, kill)': Inspect a running Spring Boot PID, capture a thread dump, and stop it gracefully with `SIGTE...
Linux Process Management (ps, top, jps, kill) — Hands-On Coding Exercise
jps -lv
kill -15 <pid> # Triggers Spring Boot graceful shutdown
`127.0.0.1` loopback vs `0.0.0.0` all interfaces, checking listening ports (`ss -tulpn` / `lsof -i :8080`), DNS (`nslookup`/`dig`), `curl -i -X POST` health & API debugging
22.5 Linux Networking Basics (IP, Ports, DNS, HTTP, curl) (Week 22 • Linux & DevOps) 1. What It Is, Why It Is Required & How It Works Linux Networking Basics (IP, Ports, DNS, HTTP, curl) (Linux & DevOps) covers `127.0.0.1` loopback vs `0.0.0.0` all interfaces, checking listening ports (`ss -tulpn` / `lsof -i :8080`), DNS (`nslookup`/`dig`), `curl -i -X POST` health & API debugging. It is required in b...
Linux Networking Basics (IP, Ports, DNS, HTTP, curl) — Practical Implementation Assignment
Complete and push your working Linux & DevOps solution for 'Linux Networking Basics (IP, Ports, DNS, HTTP, curl)': Verify open ports and test `/actuator/health` and REST endpoints from terminal using...
Linux Networking Basics (IP, Ports, DNS, HTTP, curl) — Hands-On Coding Exercise
curl -fsS http://localhost:8080/actuator/health
`export KEY=VAL`, `env`/`printenv`, Spring Boot relaxed binding (`SPRING_DATASOURCE_URL` -> `spring.datasource.url`)
22.6 Environment Variables in Linux & Containers (Week 22 • Linux & DevOps) 1. What It Is, Why It Is Required & How It Works Environment Variables in Linux & Containers (Linux & DevOps) covers `export KEY=VAL`, `env`/`printenv`, Spring Boot relaxed binding (`SPRING_DATASOURCE_URL` -> `spring.datasource.url`). It is required in backend engineering to Overriding any `application.yml` key in Docke...
Environment Variables in Linux & Containers — Practical Implementation Assignment
Complete and push your working Linux & DevOps solution for 'Environment Variables in Linux & Containers': Launch `java -jar target/app.jar` overriding port and profile purely via exported Linux enviro...
Environment Variables in Linux & Containers — Hands-On Coding Exercise
export SPRING_PROFILES_ACTIVE=prod
export SERVER_PORT=8090
java -jar target/app.jar
Containers (shared Linux kernel + cgroups/namespaces isolation, MBs, sub-second start) vs traditional VMs (full guest OS, GBs), eliminating "works on my machine"
22.7 Docker and Containerization Fundamentals (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Docker and Containerization Fundamentals (Docker) covers Containers (shared Linux kernel + cgroups/namespaces isolation, MBs, sub-second start) vs traditional VMs (full guest OS, GBs), eliminating "works on my machine". It is required in backend engineering to Packaging Java 21 + exact OS li...
Docker and Containerization Fundamentals — Practical Implementation Assignment
Complete and push your working Docker solution for 'Docker and Containerization Fundamentals': Verify `docker info` and run an `eclipse-temurin:21-jre-alpine` container printing `java -version`. Inclu...
Docker and Containerization Fundamentals — Hands-On Coding Exercise
docker run --rm eclipse-temurin:21-jre-alpine java -version
Read-only union filesystem layers, tags (`eclipse-temurin:21-jre-alpine` vs mutable `:latest`), layer cache invalidation order, `.dockerignore`!
22.8 Docker Images and Layer Caching (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Docker Images and Layer Caching (Docker) covers Read-only union filesystem layers, tags (`eclipse-temurin:21-jre-alpine` vs mutable `:latest`), layer cache invalidation order, `.dockerignore`!. It is required in backend engineering to Copying `pom.xml` and downloading Maven dependencies in a cached layer BEFOR...
Docker Images and Layer Caching — Practical Implementation Assignment
Complete and push your working Docker solution for 'Docker Images and Layer Caching': Create a `.dockerignore` excluding `target/`, `.git/`, `.idea/`, and `.env`, and inspect image layers with `docker...
Docker Images and Layer Caching — Hands-On Coding Exercise
# .dockerignore
target/
.git/
.idea/
*.iml
.env
Port publishing `-p 8080:8080` (`host:container`), detached `-d`, `--name`, `-e` / `--env-file`, restart policies (`--restart unless-stopped`), container lifecycle
22.9 Running and Managing Containers (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Running and Managing Containers (Docker) covers Port publishing `-p 8080:8080` (`host:container`), detached `-d`, `--name`, `-e` / `--env-file`, restart policies (`--restart unless-stopped`), container lifecycle. It is required in backend engineering to Mapping host port `8081` to container port `8080` (`-p 80...
Running and Managing Containers — Practical Implementation Assignment
Complete and push your working Docker solution for 'Running and Managing Containers': Run containerized Spring Boot and PostgreSQL instances with explicit port mappings and env variables. Include clea...
Running and Managing Containers — Hands-On Coding Exercise
docker run -d --name catalog-api -p 8080:8080 -e SPRING_PROFILES_ACTIVE=prod catalog-api:1.0.0
Stage 1 (`maven:3.9-eclipse-temurin-21` compiles JAR) -> Stage 2 (`eclipse-temurin:21-jre-alpine` copies only JAR, runs as non-root `USER`, `ENTRYPOINT ["java", "-XX:MaxRAMPercentage=75.0", "-jar", "app.jar"]` exec form!)
22.10 Authoring Production Java 21 Multi-Stage Dockerfiles (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Authoring Production Java 21 Multi-Stage Dockerfiles (Docker) covers Stage 1 (`maven:3.9-eclipse-temurin-21` compiles JAR) -> Stage 2 (`eclipse-temurin:21-jre-alpine` copies only JAR, runs as non-root `USER`, `ENTRYPOINT ["java", "-XX:MaxRAMPercentage=75.0", "-...
Authoring Production Java 21 Multi-Stage Dockerfiles — Practical Implementation Assignment
Complete and push your working Docker solution for 'Authoring Production Java 21 Multi-Stage Dockerfiles': Write a multi-stage, non-root Java 21 `Dockerfile` with `MaxRAMPercentage=75.0` and build it....
Authoring Production Java 21 Multi-Stage Dockerfiles — Hands-On Coding Exercise
FROM maven:3.9-eclipse-temurin-21 AS build
WORKDIR /workspace
COPY pom.xml .
RUN mvn -B dependency:go-offline
COPY src ./src
RUN mvn -B clean package -DskipTests
FROM eclipse-temurin:21-jre-alpine
RUN addgroup -S spring && adduser -S spring -G spring
USER spring:spring
WORKDIR /app
COPY --from=build /workspace/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-XX:MaxRAMPercentage=75.0", "-jar", "/app/app.jar"]
`docker build -t`, `docker ps -a`, `docker logs -f --tail 100`, `docker exec -it <container> sh`, `docker stats` live RAM/CPU, `docker system prune`
22.11 Essential Docker CLI Commands (build, run, ps, logs, exec, stats, stop) (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Essential Docker CLI Commands (build, run, ps, logs, exec, stats, stop) (Docker) covers `docker build -t`, `docker ps -a`, `docker logs -f --tail 100`, `docker exec -it <container> sh`, `docker stats` live RAM/CPU, `docker system prune`. It is required in backend...
Essential Docker CLI Commands (build, run, ps, logs, exec, stats, stop) — Practical Implementation Assignment
Complete and push your working Docker solution for 'Essential Docker CLI Commands (build, run, ps, logs, exec, stats, stop)': Practice diagnosing a simulated bad-DB-password container exit using `dock...
Essential Docker CLI Commands (build, run, ps, logs, exec, stats, stop) — Hands-On Coding Exercise
docker ps -a
docker logs --tail 100 catalog-api
docker stats --no-stream
Why container writable layers vanish on `docker rm`, named volumes (`pg_data:/var/lib/postgresql/data`) vs bind mounts
22.12 Docker Volumes and Persistent Database Storage (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Docker Volumes and Persistent Database Storage (Docker) covers Why container writable layers vanish on `docker rm`, named volumes (`pg_data:/var/lib/postgresql/data`) vs bind mounts. It is required in backend engineering to Persisting PostgreSQL tables and Kafka logs across container restarts a...
Docker Volumes and Persistent Database Storage — Practical Implementation Assignment
Complete and push your working Docker solution for 'Docker Volumes and Persistent Database Storage': Mount a named volume on PostgreSQL, insert rows, recreate the container, and verify 100% data survi...
Docker Volumes and Persistent Database Storage — Hands-On Coding Exercise
docker volume create jbcp_pgdata
User-defined bridge networks, built-in Docker DNS resolution by service/container name (`jdbc:postgresql://postgres:5432/jobportal` — NOT `localhost`!)
22.13 Docker Container Networking (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Docker Container Networking (Docker) covers User-defined bridge networks, built-in Docker DNS resolution by service/container name (`jdbc:postgresql://postgres:5432/jobportal` — NOT `localhost`!). It is required in backend engineering to Connecting `order-service` to `postgres:5432`, `redis:6379`, and `kafka:9092...
Docker Container Networking — Practical Implementation Assignment
Complete and push your working Docker solution for 'Docker Container Networking': Connect `catalog-api` and `postgres` over a custom bridge network using `jdbc:postgresql://postgres:5432/...`. Include...
Docker Container Networking — Hands-On Coding Exercise
// Host laptop connects to localhost:5432; Spring container inside Compose connects to postgres:5432!
`compose.yaml` (`services`, `networks`, `volumes`, `environment`, `healthcheck`, `depends_on: condition: service_healthy`), `docker compose up -d --build`
22.14 Docker Compose for Multi-Container Applications (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Docker Compose for Multi-Container Applications (Docker) covers `compose.yaml` (`services`, `networks`, `volumes`, `environment`, `healthcheck`, `depends_on: condition: service_healthy`), `docker compose up -d --build`. It is required in backend engineering to Using `depends_on` with `conditio...
Docker Compose for Multi-Container Applications — Practical Implementation Assignment
Complete and push your working Docker solution for 'Docker Compose for Multi-Container Applications': Write a `compose.yaml` with `pg_isready` healthcheck and `condition: service_healthy`. Include cle...
Docker Compose for Multi-Container Applications — Hands-On Coding Exercise
depends_on:
postgres:
condition: service_healthy
`postgres:16-alpine`, `POSTGRES_DB`/`USER`/`PASSWORD`, `pg_isready` healthcheck, `/docker-entrypoint-initdb.d/` multi-database bootstrap SQL
22.15 Containerized PostgreSQL Setup and Init Scripts (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Containerized PostgreSQL Setup and Init Scripts (Docker) covers `postgres:16-alpine`, `POSTGRES_DB`/`USER`/`PASSWORD`, `pg_isready` healthcheck, `/docker-entrypoint-initdb.d/` multi-database bootstrap SQL. It is required in backend engineering to Initializing isolated databases (`user_db`, `jo...
Containerized PostgreSQL Setup and Init Scripts — Practical Implementation Assignment
Complete and push your working Docker solution for 'Containerized PostgreSQL Setup and Init Scripts': Configure `postgres:16-alpine` with healthcheck, named volume, and multi-schema/DB init script. In...
Containerized PostgreSQL Setup and Init Scripts — Hands-On Coding Exercise
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d jobportal"]
interval: 5s
timeout: 3s
retries: 10
Orchestrating Eureka, Gateway, Microservices, PostgreSQL, Redis (`redis-cli ping`), and KRaft Kafka (`KAFKA_ADVERTISED_LISTENERS` internal vs host!), memory limits
22.16 Multi-Service Spring Boot + Kafka + Redis Compose Stack (Week 22 • Docker) 1. What It Is, Why It Is Required & How It Works Multi-Service Spring Boot + Kafka + Redis Compose Stack (Docker) covers Orchestrating Eureka, Gateway, Microservices, PostgreSQL, Redis (`redis-cli ping`), and KRaft Kafka (`KAFKA_ADVERTISED_LISTENERS` internal vs host!), memory limits. It is required in backend engineering to Booting...
Multi-Service Spring Boot + Kafka + Redis Compose Stack — Practical Implementation Assignment
Complete and push your working Docker solution for 'Multi-Service Spring Boot + Kafka + Redis Compose Stack': Run Spring Boot + Postgres + Redis + KRaft Kafka together in Docker Compose and verify end...
Multi-Service Spring Boot + Kafka + Redis Compose Stack — Hands-On Coding Exercise
docker compose up -d --build && docker compose ps
Automated build + test + lint + container build on every PR (CI) vs automated staging/production release deployment (CD), fast feedback loops
22.17 CI/CD Fundamentals (Continuous Integration & Continuous Delivery) (Week 22 • CI/CD) 1. What It Is, Why It Is Required & How It Works CI/CD Fundamentals (Continuous Integration & Continuous Delivery) (CI/CD) covers Automated build + test + lint + container build on every PR (CI) vs automated staging/production release deployment (CD), fast feedback loops. It is required in backend engineering to Bloc...
CI/CD Fundamentals (Continuous Integration & Continuous Delivery) — Practical Implementation Assignment
Complete and push your working CI/CD solution for 'CI/CD Fundamentals (Continuous Integration & Continuous Delivery)': Design a 4-stage CI/CD pipeline (`Checkout -> Setup Java 21 + Maven Cache -> mvn...
CI/CD Fundamentals (Continuous Integration & Continuous Delivery) — Hands-On Coding Exercise
// CI golden rule: No PR merges to main unless compile + unit/integration tests + Docker build are 100% green
`.github/workflows/ci.yml`, triggers (`on: [push, pull_request]`), Ubuntu runners, jobs, steps, `actions/checkout@v4`, `actions/setup-java@v4` (Temurin 21 + Maven cache!)
22.18 GitHub Actions Workflow Fundamentals (Week 22 • CI/CD) 1. What It Is, Why It Is Required & How It Works GitHub Actions Workflow Fundamentals (CI/CD) covers `.github/workflows/ci.yml`, triggers (`on: [push, pull_request]`), Ubuntu runners, jobs, steps, `actions/checkout@v4`, `actions/setup-java@v4` (Temurin 21 + Maven cache!). It is required in backend engineering to Getting free, automatic green/red PR stat...
GitHub Actions Workflow Fundamentals — Practical Implementation Assignment
Complete and push your working CI/CD solution for 'GitHub Actions Workflow Fundamentals': Create `.github/workflows/ci.yml` with Java 21 Temurin + Maven caching and trigger a green workflow run on Git...
GitHub Actions Workflow Fundamentals — Hands-On Coding Exercise
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
Running `./mvnw -B verify` in GitHub Actions (Docker is pre-installed on GitHub Ubuntu runners so Testcontainers works out of the box!), uploading JaCoCo/Surefire artifacts, building Docker image
22.19 Automated Build, Test and Package Pipeline (Week 22 • CI/CD) 1. What It Is, Why It Is Required & How It Works Automated Build, Test and Package Pipeline (CI/CD) covers Running `./mvnw -B verify` in GitHub Actions (Docker is pre-installed on GitHub Ubuntu runners so Testcontainers works out of the box!), uploading JaCoCo/Surefire artifacts, building Docker image. It is required in backend engineering to Exec...
Automated Build, Test and Package Pipeline — Practical Implementation Assignment
Complete and push your working CI/CD solution for 'Automated Build, Test and Package Pipeline': Extend `ci.yml` to run `./mvnw -B verify` + `docker build -t job-portal-api:${{ github.sha }} .`. Includ...
Automated Build, Test and Package Pipeline — Hands-On Coding Exercise
run: ./mvnw -B clean verify
Standard Maven phases (`validate -> compile -> test -> package -> integration-test -> verify -> install`), Surefire (`*Test`) vs Failsafe (`*IT`), multi-module parent `pom.xml` basics
22.20 Maven Build Lifecycle Mastery (clean, compile, test, package, verify) (Week 22 • CI/CD) 1. What It Is, Why It Is Required & How It Works Maven Build Lifecycle Mastery (clean, compile, test, package, verify) (CI/CD) covers Standard Maven phases (`validate -> compile -> test -> package -> integration-test -> verify -> install`), Surefire (`*Test`) vs Failsafe (`*IT`), multi-module parent `po...
Maven Build Lifecycle Mastery (clean, compile, test, package, verify) — Practical Implementation Assignment
Complete and push your working CI/CD solution for 'Maven Build Lifecycle Mastery (clean, compile, test, package, verify)': Configure Maven compiler Java 21 release flag, Surefire JUnit 5 platform, and...
Maven Build Lifecycle Mastery (clean, compile, test, package, verify) — Hands-On Coding Exercise
<properties>
<java.version>21</java.version>
<maven.compiler.release>21</maven.compiler.release>
</properties>
Deploying containerized Spring Boot + managed PostgreSQL/Redis to a cloud VM / container platform (Render/Railway/VPS), reverse proxy TLS (Nginx/Caddy), `/actuator/health` readiness probes
22.21 Deploying a Spring Boot Backend Application (Week 22 • CI/CD) 1. What It Is, Why It Is Required & How It Works Deploying a Spring Boot Backend Application (CI/CD) covers Deploying containerized Spring Boot + managed PostgreSQL/Redis to a cloud VM / container platform (Render/Railway/VPS), reverse proxy TLS (Nginx/Caddy), `/actuator/health` readiness probes. It is required in backend engineering to Publishin...
Deploying a Spring Boot Backend Application — Practical Implementation Assignment
Complete and push your working CI/CD solution for 'Deploying a Spring Boot Backend Application': Prepare a deployment checklist & health-probe configuration (`/actuator/health/readiness` & `liveness`)...
Deploying a Spring Boot Backend Application — Hands-On Coding Exercise
management.endpoint.health.probes.enabled: true
`SPRING_PROFILES_ACTIVE=prod`, disabling `show-sql` & verbose debug logs, setting `ddl-auto: validate`, configuring CORS allowed frontend origins, JVM container memory flags
22.22 Production Profiles and Environment Configuration (Week 22 • CI/CD) 1. What It Is, Why It Is Required & How It Works Production Profiles and Environment Configuration (CI/CD) covers `SPRING_PROFILES_ACTIVE=prod`, disabling `show-sql` & verbose debug logs, setting `ddl-auto: validate`, configuring CORS allowed frontend origins, JVM container memory flags. It is required in backend engineering to Ensuring...
Production Profiles and Environment Configuration — Practical Implementation Assignment
Complete and push your working CI/CD solution for 'Production Profiles and Environment Configuration': Audit `application-prod.yml` across all 10 production-readiness security and performance settings...
Production Profiles and Environment Configuration — Hands-On Coding Exercise
spring:
jpa:
hibernate:
ddl-auto: validate
open-in-view: false
GitHub Actions Encrypted Secrets (`${{ secrets.DB_PASSWORD }}`), Docker Compose `.env` + `.env.example`, rotating leaked keys immediately, never baking secrets into `Dockerfile` `ENV`/`ARG` layers!
22.23 Secrets Management and Secure Configuration Practices (Week 22 • CI/CD) 1. What It Is, Why It Is Required & How It Works Secrets Management and Secure Configuration Practices (CI/CD) covers GitHub Actions Encrypted Secrets (`${{ secrets.DB_PASSWORD }}`), Docker Compose `.env` + `.env.example`, rotating leaked keys immediately, never baking secrets into `Dockerfile` `ENV`/`ARG` layers!. It is required in bac...
Secrets Management and Secure Configuration Practices — Practical Implementation Assignment
Complete and push your working CI/CD solution for 'Secrets Management and Secure Configuration Practices': Verify zero hardcoded credentials across Git history, `Dockerfile`s, and `application*.yml` f...
Secrets Management and Secure Configuration Practices — Hands-On Coding Exercise
# Commit .env.example with placeholder keys; inject real values via runtime env / GitHub Secrets only
Containerize a Spring Boot 3 + PostgreSQL + Redis + Kafka stack using a non-root multi-stage Java 21 `Dockerfile`, health-checked `docker-compose.yml`, and automated `.github/workflows/ci.yml` running `./mvnw -B verify`.
Module Learning & Hands-On Objectives
Product of Array Except Self, Trapping Rain Water, Subarray Sum Equals K, Merge Overlapping Intervals, Maximum Product Subarray
23.1 Arrays Interview Revision (Two Pointers, Sliding Window, Prefix Sum) (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Arrays Interview Revision (Two Pointers, Sliding Window, Prefix Sum) (DSA Revision) covers Product of Array Except Self, Trapping Rain Water, Subarray Sum Equals K, Merge Overlapping Intervals, Maximum Product Subarray. It is required in backend engineering to Crackin...
Arrays Interview Revision (Two Pointers, Sliding Window, Prefix Sum) — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Arrays Interview Revision (Two Pointers, Sliding Window, Prefix Sum)': Solve Merge Intervals, Product Except Self, and Trapping Rain Water und...
Arrays Interview Revision (Two Pointers, Sliding Window, Prefix Sum) — Hands-On Coding Exercise
// Recognize: contiguous subarray + sum/target -> Prefix Sum + HashMap or Sliding Window
Longest Palindromic Substring (expand around center), Minimum Window Substring, Find All Anagrams in a String (`int[26]` window), String Compression
23.2 Strings Interview Revision (Frequency, Palindrome, Anagrams, Patterns) (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Strings Interview Revision (Frequency, Palindrome, Anagrams, Patterns) (DSA Revision) covers Longest Palindromic Substring (expand around center), Minimum Window Substring, Find All Anagrams in a String (`int[26]` window), String Compression. It is required in backe...
Strings Interview Revision (Frequency, Palindrome, Anagrams, Patterns) — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Strings Interview Revision (Frequency, Palindrome, Anagrams, Patterns)': Solve Longest Palindromic Substring and Minimum Window Substring in J...
Strings Interview Revision (Frequency, Palindrome, Anagrams, Patterns) — Hands-On Coding Exercise
// Track bestStart & bestLen ints during scan; call s.substring(bestStart, bestStart + bestLen) once at return
LRU Cache (`HashMap` + custom Doubly Linked List in `O(1)`!), Top K Frequent Elements, Subarray Sums Divisible by K, Copy List with Random Pointer
23.3 HashMap Lookup & Frequency Interview Problems (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works HashMap Lookup & Frequency Interview Problems (DSA Revision) covers LRU Cache (`HashMap` + custom Doubly Linked List in `O(1)`!), Top K Frequent Elements, Subarray Sums Divisible by K, Copy List with Random Pointer. It is required in backend engineering to Implementing a thread-clea...
HashMap Lookup & Frequency Interview Problems — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'HashMap Lookup & Frequency Interview Problems': Implement `LRUCache(capacity)` from scratch using `HashMap<Integer, Node>` + sentinel `head`/`...
HashMap Lookup & Frequency Interview Problems — Hands-On Coding Exercise
int rem = ((int) (prefix % k) + k) % k; // Safe non-negative modulo in Java!
Reverse Nodes in k-Group, Detect Cycle Entry Node (Floyd phase 2), Merge Two/K Sorted Lists (`PriorityQueue`), Remove Nth Node From End
23.4 Linked List Interview Patterns (Reversal, Cycle Entry, Merge) (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Linked List Interview Patterns (Reversal, Cycle Entry, Merge) (DSA Revision) covers Reverse Nodes in k-Group, Detect Cycle Entry Node (Floyd phase 2), Merge Two/K Sorted Lists (`PriorityQueue`), Remove Nth Node From End. It is required in backend engineering to Demonstrating...
Linked List Interview Patterns (Reversal, Cycle Entry, Merge) — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Linked List Interview Patterns (Reversal, Cycle Entry, Merge)': Solve Remove Nth Node From End, Cycle Entry Node, and Merge K Sorted Lists. In...
Linked List Interview Patterns (Reversal, Cycle Entry, Merge) — Hands-On Coding Exercise
ListNode dummy = new ListNode(0); dummy.next = head; // Eliminates special-case head removal bugs
Daily Temperatures, Next Greater Element II (circular), Largest Rectangle in Histogram, Evaluate Reverse Polish Notation
23.5 Stack Interview Problems (Monotonic Stack & Expressions) (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Stack Interview Problems (Monotonic Stack & Expressions) (DSA Revision) covers Daily Temperatures, Next Greater Element II (circular), Largest Rectangle in Histogram, Evaluate Reverse Polish Notation. It is required in backend engineering to Solving next-warmer-day / stoc...
Stack Interview Problems (Monotonic Stack & Expressions) — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Stack Interview Problems (Monotonic Stack & Expressions)': Solve Daily Temperatures and Largest Rectangle in Histogram using `ArrayDeque<Integ...
Stack Interview Problems (Monotonic Stack & Expressions) — Hands-On Coding Exercise
Deque<Integer> indexStack = new ArrayDeque<>(); // Push/pop indices so each element is pushed & popped at most once -> O(n)
Sliding Window Maximum in `O(n)` (`ArrayDeque`), Rotten Oranges multi-source BFS queue, First Non-Repeating Character in a Stream
23.6 Queue & Monotonic Deque Interview Problems (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Queue & Monotonic Deque Interview Problems (DSA Revision) covers Sliding Window Maximum in `O(n)` (`ArrayDeque`), Rotten Oranges multi-source BFS queue, First Non-Repeating Character in a Stream. It is required in backend engineering to Maintaining rolling window maximums in `O(1)` amo...
Queue & Monotonic Deque Interview Problems — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Queue & Monotonic Deque Interview Problems': Implement `O(n)` Sliding Window Maximum using a decreasing index `ArrayDeque`. Include clear meth...
Queue & Monotonic Deque Interview Problems — Hands-On Coding Exercise
// Evict expired front index (< i - k + 1) and pop smaller back elements before pushing current index i
Search in Rotated Sorted Array, Find Peak Element, Binary Search on Monotonic Answer Space (Koko Eating Bananas / Ship Packages Within D Days)
23.7 Binary Search Variations & Binary Search on Answer Space (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Binary Search Variations & Binary Search on Answer Space (DSA Revision) covers Search in Rotated Sorted Array, Find Peak Element, Binary Search on Monotonic Answer Space (Koko Eating Bananas / Ship Packages Within D Days). It is required in backend engineering to Recogniz...
Binary Search Variations & Binary Search on Answer Space — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Binary Search Variations & Binary Search on Answer Space': Solve Search in Rotated Sorted Array and Ship Packages Within D Days. Include clear...
Binary Search Variations & Binary Search on Answer Space — Hands-On Coding Exercise
while (low < high) {
int mid = low + (high - low) / 2;
if (canShipInDays(weights, days, mid)) high = mid;
else low = mid + 1;
}
Meeting Rooms II (min conference rooms via Sweep Line / Min-Heap), Non-Overlapping Intervals, Custom Comparator Largest Number, Kth Largest (`PriorityQueue` / Quickselect)
23.8 Sorting-Based Interview Problems (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Sorting-Based Interview Problems (DSA Revision) covers Meeting Rooms II (min conference rooms via Sweep Line / Min-Heap), Non-Overlapping Intervals, Custom Comparator Largest Number, Kth Largest (`PriorityQueue` / Quickselect). It is required in backend engineering to Solving interval scheduling and Top...
Sorting-Based Interview Problems — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Sorting-Based Interview Problems': Solve Minimum Platforms / Meeting Rooms II and Non-Overlapping Intervals. Include clear method/schema namin...
Sorting-Based Interview Problems — Hands-On Coding Exercise
Arrays.sort(intervals, Comparator.comparingInt(a -> a[1])); // Sort by end time for max non-overlapping selection
Generate Parentheses, Combination Sum, Word Search on 2D Grid (in-place visited mark + restore), N-Queens pruning
23.9 Recursion & Backtracking Interview Problems (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Recursion & Backtracking Interview Problems (DSA Revision) covers Generate Parentheses, Combination Sum, Word Search on 2D Grid (in-place visited mark + restore), N-Queens pruning. It is required in backend engineering to Pruning invalid state-space branches early (e.g., `openCount &l...
Recursion & Backtracking Interview Problems — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Recursion & Backtracking Interview Problems': Solve Generate Parentheses, Combination Sum, and 2D Word Search. Include clear method/schema nam...
Recursion & Backtracking Interview Problems — Hands-On Coding Exercise
char saved = board[r][c];
board[r][c] = '#'; // mark visited
// explore 4 neighbors...
board[r][c] = saved; // restore state on backtrack!
Max Depth, Diameter of Binary Tree, Invert Tree, Lowest Common Ancestor (LCA), Validate BST (`(Long min, Long max)` bounds!), Kth Smallest in BST
23.10 Binary Trees and Binary Search Trees (BST) (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Binary Trees and Binary Search Trees (BST) (DSA Revision) covers Max Depth, Diameter of Binary Tree, Invert Tree, Lowest Common Ancestor (LCA), Validate BST (`(Long min, Long max)` bounds!), Kth Smallest in BST. It is required in backend engineering to Validating BST global range constraints...
Binary Trees and Binary Search Trees (BST) — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Binary Trees and Binary Search Trees (BST)': Solve Validate BST, Lowest Common Ancestor, and Binary Tree Diameter. Include clear method/schema...
Binary Trees and Binary Search Trees (BST) — Hands-On Coding Exercise
boolean isValidBst(TreeNode node, long minExclusive, long maxExclusive) {
if (node == null) return true;
if (node.val <= minExclusive || node.val >= maxExclusive) return false;
return isValidBst(node.left, minExclusive, node.val) && isValidBst(node.right, node.val, maxExclusive);
}
Recursive & iterative stack traversals, Level-Order BFS (`Queue`), Right-Side View, Zigzag Level Order
23.11 Tree Traversals (Inorder, Preorder, Postorder & Level-Order BFS) (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Tree Traversals (Inorder, Preorder, Postorder & Level-Order BFS) (DSA Revision) covers Recursive & iterative stack traversals, Level-Order BFS (`Queue`), Right-Side View, Zigzag Level Order. It is required in backend engineering to Using `int levelSize = queu...
Tree Traversals (Inorder, Preorder, Postorder & Level-Order BFS) — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Tree Traversals (Inorder, Preorder, Postorder & Level-Order BFS)': Implement Level-Order Traversal, Right-Side View, and Iterative Inorder Tra...
Tree Traversals (Inorder, Preorder, Postorder & Level-Order BFS) — Hands-On Coding Exercise
int levelSize = queue.size(); // Snapshot current level count BEFORE enqueuing children!
for (int i = 0; i < levelSize; i++) { /* ... */ }
Adjacency List `List<List<Integer>>`, Number of Islands, Shortest Unweighted Path (BFS), Course Schedule prerequisites cycle check (Kahn’s indegree BFS / 3-color DFS)
23.12 Graph Algorithms (BFS, DFS, Cycle Detection & Topological Sort) (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Graph Algorithms (BFS, DFS, Cycle Detection & Topological Sort) (DSA Revision) covers Adjacency List `List<List<Integer>>`, Number of Islands, Shortest Unweighted Path (BFS), Course Schedule prerequisites cycle check (Kahn’s indegree BFS / 3-color DFS)...
Graph Algorithms (BFS, DFS, Cycle Detection & Topological Sort) — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Graph Algorithms (BFS, DFS, Cycle Detection & Topological Sort)': Solve Number of Islands, Rotting Oranges, and Course Schedule (Topological S...
Graph Algorithms (BFS, DFS, Cycle Detection & Topological Sort) — Hands-On Coding Exercise
// CRITICAL BFS Rule: Mark visited[next] = true AT THE MOMENT YOU OFFER TO QUEUE, not on poll()!
Overlapping subproblems + optimal substructure, Top-Down Memoization (`Integer[] memo`) -> Bottom-Up Tabulation -> Space Optimization: Climbing Stairs, House Robber, Coin Change, Longest Increasing Subsequence, 0/1 Knapsack, LCS
23.13 Dynamic Programming (Memoization & Tabulation Fundamentals) (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Dynamic Programming (Memoization & Tabulation Fundamentals) (DSA Revision) covers Overlapping subproblems + optimal substructure, Top-Down Memoization (`Integer[] memo`) -> Bottom-Up Tabulation -> Space Optimization: Climbing Stairs, House Robber, Coin Change, L...
Dynamic Programming (Memoization & Tabulation Fundamentals) — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Dynamic Programming (Memoization & Tabulation Fundamentals)': Solve House Robber, Coin Change (Min Coins), and Longest Common Subsequence with...
Dynamic Programming (Memoization & Tabulation Fundamentals) — Hands-On Coding Exercise
// Coin Change bottom-up: dp[a] = min(dp[a], dp[a - coin] + 1), initialized to amount + 1
Deriving tight bounds for Heapify (`O(n)`), Backtracking (`O(n * 2^n)`), Graph (`O(V + E)`), DP state count x transition cost, explaining space optimization trade-offs
23.14 Complexity Analysis Walkthroughs in Live Interviews (Week 23 • DSA Revision) 1. What It Is, Why It Is Required & How It Works Complexity Analysis Walkthroughs in Live Interviews (DSA Revision) covers Deriving tight bounds for Heapify (`O(n)`), Backtracking (`O(n * 2^n)`), Graph (`O(V + E)`), DP state count x transition cost, explaining space optimization trade-offs. It is required in backend engineering to...
Complexity Analysis Walkthroughs in Live Interviews — Practical Implementation Assignment
Complete and push your working DSA Revision solution for 'Complexity Analysis Walkthroughs in Live Interviews': Present verbal + written Time & Space proofs for 12 classic Java algorithms. Include cle...
Complexity Analysis Walkthroughs in Live Interviews — Hands-On Coding Exercise
// DP Time Complexity = (# of unique states) × (transition work per state)
String Pool, `equals`/`hashCode` & `HashMap` Java 8+ treeification, `ConcurrentHashMap` vs `Hashtable`, `volatile` vs `AtomicInteger` vs `synchronized`, `CompletableFuture`, G1GC, Records & Sealed classes
23.15 Core Java, JVM & Concurrency Interview Deep-Dive (Week 23 • Technical Interviews) 1. What It Is, Why It Is Required & How It Works Core Java, JVM & Concurrency Interview Deep-Dive (Technical Interviews) covers String Pool, `equals`/`hashCode` & `HashMap` Java 8+ treeification, `ConcurrentHashMap` vs `Hashtable`, `volatile` vs `AtomicInteger` vs `synchronized`, `CompletableFuture`, G1GC, Records...
Core Java, JVM & Concurrency Interview Deep-Dive — Practical Implementation Assignment
Complete and push your working Technical Interviews solution for 'Core Java, JVM & Concurrency Interview Deep-Dive': Complete a 25-question spoken + whiteboard drill on Collections, JVM memory, and Co...
Core Java, JVM & Concurrency Interview Deep-Dive — Hands-On Coding Exercise
// If hashCode() always returns 1: all keys collide in 1 bucket -> O(n) list until size>=8 & cap>=64 -> O(log n) Red-Black Tree!
Composite B-Tree leftmost prefix, `LEFT JOIN` `ON` vs `WHERE`, `NOT IN` NULL trap, Window Functions, ACID & MVCC isolation anomalies, `SELECT FOR UPDATE`, Hibernate L1 cache, N+1 fixes, `@Version` optimistic locking
23.16 Database, SQL, Indexing & JPA Interview Deep-Dive (Week 23 • Technical Interviews) 1. What It Is, Why It Is Required & How It Works Database, SQL, Indexing & JPA Interview Deep-Dive (Technical Interviews) covers Composite B-Tree leftmost prefix, `LEFT JOIN` `ON` vs `WHERE`, `NOT IN` NULL trap, Window Functions, ACID & MVCC isolation anomalies, `SELECT FOR UPDATE`, Hibernate L1 cache, N+1 fixes,...
Database, SQL, Indexing & JPA Interview Deep-Dive — Practical Implementation Assignment
Complete and push your working Technical Interviews solution for 'Database, SQL, Indexing & JPA Interview Deep-Dive': Complete a live 15-query SQL + JPA troubleshooting interview simulation. Include c...
Database, SQL, Indexing & JPA Interview Deep-Dive — Hands-On Coding Exercise
-- Always clarify ties in SQL interviews: DENSE_RANK() handles tied salaries cleanly!
Auto-configuration `@Conditional` mechanics, Bean scopes & AOP proxy self-invocation trap, `@Transactional` propagation (`REQUIRES_NEW`) & rollback rules, `SecurityFilterChain`, stateless JWT validation, BOLA prevention
23.17 Spring Boot, Data JPA & Security Interview Deep-Dive (Week 23 • Technical Interviews) 1. What It Is, Why It Is Required & How It Works Spring Boot, Data JPA & Security Interview Deep-Dive (Technical Interviews) covers Auto-configuration `@Conditional` mechanics, Bean scopes & AOP proxy self-invocation trap, `@Transactional` propagation (`REQUIRES_NEW`) & rollback rules, `SecurityFilterChain`...
Spring Boot, Data JPA & Security Interview Deep-Dive — Practical Implementation Assignment
Complete and push your working Technical Interviews solution for 'Spring Boot, Data JPA & Security Interview Deep-Dive': Answer 20 scenario-based Spring Boot, Transaction, and JWT Security troubleshoo...
Spring Boot, Data JPA & Security Interview Deep-Dive — Hands-On Coding Exercise
// Classic interview question: Why didn't @Transactional roll back? -> 1) Checked exception, 2) Caught & swallowed, or 3) Self-invocation!
Gateway + Eureka flow, Resilience4j CircuitBreaker states, Saga compensating transactions, Kafka consumer groups/offsets/ordering/DLQ/Outbox, Idempotent consumers, Redis Cache-Aside & stampede prevention
23.18 Microservices, Spring Cloud, Kafka & Redis Interview Deep-Dive (Week 23 • Technical Interviews) 1. What It Is, Why It Is Required & How It Works Microservices, Spring Cloud, Kafka & Redis Interview Deep-Dive (Technical Interviews) covers Gateway + Eureka flow, Resilience4j CircuitBreaker states, Saga compensating transactions, Kafka consumer groups/offsets/ordering/DLQ/Outbox, Idempotent consumers,...
Microservices, Spring Cloud, Kafka & Redis Interview Deep-Dive — Practical Implementation Assignment
Complete and push your working Technical Interviews solution for 'Microservices, Spring Cloud, Kafka & Redis Interview Deep-Dive': Whiteboard an end-to-end fault-tolerant Checkout -> Inventory -> Paym...
Microservices, Spring Cloud, Kafka & Redis Interview Deep-Dive — Hands-On Coding Exercise
// Outbox Pattern (producer side) + Idempotent processed_events table (consumer side) = End-to-End Reliability
Structuring a crisp 3-minute architecture pitch, defending PostgreSQL schema/indexes, showing JWT/RBAC, walking through Kafka/Redis/Resilience4j flows, and explaining trade-offs honestly
23.19 Project Architecture Defense & Code Walkthrough Mastery (Week 23 • Technical Interviews) 1. What It Is, Why It Is Required & How It Works Project Architecture Defense & Code Walkthrough Mastery (Technical Interviews) covers Structuring a crisp 3-minute architecture pitch, defending PostgreSQL schema/indexes, showing JWT/RBAC, walking through Kafka/Redis/Resilience4j flows, and explaining trade-offs...
Project Architecture Defense & Code Walkthrough Mastery — Practical Implementation Assignment
Complete and push your working Technical Interviews solution for 'Project Architecture Defense & Code Walkthrough Mastery': Deliver a recorded 10-minute live code & architecture defense of Major Proje...
Project Architecture Defense & Code Walkthrough Mastery — Hands-On Coding Exercise
// Framework: Business Problem -> Service/DB Architecture -> Key Request/Event Flow -> Failure/Scale Trade-offs -> Tests
Complete the curated Java 21 DSA problem repository with documented Time/Space complexities (`Arrays` through `DP`) and deliver a recorded 10-minute system architecture & code walkthrough defense.
Module Learning & Hands-On Objectives
Designing schemas, constraints, and composite indexes for Users, Candidates (skills/resume metadata), Employers (companies), Jobs, and Job Applications (`UNIQUE(job_id, candidate_id)`)
24.1 Job Portal Domain Modeling, Bounded Contexts & ER Schema Design (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works Job Portal Domain Modeling, Bounded Contexts & ER Schema Design (Final Capstone) covers Designing schemas, constraints, and composite indexes for Users, Candidates (skills/resume metadata), Employers (companies), Jobs, and Job Applications (`UNIQUE(job_id, candid...
Job Portal Domain Modeling, Bounded Contexts & ER Schema Design — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'Job Portal Domain Modeling, Bounded Contexts & ER Schema Design': Deliver the complete PostgreSQL DDL schema + Mermaid/ER diagram and servic...
Job Portal Domain Modeling, Bounded Contexts & ER Schema Design — Hands-On Coding Exercise
ALTER TABLE applications ADD CONSTRAINT uq_job_candidate UNIQUE (job_id, candidate_id);
BCrypt registration for `CANDIDATE` and `EMPLOYER` accounts, JWT access/refresh token issuance, account status checks, Redis logout token revocation
24.2 User & Authentication Service (Registration, Login, JWT & RBAC) (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works User & Authentication Service (Registration, Login, JWT & RBAC) (Final Capstone) covers BCrypt registration for `CANDIDATE` and `EMPLOYER` accounts, JWT access/refresh token issuance, account status checks, Redis logout token revocation. It is required in...
User & Authentication Service (Registration, Login, JWT & RBAC) — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'User & Authentication Service (Registration, Login, JWT & RBAC)': Implement `user-auth-service` with BCrypt, JWT claims (`uid`, `roles`), an...
User & Authentication Service (Registration, Login, JWT & RBAC) — Hands-On Coding Exercise
// Restrict self-registration roles strictly to CANDIDATE or EMPLOYER; ADMIN is provisioned internally only
Candidate profile, education, experience years, skill tags & resume metadata; Employer registration, verified company profile, ownership authorization
24.3 Candidate & Employer Profile Services (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works Candidate & Employer Profile Services (Final Capstone) covers Candidate profile, education, experience years, skill tags & resume metadata; Employer registration, verified company profile, ownership authorization. It is required in backend engineering to Ensuring Employer A can update...
Candidate & Employer Profile Services — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'Candidate & Employer Profile Services': Build Candidate & Employer CRUD APIs with `@Valid` DTOs, ownership checks, and PostgreSQL persistenc...
Candidate & Employer Profile Services — Hands-On Coding Exercise
if (!company.getOwnerUserId().equals(principal.userId())) {
throw new AccessDeniedException("Not owner of company profile");
}
Job posting, status lifecycle (`DRAFT`, `OPEN`, `CLOSED`), composable `Specification<Job>` search by keyword, skill, location, workMode, experience, and salary range + `Pageable`
24.4 Job Service & Dynamic Search Engine (Filtering, Sorting & Pagination) (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works Job Service & Dynamic Search Engine (Filtering, Sorting & Pagination) (Final Capstone) covers Job posting, status lifecycle (`DRAFT`, `OPEN`, `CLOSED`), composable `Specification<Job>` search by keyword, skill, location, workMode, experience,...
Job Service & Dynamic Search Engine (Filtering, Sorting & Pagination) — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'Job Service & Dynamic Search Engine (Filtering, Sorting & Pagination)': Implement `job-service` CRUD + multi-filter `JpaSpecificationExecuto...
Job Service & Dynamic Search Engine (Filtering, Sorting & Pagination) — Hands-On Coding Exercise
// Public search enforces JobStatus.OPEN + dynamic location/skill/salary/experience Specifications
Applying to an `OPEN` job (`Idempotency-Key` + `UNIQUE(job_id, candidate_id)`), tracking states (`APPLIED -> UNDER_REVIEW -> SHORTLISTED -> INTERVIEW -> OFFERED / REJECTED`), employer vs candidate views
24.5 Application Service & Status Workflow (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works Application Service & Status Workflow (Final Capstone) covers Applying to an `OPEN` job (`Idempotency-Key` + `UNIQUE(job_id, candidate_id)`), tracking states (`APPLIED -> UNDER_REVIEW -> SHORTLISTED -> INTERVIEW -> OFFERED / REJECTED`), employer vs candidate views. It is requi...
Application Service & Status Workflow — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'Application Service & Status Workflow': Implement `application-service` with state-transition validation, duplicate-application `409 Conflic...
Application Service & Status Workflow — Hands-On Coding Exercise
public enum ApplicationStatus { APPLIED, UNDER_REVIEW, SHORTLISTED, INTERVIEW_SCHEDULED, OFFERED, REJECTED, WITHDRAWN }
Publishing `ApplicationSubmittedEvent` & `ApplicationStatusChangedEvent` (keyed by `applicationId`), `notification-service` `@KafkaListener` with idempotency table, `@RetryableTopic`, and `.DLT`
24.6 Kafka Notification Pipeline (Asynchronous Events, Retry & DLQ) (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works Kafka Notification Pipeline (Asynchronous Events, Retry & DLQ) (Final Capstone) covers Publishing `ApplicationSubmittedEvent` & `ApplicationStatusChangedEvent` (keyed by `applicationId`), `notification-service` `@KafkaListener` with idempotency table, `@Retrya...
Kafka Notification Pipeline (Asynchronous Events, Retry & DLQ) — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'Kafka Notification Pipeline (Asynchronous Events, Retry & DLQ)': Wire Kafka event publishing + idempotent `notification-service` consumer +...
Kafka Notification Pipeline (Asynchronous Events, Retry & DLQ) — Hands-On Coding Exercise
kafkaTemplate.send("job-application-events", String.valueOf(app.getId()), event);
Routing all external requests through `api-gateway` (`8080`) + Eureka (`8761`), Redis `@Cacheable` on hot `GET /api/v1/jobs/{id}` with `@CacheEvict` on job edits, Gateway Redis rate limiting
24.7 API Gateway, Eureka Discovery & Redis Caching Integration (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works API Gateway, Eureka Discovery & Redis Caching Integration (Final Capstone) covers Routing all external requests through `api-gateway` (`8080`) + Eureka (`8761`), Redis `@Cacheable` on hot `GET /api/v1/jobs/{id}` with `@CacheEvict` on job edits, Gateway Redis rate limit...
API Gateway, Eureka Discovery & Redis Caching Integration — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'API Gateway, Eureka Discovery & Redis Caching Integration': Integrate `api-gateway`, `discovery-server`, Redis JSON caching, and `X-Correlat...
API Gateway, Eureka Discovery & Redis Caching Integration — Hands-On Coding Exercise
@CacheEvict(cacheNames = "jobs", key = "#jobId")
public JobResponse closeJob(Long employerUserId, Long jobId) { /* ... */ }
JUnit 5 + Mockito service unit tests, `@WebMvcTest` RBAC/validation tests, PostgreSQL `Testcontainers` integration tests, `springdoc-openapi` Swagger UI across services
24.8 Comprehensive Test Suite & OpenAPI Documentation (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works Comprehensive Test Suite & OpenAPI Documentation (Final Capstone) covers JUnit 5 + Mockito service unit tests, `@WebMvcTest` RBAC/validation tests, PostgreSQL `Testcontainers` integration tests, `springdoc-openapi` Swagger UI across services. It is required in backend engineeri...
Comprehensive Test Suite & OpenAPI Documentation — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'Comprehensive Test Suite & OpenAPI Documentation': Write >= 25 meaningful unit, controller-slice, security, and Testcontainers integration t...
Comprehensive Test Suite & OpenAPI Documentation — Hands-On Coding Exercise
// Verify: 201 Created, 400 Validation, 401 No JWT, 403 Wrong Role/Owner, 409 Duplicate Application
Multi-stage Java 21 `Dockerfile`s, root `docker-compose.yml` with healthchecks (`Postgres`, `Redis`, `Kafka`, `Eureka`, `Gateway`, services), `.github/workflows/ci.yml`, cloud hosting setup
24.9 Docker Compose Packaging, GitHub Actions CI & Cloud Deployment (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works Docker Compose Packaging, GitHub Actions CI & Cloud Deployment (Final Capstone) covers Multi-stage Java 21 `Dockerfile`s, root `docker-compose.yml` with healthchecks (`Postgres`, `Redis`, `Kafka`, `Eureka`, `Gateway`, services), `.github/workflows/ci.yml`, cloud h...
Docker Compose Packaging, GitHub Actions CI & Cloud Deployment — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'Docker Compose Packaging, GitHub Actions CI & Cloud Deployment': Verify clean cold-start `docker compose up -d --build`, green GitHub Action...
Docker Compose Packaging, GitHub Actions CI & Cloud Deployment — Hands-On Coding Exercise
cp .env.example .env && docker compose up -d --build
Polishing portfolio `README.md` (architecture diagram, ER diagram, tech choices, curl/Postman quickstart, design trade-offs), resume bullet alignment, live end-to-end demo & code Q&A defense
24.10 Capstone Technical README, Postman Suite & Placement Viva Defense (Week 24 • Final Capstone) 1. What It Is, Why It Is Required & How It Works Capstone Technical README, Postman Suite & Placement Viva Defense (Final Capstone) covers Polishing portfolio `README.md` (architecture diagram, ER diagram, tech choices, curl/Postman quickstart, design trade-offs), resume bullet alignment, live end-to-end dem...
Capstone Technical README, Postman Suite & Placement Viva Defense — Practical Implementation Assignment
Complete and push your working Final Capstone solution for 'Capstone Technical README, Postman Suite & Placement Viva Defense': Submit all 11 Capstone deliverables and complete the live 30-minute Caps...
Capstone Technical README, Postman Suite & Placement Viva Defense — Hands-On Coding Exercise
// Final Check: Clean Git history + Architecture & ER Diagrams + Swagger + Postman + Green Tests + Live Walkthrough
Design, engineer, test, containerize, deploy, and defend a portfolio-ready distributed Job Portal Backend System comprising `User Service`, `Candidate Service`, `Employer Service`, `Job Service`, `Application Service`, and `Notification Service` behind `Spring Cloud Gateway` & `Eureka`, powered by Java 21, Spring Boot 3, Spring Security/JWT, PostgreSQL, Apache Kafka, Redis, JUnit 5/Mockito/Testcontainers, OpenAPI/Swagger, GitHub Actions CI, and Docker Compose.
Java 21 LTS
Core LanguageCore Java & OOP
Core LanguageJava Collections Framework
Core LanguageGenerics, Lambdas & Stream API
Cloud InfraJVM & Multithreading
Core LanguageData Structures & Algorithms (120+)
Core EngineeringGit & GitHub PR Workflow
Version ControlPostgreSQL & SQL
Enterprise RDBMSMySQL Fundamentals
InnoDB RDBMSJDBC & HikariCP
Build & DriversJPA & Hibernate 6
ORM & PersistenceSpring Framework 6
Java MicroservicesSpring Boot 3.x & REST APIs
Java MicroservicesSpring Data JPA & Validation
Java MicroservicesSpring Security 6 & JWT
Auth & Zero-TrustMicroservices & Spring Cloud
Scalable SystemsNetflix Eureka & API Gateway
Core EngineeringResilience4j
Core EngineeringApache Kafka
Event StreamingRedis & MongoDB Fundamentals
In-Memory CacheJUnit 5, Mockito & Testcontainers
Automated TestingSwagger / OpenAPI & Postman
Core EngineeringDocker, Linux & GitHub Actions CI/CD
ContainersMaven & IntelliJ IDEA
Build & DriversLeetCode Problem Solving
Trainer Coding PrepHackerRank Coding Prep
Trainer Coding PrepJava Backend Developer – Industry-Ready Career Program teaches you how modern tech companies design, build, test, and deploy reliable Java Enterprise Backend & Microservices Engineering software using Java 21 LTS, Core Java & OOP, Java Collections Framework, Generics, Lambdas & Stream API, JVM & Multithreading — explained in clear everyday language before writing real production code.
Suitable for both complete beginners (guided step-by-step from Day 1 setup and core logic) and technical students/working professionals aiming for production architecture mastery.
Key Engineering Capabilities You Will Build:
Purpose: Directly required by Java Enterprise Backend & Microservices Engineering engineering teams to ship reliable client systems.
Purpose: Directly required by Java Enterprise Backend & Microservices Engineering engineering teams to ship reliable client systems.
Purpose: Directly required by Java Enterprise Backend & Microservices Engineering engineering teams to ship reliable client systems.
Purpose: Directly required by Java Enterprise Backend & Microservices Engineering engineering teams to ship reliable client systems.
Purpose: Directly required by Java Enterprise Backend & Microservices Engineering engineering teams to ship reliable client systems.
Purpose: Directly required by Java Enterprise Backend & Microservices Engineering engineering teams to ship reliable client systems.
Student Learning Outcomes (By End of Course):
Taught live by active Working IT Professionals between 7:00 AM and 8:00 PM IST (choose any slot based on trainer availability).
Batch Available (Sat – Sun Only): 2 Hours / Day • 7:00 AM to 8:00 PM IST (choose any slot based on trainer availability)
Mon – Fri Guided Practice: Real GitHub repository builds, LeetCode/HackerRank coding & ≥90% Mock/AI Interview gates.
Java Backend Developer — 6-Month Live Career Cohort
Sat–Sun Live + Weekday Guided Labs & DSA • 10:00 AM – 12:30 PM IST (25 Hrs/Week Intensive Roadmap)
Starts: 21 Nov 2026
Enrolled students receive live trainer mentorship to break down algorithmic/query patterns, edge cases, and optimal complexity so you can confidently crack LeetCode and HackerRank problems in Java 21 LTS & PostgreSQL SQL.
Throughout your 6-month (180-day) Placement Tenure across 100+ curated IT job openings, our Senior Trainers actively coach and help you crack employer Online AI Assessments (OA) — including AI-proctored coding rounds, timed HackerRank/LeetCode screening tests, automated AI technical evaluations, and scenario debugging rounds.
🚀 Live Client Production Project + Internship Letter
After completing all 24 progressive hands-on module projects during live classes, students join our mentor-led Client Production Sprint to build, test, and deploy "Java Backend Developer – Industry-Ready Career Program — Enterprise Client Production Platform" to live cloud production — earning an Official Verified Internship Letter detailing their exact technical contributions.
Domain: Live Enterprise Java Enterprise Backend & Microservices Engineering Client Engagement • Infra: Java 21 LTS, Core Java & OOP, Java Collections Framework, Generics, Lambdas & Stream API, JVM & Multithreading • Git CI/CD + Automated Testing + Live HTTPS Cloud Production
Certified on Your Official Internship Confirmation Letter:
Java Backend Developer – Industry-Ready Career Program already covers 100% of the end-to-end engineering stack required for IT placement — no “next course” is needed. Below are the 100% optional, curriculum-matched industry certifications genuinely worth taking if you want a better position and higher CTC package, backed by MockAttempt’s 100% Exam-Success Mentorship where our Working IT Professional trainers ensure you succeed in every exam.
Hands-on module projects, topic-wise MCQ mocks, AI interviews & live client internship proof.
Production architecture, performance tuning & automated testing mastery.
Accelerated when paired with the optional curriculum-matched global vendor certifications below.
Selected strictly from Java Backend Developer – Industry-Ready Career Program modules — zero filler badges, only globally respected exams that unlock higher SDE/Architect shortlists and stronger CTC offers.
Already Taught in Your Curriculum: Core Java to Java 21 LTS, OOP, Streams, Records & Concurrency
Why Worth Taking: Respected by global investment banks, FinTech GCCs, and Tier-1 MNCs for higher-band Java SDE shortlists.
✅ How We Ensure Exam Success: Full 1Z0-830 code-trace labs, timed mock simulators & 1-on-1 Working Java Architect exam coaching until you pass.
Already Taught in Your Curriculum: Express REST APIs, Input Validation, OWASP Security, Rate Limiting & HTTP Architecture
Why Worth Taking: Validates production HTTP service architecture, authentication hardening, and input/attack mitigation in Node.js.
✅ How We Ensure Exam Success: Hands-on Express security drills, mock service scenarios & 1-on-1 Backend Architect code review.
Already Taught in Your Curriculum: MongoDB Document Modeling, Aggregation Pipelines, ESR Compound Indexes & Transactions
Why Worth Taking: Directly proves production schema design, aggregation performance, and Node.js driver mastery.
✅ How We Ensure Exam Success: Aggregation pipeline labs, ESR index explain() benchmarks & full C100DEV mock exams.
100% Optional Choice • We Stand Behind Your Success in Every Recommended Certification Exam (1Z0-830, JSNSD, C100DEV)
Your Java Backend Developer – Industry-Ready Career Program cohort already prepares you completely for placement. If you opt in for certification mentorship to target higher MNC/GCC positions and top-band packages, our Working IT Pro trainers guide you with hands-on blueprint labs, timed mock simulators, and 1-on-1 revision until you clear every exam.
Compare transparent all-inclusive tuition, live Working IT Professional mentorship, topic-wise Mock Tests & Spoken AI Interviews, and verifiable placement accountability side by side.
| Comparison Parameter | MockAttempt Tech Academy (JBCP • $375 ) | ₹1.5L – ₹3.0L ISA / Pay-After-Placement Bootcamps | Pre-Recorded Video Courses / Local Classrooms |
|---|---|---|---|
| Total Tuition Fee & GST | $375 All-Inclusive (Incl. 18% GST) • 3 × ₹5,000 (0% Installments) | ₹1,50,000 – ₹3,00,000 + High-Interest NBFC Loans | ₹500 – ₹15,000 (Hidden Upsells & No Live Support) |
| Post-Placement Salary Cut (ISA) | 0% Salary Cut Forever — Keep 100% of Your CTC | 15% – 25% of Monthly Salary Deducted for 24–36 Months | No Placement Cell or Employer Referral Pipeline |
| Faculty & Live Class Delivery | 100% Active Working IT Professionals (Weekend Live: Sat–Sun 2h/Day • 7 AM–8 PM IST) | Mostly Recent Graduates / Junior Teaching Assistants | Static Pre-Recorded Videos or Outdated Classroom Slides |
| Curriculum Depth & 2026 Stack | 24 Modules • 439 Live Topics • 3,512+ Subtopics (Java 21 LTS, Core Java & OOP, Java Collections Framework, Generics, Lambdas & Stream API, JVM & Multithreading) | Generic DSA + Basic CRUD (Rarely Covers Spring AI / Cloud EKS) | Surface-Level Syntax & Toy To-Do List Tutorials |
| Topic Mock Tests & Spoken AI Viva | 439 Timed 50-MCQ Mocks + 439 Spoken 4-Axis AI Interviews (Unlimited Free Retries) | Occasional Monthly Quizzes Only | Zero Spoken Technical Interview Evaluation |
| Projects & Internship Proof | 24 Real GitHub Module Repos + 1 Live Client Production Project (Java Backend Developer – Industry-Ready Ca...) + Verified Internship Letter | Cloned Group Capstone Without Client Production Deployment | Unverified Completion PDF Only |
| Placement Guarantee & OA Support | 100+ Curated IT Job Openings in 6 Months + Trainer LeetCode/HackerRank & Employer Online AI Assessment (OA) Coaching — Or 100% Net Tuition Refund* | Strict Cutoff Clauses & Zero Refund of Upfront Fees | Zero Job Guarantee or OA Coaching |
Students and working professionals join Java Backend Developer – Industry-Ready Career Program (JBCP) live online from Bengaluru, Hyderabad, Pune, Noida, Gurugram, Delhi NCR, Chennai, Mumbai, Kolkata, Ahmedabad, Kochi, Indore, Jaipur, Chandigarh, Coimbatore, and international time zones — with interactive screen-share coding, lifetime HD session recordings, and pan-India + remote placement referrals.
Need instant batch counseling? Call/WhatsApp +91 95400 07917 or
The complete 6-month (24-week) Java Backend Developer – Industry-Ready Career Program is ₹15,000 All-Inclusive (Incl. 18% GST — zero hidden fees and 0% salary share/ISA). Students can pay ₹15,000 one-time or pay in 3 equal 0% interest installments of ₹5,000 each (₹5,000 at enrollment + 2 milestone installments of ₹5,000).
The 24 weekly modules are organized into 6 structured months: Month 1 (Weeks 1–4) Core Java Fundamentals & OOP; Month 2 (Weeks 5–8) Collections, Generics, Java 8–21 Streams, JVM, Multithreading, DSA Foundation & Git/GitHub; Month 3 (Weeks 9–12) PostgreSQL/SQL, Database Design, JDBC, JPA & Hibernate; Month 4 (Weeks 13–16) Spring Core, Spring Boot 3 REST APIs, Validation & Spring Security/JWT; Month 5 (Weeks 17–20) Microservices, Spring Cloud, Eureka, API Gateway, Apache Kafka & Redis; Month 6 (Weeks 21–24) JUnit 5, Mockito, Docker, Linux, CI/CD, DSA Revision & Final Job Portal Capstone.
You build 6 progressive mandatory applications: (1) Student Management Console App (Month 1), (2) Employee Management App with Collections, Streams, File I/O & Git (Month 2), (3) Database-Driven Employee Management System with PostgreSQL, JDBC & Hibernate/JPA (Month 3), (4) Secure E-Commerce REST API with Spring Boot, JPA & JWT Security (Month 4), (5) Distributed E-Commerce Microservices System with Eureka, API Gateway, Kafka & Redis (Month 5), and (6) Final Industry Capstone: Job Portal Backend System with User, Candidate, Employer, Job, Application & Notification services containerized with Docker Compose (Month 6).
DSA is practiced continuously across all 6 months via a dedicated 120-problem Java DSA Learning Path spanning 20 areas: Complexity, Arrays, Strings, Hashing, Two Pointers, Sliding Window, Prefix Sum, Searching, Sorting, Recursion, Backtracking, Linked Lists, Stacks, Queues, Trees/BST, Heaps, Graphs (BFS/DFS), Greedy, Dynamic Programming, and Bit Manipulation.
Included: Core & Advanced Java 21, DSA, SQL & PostgreSQL (plus MySQL/MongoDB fundamentals), JDBC, Hibernate/JPA, Spring Framework, Spring Boot 3, REST APIs, Spring Security/JWT, Microservices (Spring Cloud, Eureka, API Gateway, Kafka, Redis), JUnit 5/Mockito, Git/GitHub, and practical Linux, Docker & GitHub Actions CI/CD fundamentals. Not part of this backend syllabus: React, Angular, Node.js, Python, Android, Flutter, Machine Learning, deep Kubernetes cluster administration, or advanced AWS certification tracks.
Cohorts standardize on Java 21 LTS, Spring Boot 3.x, Maven 3.x, PostgreSQL as the primary relational database, JUnit 5, Mockito, Apache Kafka, Redis, and Docker Compose so your code matches modern enterprise Java production stacks.
The recommended intensive structure totals 25 hours/week across trainer-led concept sessions (10 hrs), live coding demonstrations (3 hrs), guided practical exercises (2 hrs), independent assignments (5 hrs), DSA & interview practice (3 hrs), and weekly assessments & doubt resolution (2 hrs), adaptable to your cohort schedule while preserving all 24-week outcomes.
Academic module completion requires scoring at least 70% in theoretical MCQ assessments, at least 70% in practical/interview assessments, 100% submission of mandatory topic assignments and projects, and demonstrating the ability to explain your own code. Trainers cannot mark a module completed while mandatory topics remain incomplete.
Eligible graduates who satisfy the published attendance, original GitHub project submission, and MockAttempt assessment mastery gates receive 6 months (180 days) of curated Java Backend job openings (100+ verified opportunities) plus LeetCode/OA trainer mentorship — backed by our 100% net tuition fee refund* protection under the official Placement Charter.
Yes. Month 1 starts from zero — JDK 21 setup, variables, loops, arrays, and OOP — before progressing step-by-step to SQL, Spring Boot REST APIs, and Microservices, with topic-wise coding exercises, mock tests, and spoken AI vivas at every step.
Book Free Live Demo or Reserve Batch Seat