Interprep - Questionnaire

Kindly respond to each of the questions provided here, giving particular consideration to the important notes section.

‼️ Important Notes:

  • Generate a readme.md file in the root directory of your Git repository to address all the questions provided. Ensure the file is well-organized, correctly formatted, easily readable, and understandable.
  • Endeavor to solve the questions without external sources. However, if necessary, you may refer to online resources. If you do, articulate the answers in your own words.
  • Use Java code within distinct packages in the IntelliJ project available in your repository for answering questions (except where explicitly stated otherwise).
  • Follow the prescribed naming conventions for packages and classes (coe.unosquare.interprep.<-module name->.question<-Question Number-> e.g.: coe.unosquare.interprep.oop.question1) and Java's standard naming for classes, respectively (e.g: coe.unosquare.interprep.oop.question1.Car.class)
  • Utilize any tool of your choice for drawings or diagrams, and export them as images for inclusion in the readme file.

Below you will find the questions categorized in sections.

Object-Oriented Programming

  • What are the advantages of object-oriented programming?
  • For instance, when have you used interfaces and an example of a scenario where you've used abstract classes?
  • How do you inherit a class in Java and other inheritance mechanisms different from 'extends' (clue: interfaces)
  • What is the difference between Composition and Aggregation?
  • What is the purpose of the keyword 'static'?
  • Can I create a class inside another class? If so, how can I create an instance of an object of that class?
  • How to avoid inheritance and an example of why I wouldn't want a class to be inherited?
  • Use of the 'abstract' reserved word:
  • What is Polymorphism, an example of a scenario where you've used it
  • What is the use of 'override,' and 'overload' with examples as well
  • What is the difference between class and abstract class?

Strings:

  • Are Strings native? Why? NOTE: Instead of coding, explain this with a draw or a diagram
  • What operations can I perform with a String?
  • Can I transform an integer into a String? How?
  • How can I concatenate (join) two Strings?
  • Is String a mutable or immutable class? Why? NOTE: Use another class to make the difference noticeable
  • What other classes can I use for String handling?
  • How do I add elements to a StringBuilder?
  • What is the difference between StringBuilder and StringBuffer?
  • Describe a real scenario where you've used StringBuilder and another where you've used StringBuffer.
  • What steps do I have to follow if I need to convert a StringBuilder to a String?
  • How can I determine if one String is equal to another?
  • What is the purpose of the 'hashCode' method?

Java Exception Handling:

  • Key keywords in Exception Handling in Java (try, catch, finally, throw, and throws)
  • Difference between throw and throws
  • Describe the use of finally:
  • Can I use throw without using try-catch?
  • Can I use finally without catch?
  • Can I use try without catch?
  • Explain catch block hierarchy in Java and examples of real scenarios where you've used them
  • In terms of the best practices when using exception handling. Which exception should come first? Why?

Collections:

  • Examples of Collections you have used and how they are used. Include how to initialize it and what are its main operations (add, delete, etc)
  • Describe the advantages and disadvantages of using an array. NOTE: Instead of coding, explain this with a draw or a diagram
  • Describe the advantages and disadvantages of using a list. NOTE: Instead of coding, explain this with a draw or a diagram
  • Describe the advantages and disadvantages of using a set. NOTE: Instead of coding, explain this with a draw or a diagram
  • Describe the advantages and disadvantages of using a map. NOTE: Instead of coding, explain this with a draw or a diagram
  • Explain the difference between an array and a list
  • Explain the difference between an array and a map
  • Explain the difference between a list and a map
  • Explain the difference between a list and a set
  • Can I receive objects of different types in an array? How?
  • Can I receive objects of different types in a list? How?
  • Can I receive objects of different types in a map? How?
  • Can I receive objects of different types in a set? How?
  • Can I have nulls in an array? If so, how and how many?
  • Can I have nulls in a list? If so, how and how many?
  • Can I have null in a map? If so, how and how many?
  • In terms of performance, if I have to store 3000 trillions of numbers, what collection should I use and why?

Threads:

  • How can I create a thread in Java?
  • How can I run one or more threads in Java?
  • What is the purpose of the Executor Framework?
  • Mention different implementations where you've used Threads or the Executor Framework.
  • What is the purpose of 'synchronize'?
  • What is a race condition? How is it resolved? NOTE: You should ALSO explain it with a draw or a diagram
  • What is a deadlock? How is it resolved? NOTE: You should ALSO explain it with a draw or a diagram
  • Difference between Runnable and Callable

REST:

  • Describe all the steps needed to create a service based on a Customer table in Java and which operations would you use.
  • What are the HTTP methods (verbs)?
  • Differences between put, post, and patch.
  • What's the main use of Headers?
  • Mentioned 5 properties on a Header?
  • What's the purpose of a Path? How it's composed?
  • What's the meaning of a 200 response code?
  • What's the meaning of a 400 response code?
  • What's the meaning of a 500 response code?
  • Mention 5 different 400 response codes and explain them

Spring:

  • Advantages of using Spring Framework.
  • Difference between Spring Framework and Spring Boot.
  • Explain what's IoC. NOTE: No code, instead use a draw or a diagram.
  • Describe what the application context is.
  • Explain what a bean is and its properties (at least 5)
  • Describe all the different scopes of a bean?
  • What is Dependency Injection (DI)?
  • Explain the different types of DI.
  • Explain what's Autowiring in Spring?
  • Explain what's Component in Spring?
  • What's the main use the @Primary annotation?
  • What's the main use of the @Qualifier annotation?
  • Explain what AOP is.