Preparing for an interview next week and the recruiter told me to expect to be presented code which contains Java 8 features (streams, lambda expressions, functional interfaces etc.) and I should be able to on the spot explain what the code does and how it works. Does anyone have any examples of complicated blocks of code which use these features I can practice with? I understand all of these concepts individually, but just like an exam at school I would like to just smash through lots of examples just to get into the rhythm of it. I have <2 YOE if it makes a difference :)
Someone on linkedin posted the following questions he saw on an interview:
-
What are virtual threads in Java 21 and how do they differ from traditional threads?
-
How does record improve DTO handling in Java?
-
Explain the difference between Optional.get(), orElse(), and orElseThrow().
-
How does ConcurrentHashMap achieve thread safety internally?
-
What are switch expressions and how are they different from switch statements?
-
Explain the Fork/Join framework and its advantages.
-
How does pattern matching for instanceof simplify Java code?
-
How do you implement immutability in Java classes?
-
What are the benefits of using streams and functional programming in Java?
-
How does Java handle memory management for unreachable objects?
I've been a developer for over 10 years, mostly backend java, and I can only answer 7, 8, and 10. Am I right in thinking that these types of questions don't accurately gauge a developer's ability, or am I just a mediocre developer? Should I bother learning the answers to these questions (and researching other java interview questions)? On the one hand I don't think it would make me a better developer, but maybe this is what it takes to pass interviews? In previous interviews (I haven't interviewed since pre-covid) the technical part of an interview would just involve solving some problem on the white board.
Videos
In your experience, have you found that Java streams are often discouraged? I'm going through some leetcode with Java 19 and at this point Java 8 is 8+ years old.
But I remember last year going through an interview where my interviewer asked me to change my answer to not use Java 8 stream api which was annoying but I complied.
Hi all,
Today, I had an interview with ScoreMe solutions. It was final technical round - R3.
He asked me about a particular function in stream API. When I said no and explained by logic, he again asked if I remember that method.
After 2-3 similar questions like that, the interview ended. He didn't asked of I have any questions. He said I'm done with this interview. The interview ended in 15-20 mins in total.
I was borderline disgusted.
Giving interview in many MNC but facing issue with Java 8 questions. Hi developers please share some good resource link to master in java 8 question also programming questions link. I know that with practical or experience will help that. But, seriously I've been in the industry past 6 years but all I found no one deliberately use Java 8 Stream but only required in interview questions.
Note: Please Share the link for video, tutorial, books, examples etc.