0% found this document useful (0 votes)
5 views

Full stack with angular

The document contains a comprehensive list of 150 questions covering various topics in Java, including basic Java concepts, data structures, servlets, JSP, Spring Framework, Spring MVC, JPA, and Spring Boot. Each section consists of 50 questions designed to test knowledge and understanding of the respective topics. This resource serves as a study guide for individuals preparing for Java-related interviews or assessments.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Full stack with angular

The document contains a comprehensive list of 150 questions covering various topics in Java, including basic Java concepts, data structures, servlets, JSP, Spring Framework, Spring MVC, JPA, and Spring Boot. Each section consists of 50 questions designed to test knowledge and understanding of the respective topics. This resource serves as a study guide for individuals preparing for Java-related interviews or assessments.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Basic Java (50 Questions)

1. What is the default value of an int variable in Java?

2. What is the difference between == and equals() in Java?

3. What is a constructor in Java?

4. Explain the concept of method overloading.

5. What is the purpose of the final keyword in Java?

6. How do you create a thread in Java?

7. What is the difference between ArrayList and LinkedList?

8. What is the purpose of the static keyword?

9. Explain the concept of inheritance.

10. What is an interface in Java?

11. What is the difference between an abstract class and an interface?

12. How do you handle exceptions in Java?

13. What is the purpose of the try-catch block?

14. What is a package in Java?

15. How do you import a package in Java?

16. What is the Java Virtual Machine (JVM)?

17. What is the difference between JDK and JRE?

18. What is a Java Bean?

19. Explain the concept of polymorphism.

20. What is the purpose of the this keyword?

21. What is a lambda expression?

22. What is the difference between String, StringBuilder, and StringBuffer?

23. How do you read input from the console in Java?

24. What is the purpose of the main method?

25. What is a nested class?

26. What is the difference between throw and throws?

27. What is a Java Enum?

28. How do you create a custom exception in Java?

29. What is the purpose of the synchronized keyword?

30. What is garbage collection in Java?


31. What is the instanceof operator?

32. How do you create an array in Java?

33. What is the difference between a shallow copy and a deep copy?

34. What is the purpose of the volatile keyword?

35. What is a transient variable?

36. How do you implement a singleton pattern in Java?

37. What is the purpose of the super keyword?

38. What is a default method in an interface?

39. What is the difference between a constructor and a method?

40. How do you sort an array in Java?

41. What is the purpose of the break statement?

42. What is the difference between String and StringBuilder?

43. How do you convert a string to an integer in Java?

44. What is the purpose of the instanceof operator?

45. What is a functional interface?

46. How do you create a multi-dimensional array in Java?

47. What is the purpose of the assert keyword?

48. What is the difference between public, protected, and private access modifiers?

49. How do you implement an interface in a class?

50. What is the purpose of the main method in a Java application?

1. What is a data structure?

2. What is the difference between an array and a linked list?

3. Explain the concept of a stack.

4. What are the main operations of a queue?

5. What is a binary tree?

6. What is a binary search tree?

7. Explain the concept of a hash table.

8. What is a graph?
9. What is the difference between depth-first search (DFS) and breadth-first search (BFS)?

10. What is a priority queue?

11. What is a circular linked list?

12. How do you implement a stack using an array?

13. How do you implement a queue using two stacks?

14. What is a doubly linked list?

15. What is the time complexity of accessing an element in an array?

16. What is the time complexity of inserting an element in a linked list?

17. What is a heap?

18. What is the difference between a min-heap and a max-heap?

19. Explain the concept of dynamic programming.

20. What is a trie?

21. What is the purpose of a sentinel node in a linked list?

22. How do you reverse a linked list?

23. What is the time complexity of searching in a binary search tree?

24. What is a balanced tree?

25. What is the purpose of a red-black tree?

26. What is a graph traversal?

27. What is the difference between a directed and an undirected graph?

28. What is a weighted graph?

29. How do you detect a cycle in a graph?

30. What is the purpose of a stack in recursion?

31. What is a disjoint set

32. How do you implement a queue using a linked list?


