How do you guys practice or prepare for multi threading and concurrency related questions asked in interviews. To be more specific, I am talking about questions like those asked for pure storage interviews, confluent.io interviews etc. Not theoretical questions like difference between mutex and semaphores, but questions where they give you a problem that needs to be solved using a asynchronous and multi threaded approach. These might be judged by how are deadlocks avoided, how do you do figure out the minimal part of the code that requires co-ordination among threads, do you use muted or semaphores or conditional variables to solve problems etc?
Well I have been asked multi threading questions. I will give an example : How do u design a alarm callback system? It can take a callback function and a time after which to call this function. Your system has to keep track of everything and do this in a timely and performant manner. I was able to solve this question using mutex and conditional variables. But this is an interesting question, and I realized there are quite a few companies that ask questions like these for backend and hardcore distributed systems work.
Also I know a guy who was asked to create a mutex and semaphore in java for google on-site interview. The profile was backend distributed systems .
I interviewed at many companies including FANGs, and only Dropbox asked this stuff
Airbnb
Microsoft asks concurrency questions quite frequently. I always do.
I had a few interviews and was asked concurrency related questions in all of them. This is for L6, software engineer.
I was asked multithreading questions at amzn and g and both were having to do with understanding n finding appropriate place to create a lock to avoid any deadlocks and data overwrites
For what level were the interviews?
So how do we practice for these questions ? Are there some patterns to follow to solve these questions efficiently? Are there a set of questions, such that all questions are some variations of them? Or maybe a few questions which after completion will clear the concepts enough to handle other questions ?
LinkedIn tests you on concurrency and parallelism as well. The best way to prepare is to practice after getting a strong hold on basics.
They ask only algorithms and system design. No one goes into details of concurrency primitives or libraries
Dropbox does
LinkedIn does