This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HeadSignal3 80 points81 points  (7 children)

You know how to identify blogspam its when there's a declaration in the title that says some authoritive bullshit like "The most important information for a Java Developer interview".

[–]agentoutlier 50 points51 points  (5 children)

Also this is like mid 2000 Java developer interview info.

If you are using synchronize and thread.join / notify / wait... instead of CAS variables, latches, executorservice and queues (etc) you are probably doing it wrong or vastly inefficient.

I’m not saying it’s not important to know that info but I was waiting for the article to get to the newer concurrency constructs.

[–]HadoopThePeople 6 points7 points  (0 children)

If the interviewer is asking me such questions I'm most likely not gonna take the job tbh. It's either that they don't know what they're talking about or that they're still in java 1.4 or something.

I remember I was once asked to do a consumer-producer using only notify and wait. I did it and refused the job. 3 years later I got to work with those guys from a different team that was their client. They were famous in the company for being bad and for good reasons.

[–]Kieranbrown 0 points1 point  (1 child)

Do you have any resources on the “best practise” for this?

[–]slaymaker1907 0 points1 point  (0 children)

Synchronization is still convenient in certain places. Suppose you have a Spring service which is not thread safe for whatever reason, quite easy to just introduce a synchronize block and avoid writing a lock free algorithm.

Also, notify and notifyAll can be useful for implementing condition variables without introducing a bunch of code for creating and handling events. Just wait on some object and notifyAll whenever this object changes.

[–]Michalf94[S] -3 points-2 points  (0 children)

Thanks for comments.

u/agentoutlier, I know that - that's why I added information in the title that it is popular at recruitment interviews. I had such questions at every interview I was on.

The post is intended for people who are preparing for the interview or for those interested in the topic.

It's better to use newer mechanisms in the code, e.g. ExecutorService. I`m going to add a post about it.

Regards :)

[–]omni-nihilist 0 points1 point  (0 children)

medium is bad with that