Saturday, 7 July 2012

Technical Interview progs and Interview Q


------------------------------------------------------
Question 1
-----------------------------------------------------
What will happen if you compile/run this code?


1: public class Q1 extends Thread
2: {
3:    public void run()
4:    {
5:       System.out.println("Before start method");
6:       this.stop();
7:       System.out.println("After stop method");
8:    }
9:
10:   public static void main(String[] args)
11:   {
12:      Q1 a = new Q1();
13:      a.start();
14:   }
15: }


A) Compilation error at line 7.
B) Runtime exception at line 7.
C) Prints "Before start method" and "After stop method".
D) Prints "Before start method" only.


------------------------------------------------------
Question 2
------------------------------------------------------
What will happen if you compile/run the following code?


1:    class Test
2:    {
3:       static void show()
4:       {
5:          System.out.println("Show method in Test class");
6:       }
7:    }
8:
9:    public class Q2 extends Test
10:   {
11:      static void show()
12:      {
13:          System.out.println("Show method in Q2 class");
14:      }
15:      public static void main(String[] args)
16:      {
17:           Test t = new Test();
18:           t.show();
19:           Q2 q = new Q2();
20:           q.show();
21:
22:           t = q;
23:           t.show();
24:
25:           q = t;
26:           q.show();
27:      }
28:  }


A) prints "Show method in Test class"
          "Show method in Q2 class"
          "Show method in Q2 class"
          "Show method in Q2 class"


B) prints "Show method in Test class"
          "Show method in Q2 class"
          "Show method in Test class"
          "Show method in Test class"


C) prints "Show method in Test class"
          "Show method in Q2 class"
          "Show method in Test class"
          "Show method in Q2 class"


D) Compilation error.




------------------------------------------------------

Question 3
------------------------------------------------------
The following code will give


1:    class Test
2:    {
3:         void show()
4:         {
5:             System.out.println("non-static method in Test");
6:         }
7:    }
8:    public class Q3 extends Test
9:    {
10:      static void show()
11:      {
12:          System.out.println("Overridden non-static method in Q3");
13:      }
14:
15:      public static void main(String[] args)
16:      {
17:          Q3 a = new Q3();
18:      }
19:   }


A) Compilation error at line 3.
B) Compilation error at line 10.
C) No compilation error, but runtime exception at line 3.
D) No compilation error, but runtime exception at line 10.




------------------------------------------------------
Question 4
------------------------------------------------------
The following code will give


1:    class Test
2:    {
3:      static void show()
4:      {
5:          System.out.println("Static method in Test");
6:      }
7:    }
8:    public class Q4 extends Test
9:    {
10:       void show()
11:       {
12:           System.out.println("Overridden static method in Q4");
13:       }
14:       public static void main(String[] args)
15:       {
16:       }
17:    }


A) Compilation error at line 3.
B) Compilation error at line 10.
C) No compilation error, but runtime exception at line 3.
D) No compilation error, but runtime exception at line 10.


------------------------------------------------------
Question 5
------------------------------------------------------
The following code will print


1:    int i = 1;
2:    i <<= 31;
3:    i >>= 31;
4:    i >>= 1;
5:
6:    int j = 1;
7:    j >>= 31;
8:    j >>= 31;
9:
10:   System.out.println("i = " +i );
11:   System.out.println("j = " +j);


A) i = 1
   j = 1


B) i = -1
   j = 1


C) i = 1
   j = -1


D) i = -1
   j = 0


------------------------------------------------------
Question 6
------------------------------------------------------
The following code will print


1:    Double a = new Double(Double.NaN);
2:    Double b = new Double(Double.NaN);
3:
4:    if( Double.NaN == Double.NaN )
5:       System.out.println("True");
6:    else
7:       System.out.println("False");
8:
9:    if( a.equals(b) )
10:      System.out.println("True");
11:   else
12:      System.out.println("False");


A) True
   True


B) True
   False


C) False
   True


D) False
   False


------------------------------------------------------
Question 7
------------------------------------------------------
The following code will print


1:    if( new Boolean("true") == new Boolean("true"))
2:        System.out.println("True");
3:    else
4:        System.out.println("False");


A) Compilation error.
B) No compilation error, but runtime exception.
C) Prints "True".
D) Prints "False".




------------------------------------------------------
Question 8
------------------------------------------------------
The following code will give


1:    public class Q8
2:    {
3:        int i = 20;
4:        static
5:        {
6:            int i = 10;
7:
8:        }
9:        public static void main(String[] args)
10:       {
11:           Q8 a = new Q8();
12:           System.out.println(a.i);
13:       }
14:    }


