50 COMMON INTERVIEW QUESTIONS AND ANSWERS
[Don’t forget to have a look at free bonus at the end of this
document.]
Review these typical interview questions and think about how you would
answer them. Read
the questions listed; you will also find some strategy suggestions
with it.
1. Tell me about yourself:
The most often asked question in interviews. You need to have a short
statement prepared
in your mind. Be careful that it does not sound rehearsed. Limit it to
work-related items
unless instructed otherwise. Talk about things you have done and jobs
you have held that
relate to the position you are interviewing for. Start with the item
farthest back and work up
to the present.
2. Why did you leave your last job?
Stay positive regardless of the circumstances. Never refer to a major
problem with
management and never speak ill of supervisors, co-workers or the
organization. If you do,
you will be the one looking bad. Keep smiling and talk about leaving
for a positive reason
such as an opportunity, a chance to do something special or other
forward-looking reasons.
3. What experience do you have in this field?
Speak about specifics that relate to the position you are applying
for. If you do not have
specific experience, get as close as you can.
4. Do you consider yourself successful?
You should always answer yes and briefly explain why. A good
explanation is that you have
set goals, and you have met some and are on track to achieve the
others.
5. What do co-workers say about you?
Be prepared with a quote or two from co-workers. Either a specific
statement or a
paraphrase will work. Jill Clark, a co-worker at Smith Company, always
said I was the
hardest workers she had ever known. It is as powerful as Jill having
said it at the interview
herself.
6. What do you know about this organization?
This question is one reason to do some research on the organization
before the interview.
Find out where they have been and where they are going. What are the
current issues and
who are the major players?
7. What have you done to improve your knowledge in the last year?
Try to include improvement activities that relate to the job. A wide
variety of activities can
be mentioned as positive self-improvement. Have some good ones handy
to mention.
8. Are you applying for other jobs?
Be honest but do not spend a lot of time in this area. Keep the focus
on this job and what
you can do for this organization. Anything else is a distraction.
9. Why do you want to work for this organization?
50 Common Interview
Questions and Answers
© JobsAssist.com
(www.jobsassist.com ) and VyomWorld.com (www.vyomworld.com ) – Free Student
Resources
This may take some thought and certainly, should be based on the
research you have done
on the organization. Sincerity is extremely important here and will
easily be sensed. Relate
it to your long-term career goals.
10. Do you know anyone who works for us?
Be aware of the policy on relatives working for the organization. This
can affect your answer
even though they asked about friends not relatives. Be careful to
mention a friend only if
they are well thought of.
11. What kind of salary do you need?
A loaded question. A nasty little game that you will probably lose if
you answer first. So, do
not answer it. Instead, say something like, That's a tough question.
Can you tell me the
range for this position? In most cases, the interviewer, taken off
guard, will tell you. If not,
say that it can depend on the details of the job. Then give a wide
range.
12. Are you a team player?
You are, of course, a team player. Be sure to have examples ready.
Specifics that show you
often perform for the good of the team rather than for yourself are
good evidence of your
team attitude. Do not brag, just say it in a matter-of-fact tone. This
is a key point.
13. How long would you expect to work for us if hired?
Specifics here are not good. Something like this should work: I'd like
it to be a long time. Or
As long as we both feel I'm doing a good job.
14. Have you ever had to fire anyone? How did you feel about that?
This is serious. Do not make light of it or in any way seem like you
like to fire people. At the
same time, you will do it when it is the right thing to do. When it
comes to the organization
versus the individual who has created a harmful situation, you will
protect the organization.
Remember firing is not the same as layoff or reduction in force.
15. What is your philosophy towards work?
The interviewer is not looking for a long or flowery dissertation
here. Do you have strong
feelings that the job gets done? Yes. That's the type of answer that
works best here. Short
and positive, showing a benefit to the organization.
16. If you had enough money to retire right now, would you?
Answer yes if you would. But since you need to work, this is the type
of work you prefer. Do
not say yes if you do not mean it.
17. Have you ever been asked to leave a position?
If you have not, say no. If you have, be honest, brief and avoid
saying negative things
about the people or organization involved.
18. Explain how you would be an asset to this organization
You should be anxious for this question. It gives you a chance to
highlight your best points
as they relate to the position being discussed. Give a little advance
thought to this
relationship.
19. Why should we hire you?
Point out how your assets meet what the organization needs. Do not
mention any other
candidates to make a comparison.
50 Common Interview
Questions and Answers
© JobsAssist.com
(www.jobsassist.com ) and VyomWorld.com (www.vyomworld.com ) – Free Student
Resources
20. Tell me about a suggestion you have made
Have a good one ready. Be sure and use a suggestion that was accepted
and was then
considered successful. One related to the type of work applied for is
a real plus.
21. What irritates you about co-workers?
This is a trap question. Think real hard but fail to come up with
anything that irritates you.
A short statement that you seem to get along with folks is great.
22. What is your greatest strength?
Numerous answers are good, just stay positive. A few good examples:
Your ability to prioritize, Your problem-solving skills, Your ability
to work under pressure,
Your ability to focus on projects, Your professional expertise, Your
leadership skills, Your
positive attitude .
23. Tell me about your dream job.
Stay away from a specific job. You cannot win. If you say the job you
are contending for is
it, you strain credibility. If you say another job is it, you plant
the suspicion that you will be
dissatisfied with this position if hired. The best is to stay genetic
and say something like: A
job where I love the work, like the people, can contribute and can't
wait to get to work.
24. Why do you think you would do well at this job?
Give several reasons and include skills, experience and interest.
25. What are you looking for in a job?
See answer # 23
26. What kind of person would you refuse to work with?
Do not be trivial. It would take disloyalty to the organization, violence
or lawbreaking to get
you to object. Minor objections will label you as a whiner.
27. What is more important to you: the money or the work?
Money is always important, but the work is the most important. There
is no better answer.
28. What would your previous supervisor say your strongest point is?
There are numerous good possibilities:
Loyalty, Energy, Positive attitude, Leadership, Team player,
Expertise, Initiative, Patience,
Hard work, Creativity, Problem solver
29. Tell me about a problem you had with a supervisor
Biggest trap of all. This is a test to see if you will speak ill of
your boss. If you fall for it and
tell about a problem with a former boss, you may well below the
interview right there. Stay
positive and develop a poor memory about any trouble with a
supervisor.
30. What has disappointed you about a job?
Don't get trivial or negative. Safe areas are few but can include:
Not enough of a challenge. You were laid off in a reduction Company
did not win a contract,
which would have given you more responsibility.
31. Tell me about your ability to work under pressure.
50 Common Interview
Questions and Answers
© JobsAssist.com
(www.jobsassist.com ) and VyomWorld.com (www.vyomworld.com ) – Free Student
Resources
You may say that you thrive under certain types of pressure. Give an
example that relates
to the type of position applied for.
32. Do your skills match this job or another job more closely?
Probably this one. Do not give fuel to the suspicion that you may want
another job more
than this one.
33. What motivates you to do your best on the job?
This is a personal trait that only you can say, but good examples are:
Challenge, Achievement, Recognition
34. Are you willing to work overtime? Nights? Weekends?
This is up to you. Be totally honest.
35. How would you know you were successful on this job?
Several ways are good measures:
You set high standards for yourself and meet them. Your outcomes are a
success.Your boss
tell you that you are successful
36. Would you be willing to relocate if required?
You should be clear on this with your family prior to the interview if
you think there is a
chance it may come up. Do not say yes just to get the job if the real
answer is no. This can
create a lot of problems later on in your career. Be honest at this
point and save yourself
future grief.
37. Are you willing to put the interests of the organization ahead of
your own?
This is a straight loyalty and dedication question. Do not worry about
the deep ethical and
philosophical implications. Just say yes.
38. Describe your management style.
Try to avoid labels. Some of the more common labels, like progressive,
salesman or
consensus, can have several meanings or descriptions depending on
which management
expert you listen to. The situational style is safe, because it says
you will manage according
to the situation, instead of one size fits all.
39. What have you learned from mistakes on the job?
Here you have to come up with something or you strain credibility.
Make it small, well
intentioned mistake with a positive lesson learned. An example would
be working too far
ahead of colleagues on a project and thus throwing coordination off.
40. Do you have any blind spots?
Trick question. If you know about blind spots, they are no longer
blind spots. Do not reveal
any personal areas of concern here. Let them do their own discovery on
your bad points. Do
not hand it to them.
41. If you were hiring a person for this job, what would you look for?
Be careful to mention traits that are needed and that you have.
42. Do you think you are overqualified for this position?
Regardless of your qualifications, state that you are very well
qualified for the position.
50 Common Interview
Questions and Answers
© JobsAssist.com
(www.jobsassist.com ) and VyomWorld.com (www.vyomworld.com ) – Free Student
Resources
43. How do you propose to compensate for your lack of experience?
First, if you have experience that the interviewer does not know
about, bring that up: Then,
point out (if true) that you are a hard working quick learner.
44. What qualities do you look for in a boss?
Be generic and positive. Safe qualities are knowledgeable, a sense of
humor, fair, loyal to
subordinates and holder of high standards. All bosses think they have
these traits.
45. Tell me about a time when you helped resolve a dispute between
others.
Pick a specific incident. Concentrate on your problem solving
technique and not the dispute
you settled.
46. What position do you prefer on a team working on a project?
Be honest. If you are comfortable in different roles, point that out.
47. Describe your work ethic.
Emphasize benefits to the organization. Things like, determination to
get the job done and
work hard but enjoy your work are good.
48. What has been your biggest professional disappointment?
Be sure that you refer to something that was beyond your control. Show
acceptance and no
negative feelings.
49. Tell me about the most fun you have had on the job.
Talk about having fun by accomplishing something for the organization.
50. Do you have any questions for me?
Always have some questions prepared. Questions prepared where you will
be an asset to
the organization are good. How soon will I be able to be productive?
and What type of
projects will I be able to assist on? are examples.
1)
Explain your project architecture?
A:
-Any enterprise
application will have the following logical partitions (Tiers).
1. Client Tier
2. Present Tier
3. Business Tier
4. Persistent Tier
(Integration)
5. Data Tier
(Database)
-Tier is
nothing but a division or part.
-All java developers
are developing presentation tier, business tier and persistent tier only
browser Struts,JSF,springMVC SpringAOP
Hibernate,JPA,ibatis,spring




