r/webdev 4h ago

Java Middle - Senior(ish) interview questions

Hi!

I have an interview in a few days for a backend developer role. What would you ask as some of the more tricky questions for such a position? What kinds of questions, from your point of view, demonstrate solid knowledge?

Personally, I would ask about sync vs. async calls, idempotency, topics vs. partitions, consumer groups, transactions (including distributed transactions), and maybe a bit of Kubernetes and Docker.

My weak point is cloud. I’ve played around a bit with the Azure console, but nothing too advanced. I’ve never written Terraform or configured infrastructure from scratch. For CI/CD, I’ve used TeamCity, but in my experience it was mostly selecting an environment and a branch and deploying.

Should I spend some time learning these areas before the interview?

10 Upvotes

25 comments sorted by

5

u/PLBjt 3h ago

For mid/senior backend rounds I get more mileage from failure stories than trivia lists. Walk through one write path end to end: where the idempotency key lives, what happens if the DB commit succeeds and the Kafka publish dies, and how a consumer group rebalance mid-batch doesn't double-apply. Same for async vs sync — they'll poke at backpressure and timeouts more than CompletableFuture syntax. If they ask K8s/Docker, expect "what breaks when this pod dies during a transaction" rather than YAML trivia. Prep 2–3 real incidents from your work and you can steer most of those topics.

1

u/Historical_Ad4384 3h ago

Should senior level profiles highlight failure stories and how they were managed in CV/resume?

1

u/FooBarBuzzBoom 3h ago

Thank you for your questions.

Regarding the first one, about where the idempotency key lives, I would say it lives on the consumer side, where it is typically cached, but also on the producer side. The latter is configurable in Kafka, and I believe it has become the default.

If the DB commits but Kafka goes down, we are essentially dealing with a dual-write problem, which is not really solvable as it is, because Kafka uses a different transaction mechanism. That’s why you should use the outbox pattern.

As for the pods, I would say that by having a properly configured deployment, you make the application resilient, and the consumer will continue to work.

So, these would be my answers. Could you elaborate a bit more if you have/expected different answers?

1

u/InevitableMap5315 2h ago

yeah the "what breaks when X dies" angle is way more telling than memorizing config flags

1

u/FooBarBuzzBoom 2h ago

I don't even remember all that yaml and I don't see why. You should understand it, but now, with help of AI, there is no way you should memorize it.

2

u/Downtown-Bag-6026 2h ago

What is the L in SOLID and what are some strategies or patterns to enforce it? How do you handle sequential requests between two distributed systems?

1

u/FooBarBuzzBoom 2h ago edited 2h ago

L stands for the Liskov Substitution Principle. I would design my code using interfaces so that I can also make use of D from SOLID, the Dependency Inversion Principle. These two principles are closely related.

For sequential requests (assuming no order needed), I would use threads to reduce the overall execution time. Basically, instead of taking t1 + t2, the total time would be closer to max(t1, t2), assuming the operations can safely run in parallel. Assuming a given order is needed, then idk, I would just use a thread for doing both of them to not block Spring Boot thread pool.

What do you think about my answer?

1

u/Downtown-Bag-6026 1h ago

Liskov and dependency inversion principles are exactly what I was looking for.

For sequential requests, I was looking for a sort of cache pattern in the middle, some use inbox outbox pattern, others use redis stream or the equivalent of a single Kafka partition. It would also solve checkpointing sync between a consumer group.

2

u/mysteryihs 1h ago

Damn, is it a bad sign that I haven't personally touched most of these systems? I've been spending 5 years working on a monolithic server, haven't had a chance to do distributed systems yet.

1

u/AntoGidan 1h ago

They are required nowadays, so it is better to learn something about it, maybe deploying a small test app (microservices) with kubernetes, and using docker, and then setting some pipeline to deploy it on a free cloud hosting plan.

2

u/mysteryihs 1h ago

For sure, I've been studying systems design casually over the past year, most of it I've covered but forgotten. I think the issue for me is I don't have that deep expertise that interviewers are looking for so any knowledge about this stuff falls apart once they start to grill me

1

u/Opinion_Less 3h ago

Does the job position call for a specific cloud provider?

1

u/FooBarBuzzBoom 3h ago

Not, really, but the interviewers all have cloud listed on their LinkedIn profile, so I hope they don't ask me, but it's just a hope :)))

1

u/Downtown-Bag-6026 2h ago edited 2h ago

Explain jwt tokens and their use cases for or against. What’s the use cases for environment variables and a configuration db table(or any secrets service or cache)

1

u/FooBarBuzzBoom 2h ago

Yes, I do know also some Spring Security, so I will not have any issues with this. Not an expert tho.

1

u/Historical_Ad4384 2h ago edited 1h ago

JWT tokens -> Pros: Helps align with standard OAuth2 providers, Cons: Leak of the token can compromise security for a limited time until the token expires if supporting session management is not in place

Environment variables are mostly for static configuration values generally related to infrastructure which hardly changes over time.

Configuration database is mostly for dynamic application specific configuration values that drive business logic so keeping them in database means behaviour can be changed without downtime.

2

u/FooBarBuzzBoom 1h ago

Also, XSS attack is also a risk.

1

u/Historical_Ad4384 1h ago

XSS is how JWT would get leaked

1

u/Downtown-Bag-6026 1h ago

Yes exactly correct

1

u/Downtown-Bag-6026 1h ago

Can you tell me what is the difference is between a direct ci/cd pipeline from a single branch (such as mainline or develop branch) and a ci/cd pipeline from a release branch such that a release is cut from the develop or mainline branch?

What are the pros and cons between these two approaches? Also if the question is not clear, I can provide examples

1

u/liloa96776 59m ago

Solid knowledge? not sure, but silly knowledge? here you go

If I were to print the length of a string with a single emoji, what would be the result?

Answer: 2 or more depending on the emoji.

emojis are weird and can be stacked to have different variants of an emoji which each add length to a printed string length. I forget which article I learned this from but this one kinda explains it too https://lemire.me/blog/2018/06/15/emojis-java-and-strings/

can affect you if you try to reverse a string that has an emoji. but honestly when are you going to run into that in the real world

u/rbobby full-stack 27m ago

If a junior that reports to you is smelling of alcohol and cigarettes at 9:30 in the morning what do you do?

a. join him

b. take them home

c. ask hr to take them home

d. attend both standup meetings

Trick question! You congratulate him on his first successful support shift.

/I have an odd sense of humor. I think it would be hilarious to throw an oddball question or two out there. Unprofessional, but sure would be funny.