A) Compilation error, variable "i" declared twice.
B) Compilation error, static initializers for initialization purpose only.
C) Prints 10.
D) Prints 20.


------------------------------------------------------
Question 9
------------------------------------------------------
The following code will give


1:     Byte b1 = new Byte("127");
2:
3:     if(b1.toString() == b1.toString())
4:        System.out.println("True");
5:     else
6:        System.out.println("False");


A) Compilation error, toString() is not avialable for Byte.
B) Prints "True".
C) Prints "False".


------------------------------------------------------
Question 10
------------------------------------------------------
What will happen if you compile/run this code?


1:    public class Q10
2:    {
3:       public static void main(String[] args)
4:       {
5:          int i = 10;
6:          int j = 10;
7:          boolean b = false;
8:
9:          if( b = i == j)
10:            System.out.println("True");
11:         else
12:            System.out.println("False");
13:      }
14:   }


A) Compilation error at line 9 .
B) Runtime error exception at line 9.
C) Prints "True".
D) Prints "False".


------------------------------------------------------
Question 11
------------------------------------------------------
What will happen if you compile/run the following code?


1:    public class Q11
2:    {
3:        static String str1 = "main method with String[] args";
4:        static String str2 = "main method with int[] args";
5:
6:        public static void main(String[] args)
7:        {
8:            System.out.println(str1);
9:        }
10:
11:       public static void main(int[] args)
12:       {
13:           System.out.println(str2);
14:       }
15:    }


A) Duplicate method main(), compilation error at line 6.
B) Duplicate method main(), compilation error at line 11.
C) Prints "main method with main String[] args".
D) Prints "main method with main int[] args".


------------------------------------------------------
Question 12
------------------------------------------------------
What is the output of the following code?


1:    class Test
2:    {
3:        Test(int i)
4:        {
5:            System.out.println("Test(" +i +")");
6:        }
7:    }
8:
9:    public class Q12
10:   {
11:        static Test  t1 = new Test(1);
12:
13:        Test         t2 = new Test(2);
14:
15:        static Test  t3 = new Test(3);
16:
17:        public static void main(String[] args)
18:        {
19:            Q12 Q = new Q12();
20:        }
21:    }


A) Test(1)
    Test(2)
    Test(3)


B) Test(3)
    Test(2)
    Test(1)


C) Test(2)
    Test(1)
    Test(3)


D) Test(1)
    Test(3)
    Test(2)


------------------------------------------------------
Question 13
------------------------------------------------------
What is the output of the following code?


1:    int i = 16;
2:    int j = 17;
3:
4:    System.out.println("i >> 1  =  " + (i >> 1));
5:    System.out.println("j >> 1  =  " + (j >> 1));


A) Prints  i >> 1 = 8
             j >> 1 = 8


B) Prints  i >> 1 = 7
            j >> 1 = 7


C) Prints  i >> 1 = 8
           j >> 1 = 9


D) Prints  i >> 1 = 7
           j >> 1 = 8


------------------------------------------------------
Question 14
------------------------------------------------------
What is the output of the following code?


1:    int i = 45678;
2:    int j = ~i;
3:
4:    System.out.println(j);


A) Compilation error at line 2. ~ operator applicable to boolean values only.
B) Prints 45677.
C) Prints -45677.
D) Prints -45679.


------------------------------------------------------
Question 15
------------------------------------------------------
What will happen when you invoke the following method?


1:    void infiniteLoop()
2:    {
3:        byte b = 1;
4:
5:        while ( ++b > 0 )
6:            ;
7:        System.out.println("Welcome to Java");
8:    }


A) The loop never ends(infiniteLoop).
B) Prints "Welcome to Java".
C) Compilation error at line 5. ++ operator should not be used for byte type variables.




;;;;;;;;;;;;;;;;
tips:
Campus So what if you are not a mountaineer. Or a keen hiker. You still cannot treat your interview like a careless morning trot along a jogger's path. Your jaw-jaw at the interview table is nothing less than a cautious climb up a mountain trail--which begins around your early childhood and meanders through the years at the academia before reaching a new summit in your career.And as you retrace your steps down memory lane make sure that you post flags at important landmarks of your life and career, so that you can pop them before the interview panel scoops them out of you. You don't want to be at the receiving end, do you?


Face the panel, but don't fall of the chair in a headlong rush-and-skid attempt to tell your story. Take one step at a time. If you place your foot on slippery ground, you could be ejecting out on a free fall.


So prepare, fortify your thoughts, re-jig your memory, and script and design your story (without frills and falsity). Without the right preparation and storyboard, you could be a loser at the interview. Here are a few preparation tips that books on interviews sometimes overlook.                                                           


Before the interview                                    