|
|
|
|
|
.cl
![]() |
![]() |
![]() |
![]() |
Client
Tier Presentation Business tier Persistent tier Data tier
-User
interaction is only with client tier only not any of the tiers.
-servlets and jsp’s
are used to develop presentation tier.
-presentation tier
provides the services to business tier.
-client tier is
nothing but user interaction layer.
-Database accessing logic or data accessing
from database is nothing but persisting tier.
2)what
is Singleton desing pattern? Explain?
A: The java class
which allows to create only one object per JVM is called Singleton design pattern.
Instead of creating
multiple objects for a class having same data recommended to create only one
object and use it for multiple number of times. So that object creation and
destruction time will not be wasted.
Most of the jdbc
driver class are designed as Singleton java classes.
public class STest{
private static STest
s=null;
private Stest()
{
System.out.println(“constructor”);
}
//Factory method
public static STest
create(){
if(s==null)
s=new STest();
return s;
}
public static void
main(String []args){
create();
}
}
3)
What is DAO design pattern?
A: In DAO
approach, all possible data accessing
operations are centralized in a few java classes. All business tier java
classes make use of these DAO classes to get persitence(database) services.
//MyDAO.java(user
defined interface)
public
interface MyDAO{
java.sql.Connection
getConnection();
}
//BaseDAO.java
Import
java.sql.*;
Import
javax.sql.*;
Public
class BaseDAO implements MyDAO {
Static
DataSource ds;
Static {
try{
InitialContext
ctx=new InitialContext();
Ds=(DataSource)ctx.lookup(“jndi
name”);
System.out.println(“Base
dao looked up”);
}
Catch(Exception
e){
e.printStackTrace();
}
}
public
Connection getConnection(){
Connection
con=null;
try{
con=ds.getConnection();
}
catch(SQLException
e){ }
return
con;
}
}
4)
What are the toplevel class modifiers?
A: public
, <default>, abstract, final, strictfp.
5)
What is strictfp?
A: strict
float point
This key
word can apply for the classes and methods.
If a method declared
as the strictfp all the floating point calculations inside that method has to
follow ‘IEEE754’ standards so that we will get platform independent results.
If a class declared
as the strictfp, all concreate methods
in that class has to follow ‘IEEE754’ standards for floating point
calculations. Abstract and strictfp combination is illegal for methods but is
legal combination for the classes.
6)
What is synchronized?
A:
synchronized is the keyword, which can be applied for the methods as well as blocks.
If a
method is declared as synchronized at a time only one thread is allowed to
perform execution on the given object.
The
advantage of synchronized keyword is we can achieve security and we can prevent
data curruption.
But the
major disadvantage of synchronized keyword is loss of performance.
7)
Explain the exception classes hierarchy?
A:
Object


































