Enjoy Newsletter #39.

100+ Senior Java Developer Interview Questions and Answers – 2025 Edition

This DEV Community guide compiles over 100 interview questions and answers aimed at senior Java developer roles in 2025, organized into five tracks. The Core Java section covers 25 questions split evenly across multithreading and concurrency (deadlocks, the volatile keyword), collections and their internal implementations, object-oriented design principles, memory management (garbage collection, heap layout), and Java 8+ features like functional interfaces, streams, and Optional. The Spring Boot and microservices section adds another 25 questions covering auto-configuration, bean lifecycles, inter-service communication (REST, gRPC, message queues), security with JWT, OAuth2, and role-based access control, observability tools like Sleuth, Zipkin, and Prometheus, and deployment and fault-tolerance strategies.

The remaining three sections feature 20 questions on design patterns (Singleton, Factory, Strategy, Builder, Observer, Proxy, Adapter), 15 on algorithms and data structures (complexity analysis, sorting, searching, graph traversal, Tries, LRU caches), and 15 on SQL and databases (JOINs, normalization, indexing, ACID properties, and consistency in distributed systems). What makes the list useful is its focus on real-world engineering scenarios rather than trivia syntax. For junior and mid-level developers, it serves as a solid roadmap for spotting knowledge gaps on the way to senior roles.

The Prompt Engineering Playbook for Programmers

Addy Osmani (Google) distills practical techniques for prompting AI coding assistants around seven core principles: provide rich context (language, framework, error messages, expected behavior), state specific goals, break large tasks into smaller steps, include input/output examples (few-shot prompting), assign a role such as code reviewer or security specialist, iterate across multiple turns, and keep your own codebase clean and well-named. His baseline rule is to assume the AI knows nothing about your project beyond what you explicitly put in front of it. For debugging, a reliable template is “the code is supposed to do X, but instead does Y when given input Z”; in the post’s example, pairing the error trace with sample data and expected output lets the AI immediately spot an off-by-one loop condition.

When refactoring, spell out the exact goal—readability, performance, deduplication, or preserving existing error behavior—rather than just saying “refactor this.” For new features, start from a high-level outline and build incrementally: scaffold the component first, add state management next, and wire up the API last. Common pitfalls include vague prompts, cramming too many requirements into a single turn, and omitting success criteria. Osmani advises treating AI like an eager junior developer: give clear direction, iterate patiently, and ask it to explain its reasoning so you solve the problem and learn at the same time.

Why Your AI Coding Assistant Keeps Doing It Wrong, and How To Fix It

Pete Hodgson argues that instead of debating whether “AI writes good code,” we should ask which kinds of tasks AI excels at and which ones to avoid handing it. AI coding assistants have a peculiar skill profile: they write implementation code like a senior engineer but make design decisions like a novice, and they permanently operate like a teammate “in their first hour on the job,” lacking knowledge of your codebase, team conventions, or domain context. To evaluate whether a task is a good fit, Hodgson proposes a two-axis matrix: solution space (from narrow, where there is only one obvious approach like removing a feature flag, to wide, where many reasonable designs exist like supporting multi-image uploads) and context required (relying on tacit team knowledge vs. information that can be stated explicitly). AI performs best when the solution space is narrow and the context is explicit, because wide solution spaces make it hard for the model to guess the “right” local convention.

That framework points to two levers. To narrow the solution space, give specific implementation instructions instead of letting the AI invent the plan, and break larger problems into smaller steps. To supply missing context, state requirements explicitly in the prompt, use memory or rules files, let the agent search the codebase and read docs, and connect MCP servers to database schemas or issue trackers. In short, shape the work to play to AI’s strengths rather than expecting the tool to adapt on its own.

Why AI Agents Need a New Protocol

This Glama.ai post explains why AI agents benefit from the Model Context Protocol (MCP) rather than relying solely on traditional HTTP APIs. The core premise is that HTTP APIs evolved to serve human developers and browser apps, not autonomous agents. MCP enforces consistency at the protocol layer itself, whereas OpenAPI merely documents existing APIs in all their idiosyncrasies; as the author puts it, you cannot fix structural inconsistency by writing better documentation. From there, the post highlights five practical differences: MCP lets agents query a server’s capabilities dynamically at runtime instead of relying on static docs; with raw APIs, models must construct HTTP requests themselves and frequently hallucinate paths or parameters, whereas with MCP the model simply selects a tool and deterministic code handles the underlying call; MCP treats bidirectional communication as a first-class primitive; each MCP tool maps to a complete user intent rather than scattering a workflow across multiple low-level endpoints; and MCP servers can run as local processes over stdio with no network layer required.

