Intuit Interview Question for Senior Software Development Engineers

Country: United States

Comment hidden because of low score. Click to expand.
of 2 vote

1) Join(): this method waits for a thread to die. for example:

 }catch(Exception e){System.out.println(e);}  

Here, at first t1 thread completes it execution then the t2 and t3 starts there execution.

2) wait(): when this method is called that means it waits for a thread to be completed. Normally this method is used where there is needed synchronize execution. for example:

public class ThreadA {
    public static void main(String[] args){
        ThreadB b = new ThreadB();
                System.out.println("Waiting for b to complete...");
            }catch(InterruptedException e){
            System.out.println("Total is: " +;
class ThreadB extends Thread{
    int total;
    public void run(){
            for(int i=0; i<100 ; i++){
                total += i;

In the above code, when b thread finishes its operation then it calls the notify() method. Then the wait() method terminates the waiting.
If you conceptually want to understand, then you can consider the producer and consumer problem where consumer waits for a product to be produced by the producer. That means, when producer notify the consumers only then the consumers can consume the products.

3) sleep(ms): Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds.

- Md. Mahedi Kaysar September 25, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
of 1 vote

1) Join()=> the current thread has to wait for the thread's object exit status.
2) wait()=> wait() tells the calling thread to give up the monitor and go to sleep until some other thread enters the same monitor and calls notify( ).
3) Sleep()=> it hold the current thread execution.
Wait() releases the lock() of the moniter

- yogi.rulzz September 17, 2014 | Flag Reply

Add a Comment

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.


is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More


CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More