Java coding synchronize the threads using semaphores and operations on semaphores

Job ID: 34190443

Budget: $30 – $250 USD

It’s finally the start of the semester and applications have opened for internships and new grad positions. Due to limited spots, some applicants will either get the job while the rest get rejected.
Applicants apply for the position at different times during the semester (simulated by sleep of random time). Next, they will wait for a response (use a semaphore).
Once the application is sent to the company, recruiters (assume numRecruiters) begin to look over the applicant’s resume and application. The recruiter might review a few applications a day (sleep of random time for each application reviewed). The recruiter gets to decide whether to let the applicant proceed to the interview phase or if the applicant should be rejected on the spot. Once all the applications are reviewed (use counter and semaphore(s)), the recruiters will send their response letters to the applicants (they will unblock the applicants). Assume that 20% of the time, an applicant does not pass the resume phase (generate a number between 0 and 10; if the number is 2 or less then that applicant will be rejected, else they continue on).
The recruiters will terminate after all the applications have been taken into consideration and all the responses have been sent. (use semaphore(s)).
Some applicants will move forward onto the interview phase, and the ones who got rejected will terminate. The applicants that will move forward (use sleep of random time) have a list of

possible days for the interview. all applicants will wait (use semaphores) to be called for the interview.
There is numInterviewers. The technical interviewer will call the applicant when the interview time comes the applicant (you should have a while loop for the interviewer). The applicant will move into the being Interviewed phase and again (s)he will wait until the interview ends and a decision is taken.
Because there are limited spots for the position, not all applicants on the technical interviewer’s list will get accepted. Besides, assume that there are only numJobs, once all the jobs are filled up, no more applicants will receive an interview, they will automatically be rejected and will terminate. The probability of being accepted will be 70% (for each interview generate a random number between 0 and 10. if the number is 7 or less then that applicant will be accepted else it will be rejected).
Those that passed the interview and got the job will decide to celebrate first. In the cafeteria they are numTables and each table has numSeats. The applicants will group in groups of numSeats (use semaphores(s)), next the group will take an available table (use semaphore(s)). They will celebrate (use sleep of random time). Once all applicants at a table are done celebrating the table will be released and they will move to the Lobby waiting to leave terminate. They will terminate in the increasing order of their name.
Let’s say that applicant1, 4, 6, 8 and 10 got the job. Applicant 1 can terminate right away, applicant 4 will join applicant 1, applicant 6 will join applicant 1 and so on (use semaphore(s). If you want you can also use the isAlive() method)
After all applicants terminate, then the interviewer will terminate as well.
Default values

numApplicants = 20
numRecruiters = 2
numInterviewers = 1
numJobs = 10
numTables =2
numSeats = 3