RSS Amplifier

Engineering With Java · Aug 20, 2026

Senior Java Interview: Bug Fix in a Generic Repository

0
Sign in to vote or save

Suraj Mishra · Engineering With Java

Your team has built a generic repository used by several Spring Boot services for caching reference data before it’s persisted.

A teammate recently tried to reuse it for a new feature and hit a compilation error.

You’re reviewing their pull request.

The new feature does this:

📢 Get actionable Java and Spring Boot insights every week, including practical code tips and real-world, use-case-based interview questions, to help you level up your backend skills—join 8300+ subscribers for hand-crafted, no-fluff content.

Upgrade to paid now (60% discount) and get the annual membership at $50/year forever that is ~ $4/mo.

So far we have covered 79+ real world based interview questions and will add up to 100 by end of this year.

Testimonials

A common misconception is:

"AdminUser extends User, so List<AdminUser> should extend List<User>."

That's not how Java generics work. Generics are invariant.

Read the original on javabulletin.substack.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.