33. What is the time complexity of inserting an element in a binary search tree?
34. What is a segment tree?
35. What is a sparse matrix?
36. How do you perform a level order traversal of a binary tree?
37. What is the purpose of a stack in expression evaluation?
38. What is a Fibonacci heap?
39. How do you merge two sorted linked lists?
40. What is the time complexity of quicksort?
41. What is the time complexity of mergesort?
42. What is a bloom filter?
43. How do you find the middle element of a linked list?
44. What is a hash collision, and how can it be resolved?
45. What is the difference between a linear search and a binary search?
46. How do you implement a depth-first search (DFS) for a graph?
47. What is a K-D tree?
48. What is the purpose of a skip list?
49. How do you find the longest common subsequence in two strings?
50. What is the time complexity of inserting an element in a hash table?

1. What is a servlet in Java?

2. Explain the lifecycle of a servlet.

3. What is the difference between doGet() and doPost() methods?

4. How do you handle form data in a servlet?

5. What is the purpose of the web.xml file?

6. How do you create a session in a servlet?

7. What is the role of the HttpServletRequest and HttpServletResponse objects?

8. How do you redirect a request from one servlet to another?

9. What is the purpose of the init() method in a servlet?

10. How do you handle exceptions in a servlet?

1. What is JSP (JavaServer Pages)?

2. How do you create a JSP page?

3. What is the difference between JSP and Servlets?

4. What are JSP directives?

5. How do you include a file in a JSP page?

6. What is the purpose of the <%@ page %> directive?

7. How do you access request parameters in JSP?

8. What is an expression language (EL) in JSP?


9. How do you handle exceptions in JSP?

10. What is the purpose of the <jsp:include> tag?

1. What is the Spring Framework?

2. Explain the concept of Inversion of Control (IoC).

3. What is Dependency Injection (DI)?

4. What are the different types of Dependency Injection?

5. What is a Spring Bean?

6. How do you configure a Spring Bean using XML?

7. What is the purpose of the @Component annotation?

8. What is the difference between @Autowired and @Inject?

9. What is the Spring Application Context?

10. How do you create a singleton bean in Spring?

11. What is the purpose of the @Configuration annotation?

12. What is Aspect-Oriented Programming (AOP)?

13. How do you define an aspect in Spring?

14. What is a pointcut in Spring AOP?

15. What is the purpose of the @Transactional annotation?

16. How do you handle exceptions in Spring?

17. What is the Spring MVC framework?

18. What is the purpose of the @Controller annotation?

19. How do you map a request to a method in a controller?

20. What is the role of the ModelAndView object?

21. How do you handle form submissions in Spring MVC?

22. What is the purpose of the @RequestMapping annotation?

23. How do you implement validation in Spring MVC?

24. What is the difference between @RequestParam and @PathVariable?

25. What is the purpose of the @ResponseBody annotation?

26. How do you configure Spring Security?

27. What is the purpose of the @Service annotation?


28. What is the difference between @Repository and @Service?

29. How do you integrate Spring with Hibernate?

30. What is the purpose of the @Value annotation?

31. How do you create a RESTful web service using Spring?

32. What is the purpose of the @RestController annotation?

33. How do you handle CORS in Spring?

34. What is the purpose of the @Bean annotation?

35. How do you define a prototype bean in Spring?

36. What is the Spring Boot framework?

37. How do you create a Spring Boot application?

38. What is

You

please continue with response

BLACKBOXAI

Certainly! Here’s the continuation of the questions for Spring, Spring MVC, JPA, and Spring Boot.

Spring (continued)

38. What is the purpose of the @SpringBootApplication annotation?

39. How do you configure properties in a Spring Boot application?

40. What is the Spring Boot Starter?

41. How do you create a REST API using Spring Boot?

42. What is the purpose of the application.properties file?

43. How do you enable Spring Boot Actuator?

44. What is the difference between @ComponentScan and @EnableAutoConfiguration?

45. How do you handle exceptions globally in Spring Boot?

46. What is the purpose of the @Scheduled annotation?

47. How do you implement caching in Spring?

48. What is the role of Spring Boot DevTools?

49. How do you create a custom starter in Spring Boot?


