permaculture playing cards*
The moose likes Jobs Discussion and the fly likes some java interview Questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Careers » Jobs Discussion
Reply locked New topic
Author

some java interview Questions

Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
well we seem to be creating a issue out of something small.
what if we rename the topic to "java faqs".
that way everyones happy.
also this will be useful to a lot of people who post on javaranch.
Espicially for people who make it a point to try to answer each and every post.
Time can be saved by just redirecting the user to this page so that he can look up the answer for himself and at the same time go through several other questions which might help him in the future..
dont you think its useful in that sense?
well i do.


Life called,so here I am.<br />Cheers<br />Niki.:-)
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 230

I am surprised to see the thread move to top again. I see that various people think that it is wrong to go with such question-answer routines. I would say that when I started answering these questions, the aim was - let me see how well I could answer these, and expected somebody to quip; hey, you replied that wrong, here is the right answer. In short, a healthy discussion, which is what Javaranch is all about.

I hope that all real-world programmers understand that rote learning can never help in their task or getting a job. It would be puerile to say that anyone could mug up the questions and pass an interview, if he does, it could be some imprudent interviewer asking the questions in the same order and perhaps tallying answers with these answers.

These questions and answers are guides. If these are unethical I am prompted to ask - is it unethical to study a guide and appear for a certification exam, many of these guides (say HFS) claim to be "too close to the exam" and from the authors "who created the exam". Am I cheating if I use the Guides and Mock exam to get my SCWCD? And what about the people who pass the Sun Certification exams but have no work experience at all? Theirs might be a case of cramming.

Overall, these questions answers should ideally let a person gauge him/herself, discuss with others and hone his knowledge by exploring more. For the enlightened, it may serve as a refresher.

Best,


Debashish
SCJP2, SCWCD 1.4, PMP, ITIL Foundation
Chaitanya Puchakayala
Greenhorn

Joined: May 28, 2005
Posts: 1
Regarding 'Java does not provide mulitple inheritance', though it does n't provide directly, but we can use interfaces to implement mulitple inheritance
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1304
Here are some more questions
Explain the following OO concepts:

Inheritance

Encapsulation

Abstraction

Polymorphism

Interfaces


What is the difference between overloading and overriding?



The applicant should be able to answer these questions.

Briefly explain the role of the JVM.



What is the difference between code declared as static and non-static code?



What is a thread?



J2EE Concepts

The applicant should have a basic level of understanding of these concepts and should be able to answer most of these questions.

What is the difference between a Session bean and an Entity bean?



Describe the contract of a JavaBean?



Design Patterns

The applicant should at least be familiar with the concept of design patterns and at least define the Singleton pattern. The applicant may not know the J2EE patterns but it would be very handy.

Explain the following design patterns:

Singleton

Facade

Proxy

Factory



Explain the following J2EE Design Patterns:

MVC

Value Object/Data Transfer Object



Project Skills

Given a task that needs to be delivered on an undeliverable time frame, what actions, if any, would you take to complete the task?





Can you tell us about a situation where you added value?

Describe how you have worked to support a team member recently:

How have you expanded your knowledge or technical understanding recently?

Upon applying this knowledge or training, what were the results?

Were the results as expected and would you change anything in future?

What motivates you in your career and what are your goals in the next 12 Months?

What is your preferred style of management, what works best for you?

How do you signal when you are finding it difficult to achieve results?

What areas do you consider yourself to excel in?

What areas do you need further training in?

What is your vision for the future of the ICT industry?


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
This is cool: J2EE Interview. I wonder what he means by "build" ... sit down & code or just whiteboard something.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
115. Topic JSP: What is the difference between a static include and dynamic include?

116. Topic Java: What is the maximum size of a method? How can it affect the size of a jsp page?

117. Topic General: What is memory leak? What can a java programmer do to prevent it?

118. Topic Performance: What can you do to improve the performence of our application?

119. Topic servlet: When you submit a form by means of a get method (not post) how are the parameters transmitted to server?

120. Topic servlet: What are the advantages and disadvantages of using post versus get method to submit forms?

121. Topic Performance: What are immutable objects? How can it impact performance?

122. Topic General: The screen by which you login is a small screen. Do you see any consistency for this screen through out the IT industry? Who is providing this screen? What can the programmer do to display this screen?

123. Topic Javascript: What are the advantages and disadvantages of doing client side validation vs server side validation?

124. Topic General: Explain the difference between Architecture abd Design?

125. Topic Design: What is the industry standard for modelling a system?

