Posts

54 SQL & Database Engineering Interview Questions and Answers for Java Backend Developers

This post answers 54 interview questions Java backend developers actually get asked about SQL, MySQL, and database engineering — with a simple explanation first and a short worked example for each one. It is Part 3 of the Java Backend Interview Question Bank series, covering section 6 of the bank: SQL, MySQL & Database Engineering (Q176–229). Part 1, 95 Microservices, Kafka & Redis Interview Questions and Answers , covered sections 7–9 (Q230–324). Part 2, 89 Spring Boot, Security & JPA Interview Questions and Answers , covered sections 3–5 (Q87–175). The rest of the bank — Core Java, system design, cloud, and more — follows in the same format. How to use it. The section is split by priority, exactly as the bank ranks it. Very High Priority questions are the ones to master first — transactions, indexes, joins, and the query patterns interviewers return to again and again. High Priority questions cover practical design and operations: normalization, replication, sharding,...

Java Factory Pattern: Factory Method vs Abstract Factory With Examples

Maya's bookstore app has grown since the last post. Checkout confirms orders by email, and customers like it. Then a customer asks: can I get the confirmation by text message instead? Maya's team adds SMS. Then push notifications. Each new channel means opening the notification code, adding another branch, and re-testing every channel that already works — because every channel is created in the same method that all the old channels live in. Then the shop expands to Europe, and the problem doubles: European messages need different senders and different footers, and nothing in the code stops an American footer from going out to a customer in Berlin. Post 1 asked what varies? Post 2, Java Singleton Pattern: Enum, Lazy Holder & Double-Checked Locking Explained , asked how many? This post asks a third question: who decides which object gets created? When the answer is "one place, not every caller," the Factory patterns are the shape for it. The principle for this ...