The author also points to the long-term payoff of standardization: models only need to learn one uniform interaction pattern instead of thousands of bespoke API dialects. The takeaway isn’t that MCP replaces HTTP APIs, but that they belong side by side—keeping APIs for developers while adding MCP as a dedicated integration layer for AI agents.

Understanding logical replication in Postgres

Garth Goodson, CTO of Springtail, walks through how logical replication works in PostgreSQL—replicating data at the level of logical row changes rather than copying raw physical disk blocks. Its foundation is the Write-Ahead Log (WAL): every modification is written to an append-only log before touching data files, with each record assigned a unique Log Sequence Number (LSN). The source database defines a publication specifying which tables or schemas to replicate, and the target creates a subscription to consume them. A replication slot tracks which WAL records have been sent and acknowledged; only WAL segments older than the replica’s confirmed flush position can be recycled, preventing data loss at the cost of requiring careful disk-space monitoring if a subscriber falls behind. Finally, logical decoding and output plugins translate raw WAL records into a consumable format; the default pgoutput plugin emits two message types: XLogData carrying the actual row changes and KeepAlive heartbeats to maintain the connection.

Logical replication is well suited for high availability, scaling out read queries, disaster recovery, and running analytical queries without bogging down the primary database. However, it comes with important caveats: it does not automatically replicate DDL changes such as schema migrations, index builds, or sequence updates; it lags behind physical replication under heavy write throughput; it requires more operational setup; and replicating UPDATE or DELETE operations requires tables to have a primary key or an explicit replica identity (with REPLICA IDENTITY FULL as a fallback).

One Man Armies

This short essay on Quarter Mile opens with a striking observation: human productivity varies wildly, and projects many assume would require a full team and $5 million are sometimes built by a single obsessed, hardworking individual. To make the point, the author lists landmark works created (almost) entirely solo: Eric Barone building Stardew Valley across 70-hour weeks for 4.5 years, Markus Persson writing Minecraft in 2 years, John Resig creating jQuery, Chris Sawyer writing RollerCoaster Tycoon in assembly, Chris Hunt spending 12 years on the RPG Kenshi, Linus Torvalds starting Linux, and Donald Knuth writing The Art of Computer Programming. The list stretches well beyond software too: Ada Lovelace’s first computer program, Einstein’s general relativity, Antoni Gaudí’s 40+ years on the Sagrada Família, Marie Tharp’s first scientific map of the Atlantic ocean floor, and Karlheinz Stockhausen’s nearly 30-hour Licht seven-opera cycle.

The author leaves readers to draw their own conclusions, offering just one gentle nudge: if general relativity, an entire cathedral, a 29-hour opera cycle, and billion-dollar video games can be brought into the world by one person, your own ambitious, seemingly far-fetched ideas probably aren’t too big either—and if you care about them enough, they are worth trying.

What’s the relationship between developer seniority and code refactoring?

In the RDEL (Research-Driven Engineering Leadership) newsletter, Lizzie Matusov summarizes a study examining how developer seniority relates to code refactoring. Researchers analyzed 800 open-source Java projects on GitHub, mining over 700,000 refactoring operations across 111,884 commits, measuring seniority via each contributor’s Developer Commit Ratio, and using machine learning models to classify the motivation behind each refactoring. They found that the top 5% most senior contributors performed an average of 11.14 refactorings compared to 3.57 among everyone else, and applied a wider variety of refactoring techniques. Most refactorings happened while implementing new features or fixing bugs rather than as standalone cleanup, and that motivation held steady across seniority levels. Notably, the most senior developers were actually less likely to document their refactorings in commit messages than less experienced contributors.

From those findings, the post offers three takeaways for engineering leaders. First, encourage engineers at all levels to participate in refactoring through pair programming and shared design principles. Second, make refactoring work visible by recognizing it in retrospectives and promotion criteria. Third, standardize how refactorings are documented using lightweight commit-message prompts and code-review guidelines that apply equally to everyone, regardless of seniority.


This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026; reviewed and edited by Codex with GPT 6.1 Sol on 09/11/2026, and re-verified by Claude Code with Sonnet 5.5 on 16/11/2026.