126. Topic java: The overriding methods can be more public than overridden methods. Why can't it be more private?

127. Topic jSP: How can you declare (not call) methods in a jsp page?
[ December 09, 2005: Message edited by: jiju ka ]
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
I've never seen a thread with actual discussion spanning four years.
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1304
Inheritance is the ability to derive something specific from something generic, like a bank account is very general, but a saving account is specific and it is also a bank account, the bank account can be considered a super class and the saving account a subclass, the subclass inherits variable declarations and methods from the super class, however, subclasses are not limited to the state and behaviors provided to them by their super class. Subclasses can add variables and methods to the ones they inherit from the super class, also can override inherited methods and specialized implementation for those methods. Subclasses provide specialized behaviors from the basis of common elements provided by the super class. Through inheritance, the code in the super class can be reused many times.


Encapsulation can hide implementation from clients; the clients depend on the interface. Eliminates the direct dependencies on the implementation, thus it is possible to change the implementation without updating the clients as long as the interface is unchanged. Clients will not be affected by changes in implementation, therefor improves resiliency.
Abstraction manages complexity by concentrating on the essential characteristics of an entity that distinguish it from all other kind of entities
Polymorphism is the ability to hide many different implementations behind a single interface. Every implementation of the interface must at least implement the interface.
An interface is a collection of operations that are used to specify a service of a class or a component. It is not abstract class and formalizes polymorphism.


What is the difference between overloading and overriding?
If two or more methods of a class (whether both declared in the same class, or both inherited by a class, or one declared and one inherited) have the same name but different signatures, then the method name is said to be overloaded. When a class defines a method with same method name, argument types, argument order and return type as a method in its super class, it is overriding. Overloaded methods supplement each other while an overriding method replaces the method it overrides; the return type may be different for overloaded methods but must be the same for overridden methods
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1304
Briefly explain the role of the JVM.
The compiled .java file which contains Java codes becomes the file has the extension .class and contains bytecode generated by the Java compiler, the JVM understands the bytecode and not the Java program in its textual form, so it can execute the .class file. JVM also acts as a memory manager, it uses garbage collection to free memory occupied by unused objects.
What is the difference between code declared as static and non-static code?
A static variable will be shared among many instances of the class that declared it; there will be only one instance of that variable accessed by multiple instances of the class.
Non static variables will be created at one instance of class is created, each instance of a class will have its on variable, so there will be many same variables one per the class that declared it.
What is a thread?
A thread is not a program; it can not run on its own except within a program. So it is a single sequential flow of control within a program. A thread is involved in a program that has a beginning, an execution sequence and an end.
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
128. Topic Java: Can a class x.class (in package p) be loaded more than once in a jvm? If yes how?
[ December 16, 2005: Message edited by: jiju ka ]
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
129. Topic Java: What is reflection? What difference is there between code written in plain java and those using reflection? Why is reflection needed?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Describe any one or two from each grouping and how they have influenced your recent designs:


Study up here.
[ December 17, 2005: Message edited by: Stan James ]
Hemant Agarwal
Ranch Hand

Joined: Nov 21, 2005
Posts: 138

Dhiren Joshi
Ranch Hand

Joined: Dec 09, 2003
Posts: 463
Just to answer some who asked if such questions are asked in interview. ...
U WONT BELEIVE IT ... Yes and I didnt beleive in any of them and failed one interview process just becuase of a pile of subjective question I had to answer on XML ,XSL,XSLT, Java ,Swing ,JSP and DB all in one taking in half hour sitting.

I have a solid 8 years of Java with SCEA Web service certified too. But that subjective was something like u needed to be prepared to sit for an exam and I didnt believe in such questions until I hit them in my interview process .. so believe me these questions are worth IT for senior Java positions ALSO !!! ... I know I have been bitten once .
Vasu Reddy
Ranch Hand

Joined: Sep 13, 2005
Posts: 32


gr8
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
"Java is platform independent (Stroustrup may differ by saying "Java is a platform" )"

C++ is platform independant also. Stick with standard C++, and maybe add in some 3rd party platform idenpendant libraries, and all you need to do is recompile on different platforms.


"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780


c%l


There is no emoticon for what I am feeling!
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
try this: Java/J2EE Job Interview Questions


java j2ee job interview questions with answers | Learn the core concepts and the key areas
Dilip Tripathi
Greenhorn

Joined: Jun 21, 2006
Posts: 2
Originally posted by sunil choudhary:
I thank Roshita for the collection...

