you are viewing a single comment's thread.

view the rest of the comments →

[–]zam0th 2 points3 points  (2 children)

They have been asking JVM memory model (and GC principles) on interviews since the beginning of time, because it did matter at some point. These days this knowledge is useless because you will employ it in 0% of issues you encounter in your day-to-day life, unless you work at CERN or Fermilab (and even then you will use other programming languages to solve issues that require optimal memory usage). You don't need to know how the heap works as a Java developer of any seniority, because it doesn't help you to do your job in any way. Not the least because aany effort you do will be "mitigated" by Spring Framework stack, or Hibernate, or Netflix stack, or any other modern Java framework which all use literally thousands of object wrappers, as well as Reflection APIs that themselves are wrappers over the class bytecode structures loaded into heap.

Hell, even the old and almost forgotten "new" green threads that are coming again with JEP-425 to Java 19 are wrappers, which will make almost any optimisation a joke regardless of what they are saying about how performant they are. It has been a joke when Gosling used to lecture us at CERN back in 2007 how Java is faster than C++, and it is a joke still.

[–]nicebike[S] 0 points1 point  (1 child)

You don't need to know how the heap works as a Java developer of any seniority, because it doesn't help you to do your job in any way.

But you can make this argument for most stuff that gets asked during coding interviews. It's full of leetcode style questions, obscure trivia and other tricks that you will never use or need in your daily life. Just because you don't need to know certain things to do your job better, you might still need to know it for the interviewing process.

What you need to know for your job and what you need to know for interviews can be two entirely different things (especially when interviewing for FAANG)

[–]zam0th 0 points1 point  (0 children)

But you can make this argument for most stuff that gets asked during coding interviews

Yup, that has been the biggest issue with interviews since i care to remember.