March 05, 2014

Latest Interview Questions on JAVA (Prepared by Sumitav Tripathy)

Wipro Interview Questions (Face to Face 1st March 2014)   For 4+ Experience.

·         Difference between Abstract Class & Interface?
·         Difference between Array List & Vector?
·         Difference between Array List & Linked List?
·         What is the script let in JSP can you write a script let for me.
·         For generating Excel from JSP what you do. I told Jasper Reports.
·         Explain the flow of Struts framework & how your project works on that.
·         What is MVC?
·          What is dependency injection?  How many types?
·         He asked about Spring AOP I told I do not know.
·         What is hibernate what are the advantages over JDBC?
·          How do you debug your Web Application?
·         What are the types of Loggers (specific to Log4J)
·         Which collection had you used in your project to access data from database I told HashMap
·         What is difference between HashMap & Hashtable?
·         Difference between Comparable & Comparator?
·         What is Marker Interface?
·         Difference between final, finally & finalize.
·         Difference between yield, join & sleep methods.
·         Why Strings are final. Why Strings are Immutable
·         What is difference between load & get java.
·         Difference between get & post.
·         What is difference between sendRedirect & forward?
·         JSP Lifecycle. Servlet life cycle. At which phase of JSP Lifecycle JSP converts to Servlet.
·         Do you know CSS & HTML.I told I know only basics?


IBS Interview Questions (Face to Face 27th Feb 2014):   For 4+ Experience
·         Difference between Array List & Vector.
·         Explain Spring Web MVC Flow
·         Difference between Abstract Class & Interface.
·         Difference between Array List & Linked List.
·         Write a program which will use all the same functions of ArrayList by using array like insertion, deletion without using any collection methods. Means create an ArrayList using array.
·         How many ways can you create Threads?
·         Tell me real time scenarios when to extend Thread class & when to implement runnable interface.
Which one is better?  In which scenario you will prefer extending Thread class to implement runnable interface.
 They asked about some exception in Multithreading which I had never heard.
·          There is a class which has 2 variables Employee name (String) & Employee Id(number ).
·         (a)Write a program (Here after read WAP as short form of  “Write a program”)  by using collection framework to sort according to the increasing order of employee Id. Which collection will you use  ?
·         (b) WAP by using collection framework to sort according to the alphabetical or
der of employee name. Which collection will you use?
·          How HashMap works?
·          Difference between yield, join & sleep methods.
·         What do you understand by immutability?
·         String  s=”Sumitav”; String  s1=new String (“Sumitav”);
·         s==s1    True/False ?   Also s.equals(s1);  what will be the output ?
·         Are only strings Immutable? I told no wrapper classes too.
I am writing a variable in an interface by default what will be its modifiers & access types I told “public static final” then they asked if one method is declared what will be the access specified. I told default write answer is public.
·         Can we write a constructor inside an Interface?  I told No
·         Then they asked can we write a constructor inside abstract class. I told yes then they asked what will be the purpose of this constructor if we cannot create object. I told for child class it will be used by super(); 
abstract class A {
     A(){ }
     abstract add();
}

Class B extends A {
A(){ }
add(){
sop("...");
}
}

·         Can you override the above constructor in child class? I was not sure.
·         Can an interface have a concrete method? I told no. Abstract class can have but not an interface.
·         What is second level cache in hibernate?
·         How you do Spring-Hibernate Integration.
·         Difference between default & private.


CapGemini Telephonic Interview Questions on 2nd March 2014:  For 4+ Experience.


·         What is Polymorphism what is the purpose.
·         What is Encapsulation? What is the purpose?
·         Flow of Struts according to your project.
·         Difference between Comparable & Comparator?
·          Difference between Hashtable & HashMap?
·         What is difference between sendRedirect & forward?
·         What is request Dispatcher?
·         Explain JSP Lifecycle.


Accenture Telephonic Interview  Questions on 10th March 2014:  For 4+ Experience

·         Can you tell me the life cycle of a servlet?
·         What is the difference between a servlet & JSP?
·         Can you tell me the difference between doGet & doPost. I told get passes data as query string so not safe.
·         Does get is faster than post?  I told I am not sure.
·         What is difference between JDK & JRE?
·         How you track a session & in how many ways can you track a session.  I answered cookies, URL rewriting & session.
·         You have a list you want to remove duplicates in the list. How will you do that ?  I told we have to use Set because set does not allow duplication. He told that’s what I was expecting.
·         How you compare a list of objects. I told comparable & comparator we have & the difference between them.
·         Have you worked on front end? I told yes then the interviewer asked how you do “pagination” in webpage. I asked pardon!!!! Question bounced J He asked do you understand what is pagination?  When you search in Google you search something at the bottom of the page you find 1, 2, 3…. That is called pagination. How will you do that? I told I think there may be some directives like JSP page directives. Just bluffed J I could not answer might be href of splitting table. How will you develop pagination in your application?
·         How will you debug a JavaScript .Suppose you have developed a Web application, you have used some JavaScript to validate your application right!!! Now you want to debug that web application, you have written one JavaScript function but in that JavaScript function something is going wrong. Now you have to identify the problem how will you identify?  I could not tell what I told was breakpoint, Starting server in debug mode then F5, F6, F7 etc. He told you are telling Java. I am asking how to debug JavaScript. You have written a function it should return either true/false how will you find out it is returning correctly true/false?
·         In JavaScript you have written an equation that equation is running but you don’t know that equation is returning correct value or not how will you identify that.
·         Have you worked on any JavaScript libraries? Like JQuery, DOJO? I told No.
·         Do you know what AJAX is? I told yes AJAX is advancement over JavaScript we use it for auto refreshing of web pages but I have not used.
·         How request processor is done in Struts.
·         How will it go to Action servlet?
·         In web.xml what will you define?
·         To deploy struts what will you write in web.xml?
·         Can you tell me which part of the Action class the business logic will be?
·         Can you tell me the definition of the execute ()? Syntax of execute () what are the signature, return type, input parameters, if it throws exception what exception type it throws?
·         Can you give the structure of Struts-config action tag? What will be inside? What is type generally?
·         How will you validate a form bean?
·         Have you worked in Tiles?
·         Can you describe validate & reset methods?
·         What will validate () returns?
·         Difference between Struts & Spring? What are the differences in the flow of both Struts & Spring?
·         Can you tell the difference get & load method in hibernate?
·         What is the difference between Sorted & ordered Collection in Hibernate?
·         What is lazy loading in hibernate? How it is achieved in Hibernate?
·         What is hibernate session & session factory?
·         Can we have multiple hbm files in Hibernate? How will you manage?
·         Difference between is session object & session lock?
·         Difference between ArrayList & Vector?
·         What is Serialization?
·         Why we need Serialization?
·         Why we use properties file?
·         Can we create objects without using new operator?
·         I have an object & I want to find out is it a String or Integer how can we find out?
String currentObject=12;
Object obj = (Object) currentObject;
If(obj instanceOf Integer){ String.out.println(“this Object is integer.”);
}else if(obj instanceOf String){ String.out.println(“this Object is String.”);
}
·         What are the types of polymorphism Java Supports?


These questions were faced by my friend Sumitav Tripathy (sumitav4job@gmail.com) & contributed to MYJAVACAFE after becoming successful.

No comments:

Post a Comment

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

My Favorite Site's List

#update below script more than 500 posts