Checked Vs
unchecked Exceptions:
Exceptions
are of two types. 1. Checked Exception and 2. Unchecked Exception.
The
exceptions which are checked by the compiler for smooth execution of program at
runtime are called checked exceptions.
The
exceptions which are unable to checked by the compiler are called unchecked
exceptions.
Checked
exceptions should either be declared in throws clause or caught in catch block.
Unchecked
exceptions need not be declared in throws clause but can be caught in catch
block.
RuntimeException
and its child classes , Error and its child classes are unchecked Exceptions.
While the remaining all are called checked exceptions.
8)
Difference between finally and finalise?
A:
the
cleanup code, we have to keep inside finally block because irrespective of
exception occurred or not handled or not handled, the finally block will always
execute.
It is
highly recommended to keep cleanup code inside finally block instead of
finalize() method.
The
finally block will always execute except the place where the JVM got shutdown.
We can shutdown the JVM by calling “System.exit(0); method.
Once Garbage
Collection identifies an object eligible for GC, it calls finalize() method on
that object just before destroying.
The finalize() method
contains cleanup code.
Object class contains finalize() method with
the following signature.
Protected void finalize()
throws Throwable.
When the Garbage
Collector will run and whether it can destroy our object or not, we can’t give
any assurance. Hence when compared with finalize() , finally block is always
preferable for maintaining cleanup code.
While executing finalize()
if any exception raising we can catch that exception by using try-catch. If any
exception is uncaught that exception is simply ignored by the jvm, but the
remaining statements inside finalize() will not execute.
We are allowed to
called finalize() method explicitly. At that time if any exception is raising,
we should handle that exception, otherwise abnormal termination.
9)
What is multithreading and how many ways
threads are create?
A:
Executing several
tasks simultaneously, where each task is a separate independent part of the
same program. That independent program is called Thread.
Servlets follows
Thread based multi threading.
Java itself provide
support for multi threading by introducing several library classes.
Purpose of Multi
threading is to utilize the maximum CPU time.
Creating a thread in
two ways
1.
by extending Thread class
2.
by implementing Runnable interface
10)
Explain
Thread Life cycle?
A:
Life cycle
of Thread:
MyThread t= if
Thread Scheduler