50. What is the purpose of the @Conditional annotation?

Spring MVC (50 Questions)

1. What is Spring MVC?

2. Explain the Model-View-Controller (MVC) design pattern.

3. What is the role of the DispatcherServlet in Spring MVC?

4. How do you configure Spring MVC in a web application?

5. What is the purpose of the @Controller annotation?

6. How do you handle form submissions in Spring MVC?

7. What is the purpose of the @RequestMapping annotation?

8. How do you return a view from a controller method?

9. What is the role of the Model in Spring MVC?

10. How do you pass data from the controller to the view?

11. What is the purpose of the @ResponseBody annotation?

12. How do you handle exceptions in Spring MVC?

13. What is the difference between @RequestParam and @PathVariable?

14. How do you implement validation in Spring MVC?

15. What is the purpose of the @InitBinder annotation?

16. How do you configure view resolvers in Spring MVC?

17. What is the role of the @SessionAttributes annotation?

18. How do you implement file upload in Spring MVC?

19. What is the purpose of the @ModelAttribute annotation?

20. How do you create a RESTful web service using Spring MVC?

21. What is the difference between GET and POST requests in Spring MVC?

22. How do you handle CORS in Spring MVC?

23. What is the purpose of the @ResponseStatus annotation?

24. How do you implement pagination in Spring MVC?

25. What is the role of the @RequestBody annotation?

26. How do you configure Spring Security in a Spring MVC application?

27. What is the purpose of the @CrossOrigin annotation?

28. How do you implement internationalization (i18n) in Spring MVC?

29. What is the role of the @ControllerAdvice annotation?


30. How do you create custom error pages in Spring MVC?

31. What is the purpose of the @RequestMapping method-level annotation?

32. How do you implement a custom interceptor in Spring MVC?

33. What is the role of the @PathVariable annotation?

34. How do you use Thymeleaf with Spring MVC?

35. What is the purpose of the @CookieValue annotation?

36. How do you implement a custom view resolver in Spring MVC?

37. What is the role of the @ResponseEntity class?

38. How do you implement AJAX in Spring MVC?

39. What is the purpose of the @RequestHeader annotation?

40. How do you configure multiple view resolvers in Spring MVC?

41. What is the role of the @SessionScope annotation?

42. How do you implement a custom error handler in Spring MVC?

43. What is the purpose of the @RequestMapping class-level annotation?

44. How do you implement a RESTful API versioning strategy in Spring MVC?

45. What is the role of the @RequestMethod enumeration?

46. How do you implement a custom message converter in Spring MVC?

47. What is the purpose of the @ResponseBody annotation in a REST controller?

48. How do you implement a custom authentication filter in Spring MVC?

49. What is the role of the @EnableWebMvc annotation?

50. How do you implement a custom exception handler in Spring MVC?

JPA (50 Questions)

1. What is JPA (Java Persistence API)?

2. What is the purpose of the @Entity annotation?

3. How do you define a primary key in JPA?

4. What is the role of the EntityManager in JPA?

5. What is the purpose of the @Table annotation?

6. How do you create a one-to-many relationship in JPA?

7. What is the difference between @OneToMany


8. What is the difference between @OneToMany and @ManyToOne relationships?

9. How do you create a many-to-many relationship in JPA?

10. What is the purpose of the @JoinColumn annotation?

11. How do you define a composite primary key in JPA?

12. What is the role of the @GeneratedValue annotation?

13. How do you perform CRUD operations using JPA?

14. What is JPQL (Java Persistence Query Language)?

15. How do you create a query using the @Query annotation?

16. What is the purpose of the @Transactional annotation in JPA?

17. How do you handle transactions in JPA?

18. What is the difference between the EntityManager and EntityManagerFactory?

19. How do you implement pagination in JPA?

20. What is the purpose of the @Embeddable annotation?

21. How do you use the Criteria API in JPA?

22. What is the purpose of the @Version annotation?

23. How do you implement optimistic locking in JPA?

24. What is the difference between merge() and persist() methods in JPA?

25. How do you define a named query in JPA?

26. What is the purpose of the @NamedQuery annotation?