Please try to answer these Questions for the benefit of all and put em up in a proper place on the net for all
I will be contributing my 2 paisa As soon as I get some time .


Regards
Sunil

1. What is the difference between an Abstract class and Interface ?
2. What is user defined exception ?
3. What do you know about the garbage collector ?
4. What is the difference between C++ & Java ?
5. Explain RMI Architecture?
6. How do you communicate in between Applets & Servlets ?
7. What is the use of Servlets ?
8. What is JDBC? How do you connect to the Database ?
9. In an HTML form I have a Button which makes us to open another page in 15 seconds. How will do you that ?
10. What is the difference between Process and Threads ?
11. What is the difference between RMI & Corba ?
12. What are the services in RMI ?
13. How will you initialize an Applet ?
14. What is the order of method invocation in an Applet ?
15. When is update method called ?
16. How will you pass values from HTML page to the Servlet ?
17. Have you ever used HashTable and Dictionary ?
18. How will you communicate between two Applets ?
19. What are statements in JAVA ?
20. What is JAR file ?
21. What is JNI ?
22. What is the base class for all swing components ?
23. What is JFC ?
24. What is Difference between AWT and Swing ?
25. Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times? Where 3 processes are started or 3 threads are started ?
26. How does thread synchronization occurs inside a monitor ?
27. How will you call an Applet using a Java Script function ?
28. Is there any tag in HTML to upload and download files ?
Ans: steps to load file in html is :
<Form name="uploadFrm" action="http://localhost:8080/myserver/uploadServlet" >
<input name="fileLoader" type="file">
<input type="submit">
</Form>

and then you have to create one servlet which will read the data from this file.
servlet gets the complete data of file along with its absolute path in the request data. for more information see Java servlet programming by jason hunter oreilly: http://www.mamiyami.com/document/oreilly/books/javaenterprise/servlet/ch04_04.htm
regards,
Dilip

29. Why do you Canvas ?
30. How can you push data from an Applet to Servlet ?
31. What are 4 drivers available in JDBC ?
32. How you can know about drivers and database information ?
33. If you are truncated using JDBC, How can you know ..that how much data is truncated ?
34. And What situation , each of the 4 drivers used ?
35. How will you perform transaction using JDBC ?
36. In RMI, server object first loaded into the memory and then the stub reference is sent to the client ? or whether a stub reference is directly sent to the client ?
37. Suppose server object is not loaded into the memory, and the client request for it , what will happen?
38. What is serialization ?
39. Can you load the server object dynamically? If so, what are the major 3 steps involved in it ?
40. What is difference RMI registry and OSAgent ?
41. To a server method, the client wants to send a value 20, with this value exceeds to 20,. a message should be sent to the client ? What will you do for achieving for this ?
42. What are the benefits of Swing over AWT ?
43. Where the CardLayout is used ?
44. What is the Layout for ToolBar ?
45. What is the difference between Grid and GridbagLayout ?
46. How will you add panel to a Frame ?
47. What is the corresponding Layout for Card in Swing ?
48. What is light weight component ?
49. Can you run the product development on all operating systems ?
50. What is the webserver used for running the Servlets ?
51. What is Servlet API used for connecting database ?
52. What is bean ? Where it can be used ?
53. What is difference in between Java Class and Bean ?
54. Can we send object using Sockets ?
55. What is the RMI and Socket ?
56. How to communicate 2 threads each other ?
57. What are the files generated after using IDL to Java Compilet ?
58. What is the protocol used by server and client ?
59. Can I modify an object in CORBA ?
60. What is the functionality stubs and skeletons ?
61. What is the mapping mechanism used by Java to identify IDL language ?
62. Diff between Application and Applet ?
63. What is serializable Interface ?
64. What is the difference between CGI and Servlet ?
65. What is the use of Interface ?
66. Why Java is not fully objective oriented ?
67. Why does not support multiple Inheritance ?
68. What it the root class for all Java classes ?
69. What is polymorphism ?
70. Suppose If we have variable ' I ' in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared ?
71. In servlets, we are having a web page that is invoking servlets username and password ? which is checked in the database ? Suppose the second page also If we want to verify the same information whether it will connect to the database or it will be used previous information?
72. What are virtual functions ?
73. Write down how will you create a binary Tree ?
74. What are the traverses in Binary Tree ?
75. Write a program for recursive Traverse ?
76. What are session variable in Servlets ?
77. What is client server computing ?
78. What is Constructor and Virtual function? Can we call Virtual function in a constructor ?
79. Why we use OOPS concepts? What is its advantage ?
80. What is the middleware ? What is the functionality of Webserver ?
81. Why Java is not 100 % pure OOPS ? ( EcomServer )
82. When we will use an Interface and Abstract class ?
83. What is an RMI?
84. How will you pass parameters in RMI ? Why u serialize?
85. What is the exact difference in between Unicast and Multicast object ? Where we will use ?
86. What is the main functionality of the Remote Reference Layer ?
87. How do you download stubs from a Remote place ?
88. What is the difference in between C++ and Java ? can u explain in detail ?
89. I want to store more than 10 objects in a remote server ? Which methodology will follow ?
90. What is the main functionality of the Prepared Statement ?
91. What is meant by static query and dynamic query ?
92. What are the Normalization Rules ? Define the Normalization ?
93. What is meant by Servlet? What are the parameters of the service method ?
94. What is meant by Session ? Tell me something about HTTPSession Class ?
95. How do you invoke a Servlet? What is the difference in between doPost and doGet methods ?
96. What is the difference in between the HTTPServlet and Generic Servlet ? Explain their methods ? Tell me their parameter names also ?
97. Have you used threads in Servlet ?
98. Write a program on RMI and JDBC using StoredProcedure ?
99. How do you sing an Applet ?
100. In a Container there are 5 components. I want to display the all the components names, how will you do that one ?
101. Why there are some null interface in java ? What does it mean ? Give me some null interfaces in JAVA ?
102. Tell me the latest versions in JAVA related areas ?
103. What is meant by class loader ? How many types are there? When will we use them ?
104. How do you load an Image in a Servlet ?
105. What is meant by flickering ?
106. What is meant by distributed Application ? Why we are using that in our applications ?
107. What is the functionality of the stub ?
108. Have you used any version control ?
109. What is the latest version of JDBC ? What are the new features are added in that ?
110. Explain 2 tier and 3 -tier Architecture ?
111. What is the role of the webserver ?
112. How have you done validation of the fields in your project ?
113. What is the main difficulties that you are faced in your project ?
114. What is meant by cookies ? Explain ?

