Personally I am using high level concurrency abstractions cause they are much easier. Actually I cannot remember the last time I have used a theads. But on the technical interview it is a frequently asked question. And yeah I ask about it too.
Are there any use cases when it is necessary to use low level Thread API instead of Executors/Locks/Latches/etc.?
Is there any reason to discuss low level thread API during the technical interview?
Threading is a process where multiple threads run at the same time to increase the efficiency of the processor. Using the Threading API, you can run a main thread and a worker thread simultaneously in your JavaScript application.
A thread is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently. Every thread has a priority. Threads with higher priority are executed in preference to threads with lower priority.
Advantages of Thread Use of threads provides concurrency within a process. Efficient communication. It is more economical to create and context switch threads. Threads allow utilization of multiprocessor architectures to a greater scale and efficiency.
Technical interviews are often designed to measure the depth of the candidate's knowledge, not any particular ability. Arguably, there has been no need to implement your own linked lists and binary trees for good 15..20 years, yet the questions asking to implement these data structures routinely come up in technical interviews. A smart candidate should be able to figure out high-level concurrency APIs from a short tutorial and the API docs. You ask about thread primitives to see if the candidate understands what is happening behind the scenes when he or she uses concurrency in general, no matter what API is called.
Personally, when I ask questions about things you'd never use, I do not insist on getting the correct names or the right order of the API method parameters. As long as the candidates are clear on the concept, I do not mind them not remembering the particulars of the specific API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With