27. How do you implement caching in JPA?

28. What is the role of the @EntityListeners annotation?

29. How do you handle relationships with cascading operations in JPA?

30. What is the purpose of the @Transient annotation?

31. How do you implement a custom repository in JPA?

32. What is the difference between flush() and clear() methods in JPA?

33. How do you use the EntityGraph in JPA?

34. What is the purpose of the @TableGenerator annotation?

35. How do you implement batch processing in JPA?

36. What is the role of the @MappedSuperclass annotation?

37. How do you define a secondary table in JPA?

38. What is the purpose of the @DiscriminatorColumn annotation?


39. How do you implement inheritance in JPA?

40. What is the difference between @Inheritance(strategy =


InheritanceType.SINGLE_TABLE) and @Inheritance(strategy = InheritanceType.JOINED)?

41. How do you handle exceptions in JPA?

42. What is the purpose of the @Column annotation?

43. How do you define a unique constraint in JPA?

44. What is the role of the @Fetch annotation?

45. How do you implement a custom converter in JPA?

46. What is the purpose of the @Access annotation?

47. How do you use the EntityManager to execute native SQL queries?

48. What is the difference between @OneToOne and @ManyToOne relationships?

49. How do you implement auditing in JPA?

50. What is the purpose of the @QueryHint annotation?

Spring Boot (50 Questions)

1. What is Spring Boot?

2. What are the advantages of using Spring Boot?

3. How do you create a Spring Boot application?

4. What is the purpose of the @SpringBootApplication annotation?

5. How do you configure properties in a Spring Boot application?

6. What is the role of the application.properties file?

7. How do you create a REST API using Spring Boot?

8. What is the purpose of Spring Boot Starter?

9. How do you enable Spring Boot Actuator?

10. What is the difference between @ComponentScan and @EnableAutoConfiguration?

11. How do you handle exceptions globally in Spring Boot?

12. What is the purpose of the @RestController annotation?

13. How do you implement caching in Spring Boot?

14. What is the role of Spring Boot DevTools?

15. How do you create a custom starter in Spring Boot?

16. What is the purpose of the @Value annotation?

17. How do you configure a database connection in Spring Boot?


18. What is the role of the spring-boot-starter-data-jpa dependency?

19. How do you implement Spring Security in a Spring Boot application?

20. What is the purpose of the @Configuration annotation?

21. How do you create a scheduled task in Spring Boot?

22. What is the role of the @EnableScheduling annotation?

23. How do you implement file upload in Spring Boot?

24. What is the purpose of the @CrossOrigin annotation?

25. How do you create a custom error response in Spring Boot?

26. What is the role of the @Component annotation

You

please continue with response

BLACKBOXAI

Certainly! Here’s the continuation of the questions for Spring Boot.

Spring Boot (continued)

27. What is the role of the @Component annotation?

28. How do you implement a custom health check in Spring Boot Actuator?

29. What is the purpose of the @Scheduled annotation?

30. How do you configure multiple data sources in Spring Boot?

31. What is the role of the @Profile annotation?

32. How do you implement internationalization (i18n) in Spring Boot?

33. What is the purpose of the @Conditional annotation?

34. How do you create a Spring Boot application with Spring WebFlux?

35. What is the role of the @RequestMapping annotation in Spring Boot?

36. How do you implement a custom filter in Spring Boot?

37. What is the purpose of the @EnableAsync annotation?

38. How do you implement asynchronous processing in Spring Boot?

39. What is the role of the @ResponseStatus annotation?

40. How do you use Spring Boot with Thymeleaf?


41. What is the purpose of the @Entity annotation in Spring Boot?

42. How do you implement pagination and sorting in Spring Boot?

43. What is the role of the @Autowired annotation?

44. How do you create a RESTful API versioning strategy in Spring Boot?

45. What is the purpose of the @RequestBody annotation?

46. How do you implement Swagger for API documentation in Spring Boot?

47. What is the role of the @PathVariable annotation?

48. How do you handle CORS in Spring Boot?

49. What is the purpose of the @EnableWebMvc annotation?

50. How do you deploy a Spring Boot application to a cloud platform?

You might also like