Tuesday, June 24, 2008

Interview Questions that would reveal your psychology

Glimpses:

Some questions in the interview may reveal your inner qualities, your likely co-operation with team members, your general attitude, your technical and non-technical skills. Take a good care to answer this type of questions. I have tried to explain some of them. Good Luck.

Tips to answer such questions:

  • Be prepared thoroughly for these questions. Struggling gives clear hint.
  • Be honest to these questions. That is the best way of tackling any interview.
  • Never let down your previous employer.
  • Never let down your colleagues.
  • Strongly express what you can do and what you cannot do. Because commitment to unknown areas would backfire you.
  • Your technical skills take only 10% in the interview. Only soft-skills are what the interviewers are looking for.

Questions :

  • What do you know about our company?
  • Could you mention our competitors ?
  • Why have you applied for this particular position?
  • How did you learn of the vacancy?
  • What are your salary expectations?
  • What is your current salary or remuneration package?
  • Why do you want to leave your present job?
  • What do you think determines a person's progress within a company?
  • Why shoule we should hire you?
  • What are the blunders, you know, you have committed at work?
  • What are the things that irritate you the most in the workplace with colleagues?
  • Why do you think you might like to work for our company?
  • Do you prefer any particular geographic location? Why? Are you prepared to re-locate?
  • Would you be prepared to travel nationally/abroad? Are you prepared to go where the company sends you?
  • What are your strengths and weaknesses?
  • What would you like to be doing in 5 years time from now?
  • What are your most redeeming qualities?
  • What are your hobbies or interests?
  • What did you like/dislike about your previous employer and manager?
  • If we communicate to your previous employer, what would they tell us about you?
  • If you are given a task to do but didn't how to go about it, what would you do?
  • If you lack experience, what do you have to offer?
  • What characteristics do you think an employer looks for in an employee?
  • What sort of a company would you like to work?
  • Mention the five words that describe about you?
  • What sort of things frustrated you in your last job?
  • Do you work best on your own or in a team?
  • In your opinion, what are the most important factors in running a business?
  • What types of people seem to rub you the wrong way?
  • What types of books do you read?
  • Tell us about your home life?
  • Tell us in brief about your IT skills?
  • Can you tell me about your biggest failures and how you dealt with them?
  • Are you prepared to work at weekends?
  • What is the most significant impact you've made at your organisation in the last year?
  • How do you feel about working overtime?
  • Aren't you a bit over-qualified for this position?
  • How do you cope with your ideas not being implemented, especially when you know they would be worthwhile?
  • How do you take criticism?
  • Why have you changed jobs so many times in the past?
  • Why are you interested in a position with our company?
  • What steps have you taken to be more successful in your career?
  • Tell me about a time you became angry at work. If you had to dismiss 30 people, how would you decide whom to let go?

Monday, June 23, 2008

Struts / Java / J2EE Frequently-Asked Interview Questions

Are Struts's action classes Thread-safe?
Yes. Action classes are based on "one-instance and many-threads". This is to conserve resources and to provide the best possible throughput.

What are the various Struts Tag libraries?
There are various struts tags. But the most-repeated tags are:
struts-bean.tld
struts-html.tld
struts-logic.tld
struts-nested.tld

What is ActionMapping in struts?
Action mapping defines the flow of one request. The possible sequence is
User -> request -> Form -> Validation -> Business Code -> Forward -> JSP -> response -> User.
The components involved are Action classes, Forms and JSP.

What are the advantages of having multiple struts-config in the same application?
The implementation with many struts-config is to organize the development work, so that many people may be involved and it is some organized way of doing things. But this would result in some compromise in performance(speed). Technically there is no any difference between single and multiple struts-config files.

What are the ways in which resource file can be used in struts?
Defining message resources in struts-config file.
Programmatically using resource files in Java classes or in JSP files.

Explain the term 'architecture of the application'?
Architecture is the set of rules (or framework) to bring in some common way of assembling or using J2EE components in the application. This helps in bringing consistency between codes developed by various developers in the team.