|
||||||
|
||||||
|
||||||





|
t.start()
if
run() completes once
the Thread is started, there is no chance of starting the same thread once
again. Violation leads to RTE saying IllegalThreadStateException.
11)
Which
is the best way for creating thread , by extending Thread class or by
implementing Runnable interface?
A:
Creating
Thread in two ways
1.
By extending Thread class and 2. By implementing Runnable interface
Among the
above two positions of creating thread it is highly recommended to use
implements Runnable interface.
In the
first case(extends Thread), our thread class extends java.lang.Thread hence no
chance of extending anything else. Hence we are missing the key benefit of
OOP’s concept inheritance.
12)
why
wait(),notify(), notifyAll() methods are in Object class instead of Thread
class?
A:
Because,
these methods can be applied on common
shared object, not on the Thread.
In order
to call wait(), notify(), notifyAll() on any object ,we should be the owner of
that object.
i.e
we are allowed to call wait(), notify(), notifyAll() methods from the
synchronized context conly (then only we will get the lock of that object and
we will become owner of that object).
If
we call wait(), notify(), notifyAll() from non-synchronized context, we will
get a RuntimeException saying “IllegalMonitorStateException: not a owner”.
If
the thread call wait() method, first it releases the lock and then it will go
for waiting state. If the waiting thread gets ‘notification call or time
expected’ or ‘got interruption’ then it will go another blocked state for
getting lock. Once the thread got the lock, it will go to the ready state.
After
calling wait method immediately releases the lock but after giving notify call
the thread may not release the lock immediately.
The
only method which causes the releasing of lock is waiting method.
But
in the case of sleep(), join() or yield() the thread never releases the lock.
A thread
can acquire more than one lock at a time. A thread release the lock of an
object on which it calls the wait() method. It never releases all the locks.
13)
what is the difference between == operator
and .equals() method?
A:
We can apply for both
primitive and object references.
s1==s2 is true if and
only both s1,s2 pointing to same object on the heap. i.e == is always for
reference (address) comparison only.
We can’t override for
content comparison.
We can’t apply ==
operator for different types of objects. Violation leads to CTE saying
incomparable types.
S1==null is always false.
.equals():
We can apply only for
object references.
By default, .equals()
present in the object class is meant for address comparison only
We can override
(recommended for content comparison)
.equals() never raise
any CTE or RTE’s even the arguments are different types. In that situation it
will just simply returns false.
S1.equals(null) gives
false when handle NPE .
14)
what
are different types of inner classes?
A:
1.
Normal or Regular Inner classes
2.
Method local Inner classes
3.
Anonymous Inner classes
4.
Static Nested Inner classes
15)what is
serialization? Explain?
A:
The process of
storing the state of an object to a file is called serialization.
The process of
retrieving an object from the file is called deserialization.
By using read object
method of ObjectInput stream we can achieve deserialization.
***Externalizable is sub interface of Serializable interface
which contains two method readExternal(InputStream is) and
writeExternal(OutputStream os) to work with serializable interface.
It is suggestable our
java bean classes should implement Serialization.
An object is said to
be Serializable if and only if the corresponding class implements Serializable interface(directly or indirectly).
The Serializable
interface doesn’t contain any methods and it is an example of marker interface.
If the object is
non-serializable, then we are not allow to save this object to the file. Violation leads to RTE saying
“java.io.NotSerializableException”.
All the wrapper
classes, collection classes and arrays of primitives already implemented
Serializable interface. Hence these are serializable objects.
If you don’t want to
save the value of a particular instance variable while performing
serialization, then we have to declare those variables as transient.
**static variables
are not part of object state hence they never they never participated in the
Serialization process. A single copy of the static variable will exist and all
the objects will share that copy.
Final variables also
never participate in the serialization.
There is no effect of
declaring a final or a static variable as transient.
OBJECT GRAPHS:
Whenever we are
saving state of an object to the file all the objects which are reachable from
that object by default saving to the file. This group of objects are called “
Object graphs”.
Whenever we are
saving state of an object to the file, all the objects present in it’s object
graph by default will save to the file. Hence all the objects present in the
object graph also must be serializable. Violation leads to RTE saying
“NotSerializableException”.
**customized
Serialization:
During default
Serialization there may b a chance of loss of information. To overcome this problem, we can perform customized
serialization(manual Serialization).
We can perform
customized serialization by using the following two callback methods.
1.
Private void writeObject(OutputStream os){
--
--//code
}
2.
Private void readObject(InputStream is){
--//code
}
The above two methods
are called by JVM automatically at the time of serialization and
deserialization. Hence those methods are considered as Callback methods.
Serialization in the
inheritance:
Whenever we are
adding a child class object to a file, parent class object will not save to the
file because parent class objects are not part of state of child class objects.
If any variable is
inherited from the parent that variable will also add to the file as a part
of child class object.
If parent class is
serializable, by default every child class is also serializable.
15)
What is garbage collection?
A:
In java programmer is
responsible for creation of objects
where as Garbage Collector is responsible for destroying the objects. Hence, in
java memory problems we never face usually. As a result java language is
considered as the ROBUST.
The negative side of
Garbage Collector is ,if something goes wrong regarding object destruction the
programmer is not in a position to debug.
Ways of requesting
JVM to run GC:
We can request the
JVM to run GC by using following ways.
a)
By using System class:
By using
System class method or by using Runtime class method, we can request the JVM to
run GC. But JVM may accept the request, we can’t give any assurance for
that(upto 1%) System class contain a
method gc for requesting JVM to run GC.
Sytem.gc();
b)
By using Runtime class:
Java
application can communicate with the jvm
by using Runtime class object. We can get a Runtime object by using the static
method getRuntime() available in the Runtime class.
Runtime
r=Runtime.getRuntime();
gc() is the instance
method in Runtime class where as it is static method in System class.
Among the two
approaches we can prefer System.gc() as it is static.
16)Tell me
jdk1.5 features?
A:
1.)Auto Boxing &
Auto unBoxing
2)Generics:
Generics are used to
provide type safety for the collection objects and we can resolve explicit
typecasting problem. i.e no need to typecast at the time of retrieving elements
from the collection.
Ex: ArrayList<String>
l=new ArrayList<String>();
So, generics are
nothing but parameterized collections because by using this we can define the
type parameter.
Generic classes:
We are allowed to
define type parameter for the classes. Such type of parameterized classes are
called Generic classes.
We can Bound the type parameter in the Generic
classes, by using ‘extends’ keyword.
Generics all can be
used with methods.
Wildcard(?) character
is also used in Generics.
3.)Enhanced or for
each loop:
This loop has introduced
in 1.5version. The limitation of this loop is, we can apply only for iterating
the elements of Array and Collection.
int []a={1,2,3,4,5};
for(int
i=0;i<a.length;i++){
System.out.println(a[i]);
}// conventional
for(int i:a){
System.out.println(i);
}//enhanced
4.)static imports:
5.)Enum(enumeration):
6.)StringBuilder:
It is exactly similar
to StringBuffer expect all the methods are non-synchronized
When compared with
StringBuffer the following are the advantages of StringBuilder.
1.
High performance and 2. Operations are fast.
Data corruption is
possible in the StringBuilder which is the major drawback of StringBuilder,
when compared with StringBuffer.
StringBuilder sb=new
StringBuilder(“srini”);
No comments:
Post a Comment