1. Chronological Outline of Career and Education Divide your life into "segments" defining your university, first job, second job. For each stage, jot down :


The reason for opting certain course or profession; Your job responsibilities in your previous/current job; Reason of leaving your earlier/current job. You should be clear in your mind where you want to be in the short and long term and ask yourself the reason why you would be appropriate for the job you are being interviewed for and how it will give shape to your future course.


2. Strengths and Weaknesses


You should keep a regular check on your strengths and weaknesses. Write down three (3) technical and three (3) non-technical personal strengths. Most importantly, show examples of your skills. This proves more effective than simply talking about them. So if you're asked about a general skill, provide a specific example to help you fulfil the interviewer's expectations. It isn't enough to say you've got "excellent leadership skills". Instead, try saying:


"I think I have excellent leaderships skills which I have acquired through a combination of effective communication, delegation and personal interaction. This has helped my team achieve its goals."


As compared to strengths, the area of weaknesses is difficult to handle. Put across your weakness in such a way that it at leaset seems to be a positive virtue to the interviewer. Describe a weakness or area for development that you have worked on and have now overcome.


3. Questions you should be prepared for                                                                                       


Tell us about yourself.
What do you know about our company?
Why do you want to join our company?
What are your strengths and weaknesses?
Where do you see yourself in the next five years?
How have you improved the nature of your job in the past years of your working? Why should we hire you?
What contributions to profits have you made in your present or former company? Why are you looking for a change?




Answers to some difficult questions :                                          


Tell me about yourself ?
Start from your education and give a brief coverage of previous experiences. Emphasise more on your recent experience explaining your job profile.


What do you think of your boss?
Put across a positive image, but don't exaggerate.


Why should we hire you? Or why are you interested in this job?
Sum up your work experiences with your abilities and emphasise your strongest qualities and achievements. Let your interviewer know that you will prove to be an asset to the company.


How much money do you want?
Indicate your present salary and emphasise that the opportunity is the most important consideration.


 Do you prefer to work in a group?
Be honest and give examples how you've worked by yourself and also with others. Prove your flexibility.


4. Questions to As                                                                                          


 At the end of the interview, most interviewers generally ask if you have any questions. Therefore, you should be prepared beforehand with 2-3 technical and 2-3 non-technical questions and commit them to your memory before the interview.


Do not ask queries related to your salary, vacation, bonuses, or other benefits. This information should be discussed at the time of getting your joining letter. Here we are giving few sample questions that you can ask at the time of your interview.


Sample Questions


Could you tell me the growth plans and goals for the company?
What skills are important to be successful in this position?
Why did you join this company? (optional)
What's the criteria your company uses for performance appraisal?
With whom will I be interacting most frequently and what are their responsibilities and the nature of our interaction?
What is the time frame for making a decision at this position?
What made the previous persons in this position successful/unsuccessful?


 5. Do your homework                                                                                                                              


 Before going for an interview, find out as much information on the company (go to JobsAhead Company Q and A) as possible. The best sources are the public library, the Internet (you can check out the company's site), and can even call the company and get the required information. The information gives you a one-up in the interview besides proving your content company or position.


 Clearing the interview isn't necessarily a solitary attempt. Seek assistance from individuals who are in the profession and whose counsel you value most. Be confident in your approach and attitude; let the panel feel it through your demeanour, body language and dressing.


Getting prepared for your interview is the best way to dig deep and know yourself. You will be surprised that it would breed a new familiarity become more familiar with your own qualifications that will be make you present yourself better. All the best and get ready to give a treat.






::::::::::::::::::
mistakes:


Think about the following points. Do any of them apply to you? 


Oversell 


Trying too hard to impress; bragging; acting aggressively. 


Undersell


 Failing to emphasize the fact that you have related skills; discussing 


experience using negative qualifiers (i.e. "I have a little experience..."). 


Body Language 


It is easy to create a negative impression without even realizing that you 


are doing it. Are you staring at your feet, or talking to the interviewer's 


shoulder? Be aware of what your actions say about you. 


Lack of Honesty 


The slightest stretching of the truth may result in you being screened out. 


Negative Attitude 


The interview is not an opportunity for you to complain about your 


current supervisor or co-workers (or even about 'little' things, such as 


the weather). 


Lack of Preparation 


You have to know about the organization and the occupation. If you 


don't, it will appear as though you are not interested in the position. 


Lack of 


Enthusiasm 


If you are not excited about the work at the interview, the employer will 


not assume that your attitude will improve when hired.   

No comments:

Post a Comment

Write your openion about my blog spot..To get automatic facebook updates like my Pagehttps://www.facebook.com/shivashankar4u ..It takes only 1 min to write the comment and to like the page.. Thanks.