Which is the architecture followed by struts?
Struts follows MVC architecture.

What are components corresponding o M, V and C in struts?

Model : The model represents the data of an application. Anything that an application will persist becomes a part of model. The model also defines the way of accessing this data ( the business logic of application) for manipulation. It knows nothing about the way the data will be displayed by the application. It just provides service to access the data and modify it. Here 'Form Bean' represents Model layer.

View : The view represents the presentation of the application. The view queries the model for its content and renders it. The way the model will be rendered is defined by the view. The view is not dependent on data or application logic changes and remains same even if the business logic undergoes modification. JSP represents View Layer.

Controller : All the user requests to the application go through the controller. The controller intercepts the requests from view and passes it to the model for appropriate action. Based on the result of the action on data, the controller directs the user to the subsequent view. Action classes (action servlets) represent Controller layer.

Differentiate between the terms 'Design Patterns', 'Framework' and 'Architecture'.
Design Pattern: The various solutions arrived at for the known problem. This helps to avoid re-inventing the wheel. The risk-free solution can be easily used by others. For example, singleton is the design pattern that you can use instantly to enfore one object per class. You do not need to think of this on your own.
Framework: A framework is a structure or set of rules, used to solve or address complex issues. It is basically a reusable designf for the J2EE applications. For example, Struts, JSF,etc., are the frameworks. You can use these frameworks based on the requirements of your application and each has its own set of advantages.

Architecture: It is a design that describes how the various components in the application fit together. For example, MVC is an architecture which is helpful to define how the components interact within the application.


What is the difference between ActionForm and DynaActionForm?
In action form, you need to define the form class that extends ActionForm explicitly, whereas you can define the form dynamically inside the struts-config file when using DynaActionForm.

How can you use Validator framework in struts?
Validator Frameworks are helpful when the application needs server-side validation such that the particular set of validations occur very frequently within the same application. This avoids writing complex code in validation() method in every form bean. Using validator framework, there are different pre-written validations in place. You can customize these validations in XML file.

What are client-side and server-side vaidations?
Client-side validations: These are the validations that id done using javascripts. There is always a danger involved that the user can get through (crack-through) these validations. But for some simple validations, like converting lower-case to upper-case or date validations can be done, you can use javascripts.
Server-side validations: These are the validations done in server-side using Java components (Form bean or in business logics) where the user has no chance to crookedly get through the system.

What are the advantages & differences between using validate() method in form over validations using validator framework.
Refer to the previous-answer.

Define the terms authentication and authorisation.
Authentication is the process/rule that validates if the user is allowed to access the system or not.
Authorization is the process/rule that validates if the user is allowed to access the particular part of the system or not. This occurs after user's successful authentication.

What are the components provided in J2EE to perform authentication and authorization?
Authentication – RequestProcessor and/or Filter.
Authorization - DTO, JDO or Java or Action classes.

Give the difference between between 'DispatchAction' and 'Action'.
A DispatchAction contains various different methods other than the standard execute() method in Action classes. These methods are executed based on some request parameter. For example, you can code in such a way that three buttons (namely Insert, Delete, Update) buttons correspond to different methods such as insert(), delete() and udpate(). The submit button in JSP would have the property that has the value which matches to any one of the methods defined in DispatchAction class.

