0% found this document useful (0 votes)
34 views2 pages

Enterprise Java Interview Questions Guide

Uploaded by

shivam95ku
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views2 pages

Enterprise Java Interview Questions Guide

Uploaded by

shivam95ku
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

ENTERPRISE JAVA QUESTION BANK

1. What is an enterprise application? With the help of a neat diagram explain architecture of
enterprise application.
2. List out the challenges faced while maintaining enterprise application
3. development
4. Write short note on :
(a) JSP
(b) Servlet
(c) JSTL
(d) JSF
(e) Facelet
(f) EJB
(g) JPA
5. What are the different types of system architecture?
6. What are the services that a Java EE application is provided by the
7. container to component?
8. Why do we need dynamic content in web pages?
9. What is cgi? What are its advantages and alternatives to cgi?
10. Why do we need servlets?
11. What servlet can do?
12. Write a short note on [Link] http package
13. With the help of a neat diagram explain servlet api
14. Instead of init() method why we do not use constructor
15. Which are the cases where init() methods can be called in servlets.
16. What is deployment descriptor?
17. With the help of a neat diagram explain servlet lifecycle.
18. What is a cookie?
19. How does a cookie works?
20. What are the different types of cookie?
21. What are the advantages and disadvantages of cookie?
22. List out the constructor that is used in cookies
23. What are the useful methods that are used in cookie?
24. Write the syntax of the following:
(a) How to create a cookie
(b) Delete a cookie
(c) How to get a cookie
25. Name the parameters used in cookies.
26. Http is a stateless protocol means that the protocol cannot remember prior connection and thus
distinguish one visitor from another
(a) Name a protocol that is not stateless
(b) Advantages of stateless protocol
(c) Disadvantages of stateless protocol
27. What is session id?
28. Explain the lifecycle of http session
29. What are the different methods used in session tracking?
30. What is request dispatcher? How to obtain an object implementing request dispatcher
interface?
31. Explain the method used for request dispatcher.
32. What is JSP technology?
33. Why do we use JSP page ?
34. Disadvantage of JSP page
35. Life Cycle of JSP page
36. With the help of neat diagram explain execution of a JSP
37. What are the advantages of JSP document?
38. List out the various directives used in JSP
39. List out the various scripting elements used in JSP
40. What are action elements ? How to include other file in JSP using action element
41. How to forward JSP page to another page?
42. Which are the implicit objects available in a JSP page ?
43. What are the various expression used in JSP?
44. List out the literals that are used in an expression
45. List out the set of implicit object defined by the JSP expression language?
46. What is wrong in using JSP scriptlet tags?
47. What are the disadvantages of JSTL?
48. What are the benefits of EJB ?
49. With the help of neat diagram EJB architecture
50. What are the different types of EJB?
51. Explain the lifecycle of session bean
52. Explain the lifecycle of message driven beans. What are the uses of MDB?
53. Explain the architecture of a JPA
54. How does JPA work?
55. What is ORM ? What is the role of ORM in JPA?

Common questions

Powered by AI

The lifecycle of a session bean in EJB involves states like: Does Not Exist, Ready (pool), and In Use. The container manages this lifecycle, handling instantiation, pooling, state transitions, and destruction automatically. This container-managed lifecycle ensures robustness by managing resources efficiently and provides scalability through pooling techniques, allowing the system to handle many requests with a limited number of beans .

JSPs (JavaServer Pages) play a role in the presentation layer of web applications, allowing developers to write dynamic content using HTML with embedded Java code. Unlike servlets, which are Java classes designed to handle server-side logic, JSPs are more suitable for representing the UI, as they enable an easier division between logic and content. This separation allows developers to iterate on design changes without rewriting server logic, enhancing workflow efficiency .

Cookies work by storing data in key-value pairs on the client’s browser and sending it with each HTTP request to the server. This allows web applications to remember user-specific information between sessions. However, relying solely on cookies poses drawbacks such as potential security risks (e.g., interception in transit), limited storage capacity, and the user’s ability to disable cookies, which can hinder the functionality of session management .

The servlet container provides services such as lifecycle management, security, transaction support, and network services to components like servlets and JSPs. These services are critical as they handle complex, low-level system tasks, allowing developers to focus on business logic and ensuring standardized behavior across the application, which enhances reliability and performance .

Session tracking is crucial for web applications as HTTP is stateless, meaning it doesn't inherently support session information across multiple requests. Java employs several methods for session tracking, including URL rewriting, cookies, and HttpSession objects, allowing developers to store user information and maintain continuity during users' interactions without having to repeatedly authenticate or restart transactions .

The init() method in servlets is preferred over constructors because it is specifically designed for initialization purposes, is called only once, and can throw ServletException, allowing the container to handle initialization exceptions. This ensures servlet configuration is fully complete before being accessible by client requests, as constructors don't guarantee this environment setup .

Enterprise application maintenance often faces challenges such as scalability issues, integration with legacy systems, security vulnerabilities, and frequent updates needed to meet changing business requirements. These challenges can affect the application's overall functionality by potentially introducing bugs during upgrades or integrations and impact its flexibility by necessitating complex refactoring or redesigns to incorporate new processes or technologies .

JSTL (JavaServer Pages Standard Tag Library) can improve maintainability by reducing Java code in JSPs, making the pages clear and easier to manage. It provides standard tags for common tasks, promoting code reuse and reducing the risk of errors. However, it has limitations such as less flexibility compared to custom tags or scriptlets for complex operations, emphasizing the need for careful consideration when using JSTL to ensure maintainability without sacrificing functionality .

JPA (Java Persistence API) facilitates database interactions by providing a standard API for managing relational data in Java applications. It abstracts the database layer, enabling developers to manipulate data without writing SQL directly. ORM (Object-Relational Mapping) is integral to JPA, as it maps Java objects to database tables, automating the persistence process and reducing boilerplate code, thus streamlining data interactions and increasing productivity .

Servlets offer several advantages over CGI scripts, including better performance due to persistent processes, greater scalability with better resource management, and full access to Java APIs which provides enhanced functionality and portability. Unlike CGI, which starts a new process for each request, servlets run in a single process, reducing overhead and allowing for more efficient handling of requests .

You might also like