Please enable JavaScript.
Coggle requires JavaScript to display documents.
Interview Question for Java Dev by tctqn 24.07.2024 - Coggle Diagram
Interview Question for Java Dev by tctqn 24.07.2024
JAVA CORE
JDK, JRE, JVM
Why Java "write once run everywhere"
How many data type in Java?
How can primitive and object date type store value? Distinguish
What is Enum? When we use?
The purpose of "final" keyword
The purpose of "static" keyword
Can we set private constructor? Why and When?
Distinguish object and class?
Why we declare private attribute/properties and access through getter/setter?
Can we access private attributes, method from outside class? How?
Distinguish setter and constructor?
Distinguish "this" and "super"?
OOP? Explain and give example?
Distinguish "abstract class" and "interface"
How many type of exception?
Distinguish CompileException (Checked) and RuntimeException (Unchecked)
How can we handle exception?
Distinguish "final" and "finally" keyword
Distinguish "String Literal" and "String object"?
Distinguish "StringBuider" and "StringBuffer"?
What is "immutable" and "mutable"?
When we should use StringBuilder?
What is an array?
Distinguish Stack, Queue, DeQueue?
Distinguish Array, LinkedList and ArrayList?
When we should initialize an ArrayList with capacity?
Compare the speed of add, update, delete operater in ArrayList and LinkedList?
What is Set?
Distinguish HashSet, LinkedHashSet, TreeSet?
Distinguish Comparable and Comparator? Case study
What is Map?
Distinguish HashMap, LinkedHashMap, TreeMap?
What is Stream API?
SQL/Database
What is Relationship? How many types of relationships are there?
Các loại Join trong SQL? Phân biệt và cho ví dụ
What is an index? When should you use an index?
What is a transaction? Why do you use transactions?
What is ACID?
Difference between TRUNCATE, DELETE and DROP commands?
What is "group by" and "order by" clause?
What is the difference between "Having" and "Where" clause?
What is a Subquery? Example?
What is a Partition, View? Advantage?
How to find how many duplicated records in a table?
How can we set auto increment value for a column? Some warnings?
What is a primary key, composite key, foreign key?
What is the difference between UNIQUE and PRIMARY KEY constraints?
What is a stored procedure? Advantages and Disadvantages of Stored Procedure?
What is a trigger? When to use?
What is the difference between "Stored procedure" and "Trigger”?
What are user defined functions? What are all types of user defined functions?
What are inserted and deleted tables?
Difference between “LIKE” and “=” operator?
Difference between UNION and UNION ALL?
Full syntax of a "SELECT" statement and their order operation when running a "SELECT" statement
What should we do when face problems about performance while running a select statement?
ORM Framework JPA/Hibernate
What is ORM, and why is it useful in Java applications?
How does ORM differ from traditional JDBC in terms of database interaction?
What are some common issues with using ORM frameworks?
Can you explain the concept of a "Session" or "EntityManager" in an ORM framework?
What are the benefits and drawbacks of using an ORM framework like Hibernate?
What is JPA, and how does it relate to Hibernate?
Describe the life cycle of a JPA entity.
What are the key differences between
Entity,
Table,
and
Embeddable
annotations in JPA?
How does the EntityManager work in JPA?
What are JPQL and Criteria API? How do they differ?
Explain the difference between FetchType.LAZY and FetchType.EAGER in JPA.
What are the different strategies for inheritance mapping in JPA?
How does JPA handle transactions?
What is the
NamedQuery
annotation, and how is it used?
Explain the concept of cascading in JPA. How does it affect related entities?
What is Hibernate, and how does it extend the JPA standard?
How does Hibernate's Session differ from JPA's EntityManager?
What is the difference between get() and load() methods in Hibernate?
How does Hibernate handle caching, and what are the different levels of caching?
What are Hibernate's collection mappings? Can you explain the difference between
OneToMany
and
ManyToMany?
What is the use of the
Formula
annotation in Hibernate?
How does Hibernate manage database schema generation?
Explain the concept of the n+1 select problem in Hibernate. How can it be avoided?
What is the purpose of the HibernateInterceptor?
How does Hibernate handle optimistic and pessimistic locking?
Advanced
What are the pros and cons of using native SQL queries in Hibernate?
How does Hibernate's dirty checking mechanism work?
What is the
BatchSize
annotation, and how can it improve performance?
Explain Hibernate's event system and the types of events that can be intercepted.
How do you configure multi-tenancy in Hibernate?
Can you explain the differences between
Immutable
and
ReadOnly
in Hibernate?
What strategies does Hibernate provide for bulk operations?
How do you handle database migrations when using Hibernate?
How would you implement soft deletes using Hibernate?
What are the differences between
JoinTable
and
JoinColumn
in mapping associations?
JAVA Web
What is a servlet?
Application, Request, Session And Page Scopes in Servlets and Jsps
What are common tasks performed by Servlet Containers?
What is the ServletConfig object?
What is a ServletContext object?
What is the difference between ServletConfig and ServletContext?
What is the difference between PrintWriter and ServletOutputStream?
Can we get PrintWriter and ServletOutputStream both in a servlet?
Do we need to override the service() method?
Is it a good idea to create a servlet constructor?
What is the difference between GenericServlet and HttpServlet?
What are servlet attributes and their scope?
How do we call one servlet from another servlet?
How can we invoke another servlet in a different application?
What is the difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?
Why is the HttpServlet class declared abstract?
What are the phases of servlet life cycle?
What are life cycle methods of a servlet?
why we should override only the no-agrs init() method.
What is URL Encoding?
What are different methods of session management in servlets?
What is URL Rewriting?
How do Cookies work in Servlets?
How to notify an object in session when session is invalidated or timed-out?
What is the difference between encodeRedirectUrl and encodeURL?
Why do we have servlet filters?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
Why do we have servlet listeners?
How to handle exceptions thrown by application with another servlet?
What is a deployment descriptor?
Write a servlet to upload files on the server.
How do we go with database connection and log4j integration in servlet?
What are important features of Servlet 3?
What are different ways for servlet authentication?
What is the Web Filter? Servlet Filter?
What is JSP and why do we need it?
What are the JSP life cycle phases?
What are JSP lifecycle methods?
What is JSP Expression Language and what are its benefits?
What is JSP Standard Tag Library (JSTL), provide some example usage?
What are JSP Directives?
What are JSP actions?
What is the difference between the GET and POST method?
What is the main difference between a Session and Cookie in JSP?
How can you delete session data?
Solid/Design Pattern