What is pagination technique? How can you design them in struts?
Pagination is the technique where the bulk of results are split into different pages and only the information where the user can conveniently see are displayed in a page. (Like in Goooooogle). This can be achieved in many ways, but the simplest method is to have a query string (say http://www.testwebsite?pageNumber=2) would lead to information corresponding to resultset rows from 11 to 20. Assuming that you want to display 10 related rows of information, you can set the formula as follows:
Starting row = (pageNumber-1) * + 1 which is equal to 11.
Ending row = Starting row + which is equal to 20.

How can you populate the drop-down list using form properties?
There are many ways for this. But the best method is to use which defines collection that needs to be used to populate the drop-down list, the property to store the selected value and the collection that is used to display the labels (what we see in JSP page). For Example,

html:options collection="form-collection-property"
property="form-property"
labelProperty="form-another-collection-property"

What is the XML parser provided in struts? Can you use it for other purposes?
'Digester' framework. Yes we can use for our applications to store and parse our application-related data.

Difference between Struts 1.0 and 1.1
  • Perform() method was replaced by execute()
  • DynaActionForms are introduced.
  • Tiles Concept is introduced
  • We can write our own Controller by Inheriting RequestProcessor

Sunday, June 22, 2008

How to succeed in Java / J2EE interviews?

Why does one need 'Interview Skills' ?
Many a times, even an academically successful person could not easily turn into an IT professional. This is because, many are afraid of taking up an interview or they are not confident. So, one always needs to know that succeeding an interview is an art. Clearing the interview is a very easy task, but it is a process oriented one and anyone looking for a job should dedicate some time towards the preparation for an interview.

What happens in a normal interview?
Normally, the interview starts with the basic questions like 'Can you say about yourself',
'Why do you want a job in our company' and 'Say a few words about your family', etc. The first thing that happens in any interview is that the interviewer wants to know about you by you.

What do I prepare for an interview other than technical subject?
It always takes an hour or two to write down in a piece of paper about you, your skills, family background, academic background, etc. Though you know all these things already, it is always better to practice a little bit (like singing in a bathroom!) and say it to yourself loud about you and your good qualities. This definitely brings some confidence in you.


The Concept of any Java based interview:
The interview does not happen so randomly. It is a systemmatic process. At first, the interviewer just tests if you know the basics, for example the question is more likely as 'what is the difference between Vector and ArrayList', 'How do you handle a session' , etc. In this stage, you need to be very clear and short in your answer.

If you keep answering the questions, he/she gradually increases the depth of the questions and expect you to answer more technically/professionally than just mentioning answers. For example, the questions are more likely to test the concept behind it and not to test the answer. For example, the questions are more likely to be 'how can you implement a filter', 'why do we need to use hidden form fields', etc. In this stage, you need to come out of your shell, and narrate clearly the concepts the interviewer expects from you.

No interviewer would allow you to answer all the questions and appreciate you straightaway. So, in the next stage, the interviewer would try to trap you with questions such that you cannot answer. This is the phase wherein you prove yourself and not to try to fool the interviewer. You should never forget to be very friendly and kind to the interviewer while answering (from the heart).

I have tried to demonstrate some of the questions as given below for the professionals with various levels of experience.

Interview Questions (Samples) for "Java Developers" in Java/J2EE:

1. Which is the parser that is used in Struts to parse the struts-config.xml file?

2. Are struts action classes thread-safe?

3. Explain the life-cycle of Struts?

4. What is the difference between ArrayList & Vector?

5. Assume String x=”Chennai”, y=”Chennai”. Do x and y refer the same? Why?

6. How would you submit the struts's action automatically from the JSP page?

7. What is the difference between sendRedirect() and forward()?

Interview Questions (samples) for "Technical Leads" in Java/J2EE

1. What are the possible layers in Java? How would you decide number of layers?

2. How would you decide the number of developers required for the project?

3. What are the design issues that could occur in a J2EE application? How to solve them?

4. How would you design an exception handling techniques? What are the factors to consider?

5. What are the techniques behind displaying error or information to the user through JSP page?

6. What are custom tags? How would you create them?

Tips for being successful in interviews:

1. At first, be trained to talk about yourself and never let yourself down before the interviewer. Because, everybody wants to recruit people who are self-confident.

2. Collect your experiences in your projects and if possible, have info-base for yourself that clearly narrates the problems and solutions that you can refer later.

3. Collect the technical aspects of the projects in general, so that you can explain to the interviewer spontaneously rather than thinking at the wrong time.

4. As you grow, focus on design techniques of the projects rather than technicalities.

5. Explain with situations, examples, scenarios rather than giving the answer monotonously.

I would try to update this blog everyday with various interesting facts, scenarios and interview questions. Keep visiting this page regularly.....
Thanks and I wish all the readers all the best in the interviews.
Cheers.