[ February 02, 2003: Message edited by: Marilyn de Queiroz ]
Dilip Tripathi
Greenhorn

Joined: Jun 21, 2006
Posts: 2
Originally posted by sunil choudhary:
I thank Roshita for the collection...

Please try to answer these Questions for the benefit of all and put em up in a proper place on the net for all
I will be contributing my 2 paisa As soon as I get some time .


Regards
Sunil

1. What is the difference between an Abstract class and Interface ?
2. What is user defined exception ?
3. What do you know about the garbage collector ?
4. What is the difference between C++ & Java ?
5. Explain RMI Architecture?
6. How do you communicate in between Applets & Servlets ?
7. What is the use of Servlets ?
8. What is JDBC? How do you connect to the Database ?
9. In an HTML form I have a Button which makes us to open another page in 15 seconds. How will do you that ?
10. What is the difference between Process and Threads ?
11. What is the difference between RMI & Corba ?
12. What are the services in RMI ?
13. How will you initialize an Applet ?
14. What is the order of method invocation in an Applet ?
15. When is update method called ?
16. How will you pass values from HTML page to the Servlet ?
17. Have you ever used HashTable and Dictionary ?
18. How will you communicate between two Applets ?
19. What are statements in JAVA ?
20. What is JAR file ?
21. What is JNI ?
22. What is the base class for all swing components ?
23. What is JFC ?
24. What is Difference between AWT and Swing ?
25. Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times? Where 3 processes are started or 3 threads are started ?
26. How does thread synchronization occurs inside a monitor ?
27. How will you call an Applet using a Java Script function ?
28. Is there any tag in HTML to upload and download files ?
29. Why do you Canvas ?
30. How can you push data from an Applet to Servlet ?
31. What are 4 drivers available in JDBC ?
32. How you can know about drivers and database information ?
33. If you are truncated using JDBC, How can you know ..that how much data is truncated ?
34. And What situation , each of the 4 drivers used ?
35. How will you perform transaction using JDBC ?
36. In RMI, server object first loaded into the memory and then the stub reference is sent to the client ? or whether a stub reference is directly sent to the client ?
37. Suppose server object is not loaded into the memory, and the client request for it , what will happen?
Error 404 : Object not found error will be thrown
38. What is serialization ?
39. Can you load the server object dynamically? If so, what are the major 3 steps involved in it ?
40. What is difference RMI registry and OSAgent ?
41. To a server method, the client wants to send a value 20, with this value exceeds to 20,. a message should be sent to the client ? What will you do for achieving for this ?
42. What are the benefits of Swing over AWT ?
43. Where the CardLayout is used ?
44. What is the Layout for ToolBar ?
45. What is the difference between Grid and GridbagLayout ?
46. How will you add panel to a Frame ?
47. What is the corresponding Layout for Card in Swing ?
48. What is light weight component ?
49. Can you run the product development on all operating systems ?
50. What is the webserver used for running the Servlets ?
51. What is Servlet API used for connecting database ?
52. What is bean ? Where it can be used ?
53. What is difference in between Java Class and Bean ?
54. Can we send object using Sockets ?
55. What is the RMI and Socket ?
56. How to communicate 2 threads each other ?
57. What are the files generated after using IDL to Java Compilet ?
58. What is the protocol used by server and client ?
59. Can I modify an object in CORBA ?
60. What is the functionality stubs and skeletons ?
61. What is the mapping mechanism used by Java to identify IDL language ?
62. Diff between Application and Applet ?
63. What is serializable Interface ?
64. What is the difference between CGI and Servlet ?
65. What is the use of Interface ?
66. Why Java is not fully objective oriented ?
67. Why does not support multiple Inheritance ?
68. What it the root class for all Java classes ?
69. What is polymorphism ?
70. Suppose If we have variable ' I ' in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared ?
71. In servlets, we are having a web page that is invoking servlets username and password ? which is checked in the database ? Suppose the second page also If we want to verify the same information whether it will connect to the database or it will be used previous information?
72. What are virtual functions ?
73. Write down how will you create a binary Tree ?
74. What are the traverses in Binary Tree ?
75. Write a program for recursive Traverse ?
76. What are session variable in Servlets ?
77. What is client server computing ?
78. What is Constructor and Virtual function? Can we call Virtual function in a constructor ?
79. Why we use OOPS concepts? What is its advantage ?
80. What is the middleware ? What is the functionality of Webserver ?
81. Why Java is not 100 % pure OOPS ? ( EcomServer )
82. When we will use an Interface and Abstract class ?
83. What is an RMI?
84. How will you pass parameters in RMI ? Why u serialize?
85. What is the exact difference in between Unicast and Multicast object ? Where we will use ?
86. What is the main functionality of the Remote Reference Layer ?
87. How do you download stubs from a Remote place ?
88. What is the difference in between C++ and Java ? can u explain in detail ?
89. I want to store more than 10 objects in a remote server ? Which methodology will follow ?
90. What is the main functionality of the Prepared Statement ?
91. What is meant by static query and dynamic query ?
92. What are the Normalization Rules ? Define the Normalization ?
93. What is meant by Servlet? What are the parameters of the service method ?
94. What is meant by Session ? Tell me something about HTTPSession Class ?
95. How do you invoke a Servlet? What is the difference in between doPost and doGet methods ?
96. What is the difference in between the HTTPServlet and Generic Servlet ? Explain their methods ? Tell me their parameter names also ?
97. Have you used threads in Servlet ?
98. Write a program on RMI and JDBC using StoredProcedure ?
99. How do you sing an Applet ?
100. In a Container there are 5 components. I want to display the all the components names, how will you do that one ?
101. Why there are some null interface in java ? What does it mean ? Give me some null interfaces in JAVA ?
102. Tell me the latest versions in JAVA related areas ?
103. What is meant by class loader ? How many types are there? When will we use them ?
104. How do you load an Image in a Servlet ?
105. What is meant by flickering ?
106. What is meant by distributed Application ? Why we are using that in our applications ?
107. What is the functionality of the stub ?
108. Have you used any version control ?
109. What is the latest version of JDBC ? What are the new features are added in that ?
110. Explain 2 tier and 3 -tier Architecture ?
111. What is the role of the webserver ?
112. How have you done validation of the fields in your project ?
113. What is the main difficulties that you are faced in your project ?
114. What is meant by cookies ? Explain ?

[ February 02, 2003: Message edited by: Marilyn de Queiroz ]
Shinde Anand
Greenhorn

Joined: Jan 23, 2007
Posts: 3
You can try <a href="http://www.java-interview.com">http://www.java-interview.com</a> as well, since it has detailed answers as well
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

I'm going to close this intensely annoying thread so it will not attract any more posts. Please don't try to start another, because I will just delete it.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: some java interview Questions