How do you decide which type of database to use?
.
.
There are hundreds or even thousands of databases available today, such as Oracle, MySQL, MariaDB, SQLite, PostgreSQL, Redis, ClickHouse, MongoDB, S3, Ceph, etc. How do you select the architecture for your system? My short summary is as follows:
๐นRelational database. Almost anything could be solved by them.
๐นIn-memory store. Their speed and limited data size make them ideal for fast operations.
๐นTime-series database. Store and manage time-stamped data.
๐นGraph database. It is suitable for complex relationships between unstructured objects.
๐นDocument store. They are good for large immutable data.
๐นWide column store. They are usually used for big data, analytics, reporting, etc., which needs denormalized data.
๐ Over to you: Obviously, I did not cover every type of database. Is there anything else you often use, and why do you choose it?
.
.
There are hundreds or even thousands of databases available today, such as Oracle, MySQL, MariaDB, SQLite, PostgreSQL, Redis, ClickHouse, MongoDB, S3, Ceph, etc. How do you select the architecture for your system? My short summary is as follows:
๐นRelational database. Almost anything could be solved by them.
๐นIn-memory store. Their speed and limited data size make them ideal for fast operations.
๐นTime-series database. Store and manage time-stamped data.
๐นGraph database. It is suitable for complex relationships between unstructured objects.
๐นDocument store. They are good for large immutable data.
๐นWide column store. They are usually used for big data, analytics, reporting, etc., which needs denormalized data.
๐ Over to you: Obviously, I did not cover every type of database. Is there anything else you often use, and why do you choose it?
๐1
1669950540403.pdf
1.8 MB
System Design Article (01): ๐๐๐๐ก๐ข๐ง๐
๐๐๐๐ก๐ข๐ง๐ is one of the very important building blocks of designing any rebust system. It has been has been asked in many big tech giant companies' system design rounds including: #google #meta #amazon #microsoft #netflix etc...
In this article, I have covered very neat & clean everything about caching like:
โ๏ธ ๐๐๐๐ก๐ข๐ง๐ ๐๐ง๐ญ๐ซ๐จ๐๐ฎ๐๐ญ๐ข๐จ๐ง.
โ๏ธ ๐๐ก๐ฒ ๐ฐ๐ ๐ง๐๐๐ ๐๐๐๐ก๐ข๐ง๐ ?
โ๏ธ ๐๐ข๐๐๐๐ซ๐๐ง๐ญ ๐ญ๐ฒ๐ฉ๐๐ฌ ๐จ๐ ๐๐๐๐ก๐ข๐ง๐ ๐ญ๐๐๐ก๐ง๐ข๐ช๐ฎ๐๐ฌ.
โ๏ธ ๐๐๐ฏ๐๐ง๐ญ๐๐ ๐๐ฌ / ๐๐ข๐ฌ๐๐๐ฏ๐๐ง๐ญ๐๐ ๐๐ฌ ๐จ๐ ๐๐๐๐ก ๐๐๐๐ก๐ ๐ญ๐ฒ๐ฉ๐.
I hope you'll like it๐ค If you have any doubts or want to talk about this, please feel free to comment ๐ฌ
I have spent hours ๐ preparing this article for you and want to help the maximum number of people. so kindly show your support by sharing this with your friends & connections ๐
๐๐๐๐ก๐ข๐ง๐ is one of the very important building blocks of designing any rebust system. It has been has been asked in many big tech giant companies' system design rounds including: #google #meta #amazon #microsoft #netflix etc...
In this article, I have covered very neat & clean everything about caching like:
โ๏ธ ๐๐๐๐ก๐ข๐ง๐ ๐๐ง๐ญ๐ซ๐จ๐๐ฎ๐๐ญ๐ข๐จ๐ง.
โ๏ธ ๐๐ก๐ฒ ๐ฐ๐ ๐ง๐๐๐ ๐๐๐๐ก๐ข๐ง๐ ?
โ๏ธ ๐๐ข๐๐๐๐ซ๐๐ง๐ญ ๐ญ๐ฒ๐ฉ๐๐ฌ ๐จ๐ ๐๐๐๐ก๐ข๐ง๐ ๐ญ๐๐๐ก๐ง๐ข๐ช๐ฎ๐๐ฌ.
โ๏ธ ๐๐๐ฏ๐๐ง๐ญ๐๐ ๐๐ฌ / ๐๐ข๐ฌ๐๐๐ฏ๐๐ง๐ญ๐๐ ๐๐ฌ ๐จ๐ ๐๐๐๐ก ๐๐๐๐ก๐ ๐ญ๐ฒ๐ฉ๐.
I hope you'll like it๐ค If you have any doubts or want to talk about this, please feel free to comment ๐ฌ
I have spent hours ๐ preparing this article for you and want to help the maximum number of people. so kindly show your support by sharing this with your friends & connections ๐
One opening available for a good service based company (female candidates only ) package possibly near 2x then companies coming to Sathya
Java Hyd Team
Do you guys need good Lpa or 3lpa is enough if yes ping us so that we can refer you for good package in next 10-15 day's
Told you all in the next 10-15 days will start to better package better culture better companies
Java Hyd Team
Told you all in the next 10-15 days will start to better package better culture better companies
It started exactly the 10th day and we have some great openings for freshers only
We are for you but please don't make noise in coaching that we shared answers ๐๐ and please don't copy all answers copy just to pass not to surpass
Never give all answers correct to anyone only way to get selected in interviews
We all grow up, and go to school and then college to get good grades with the inspiration to work at top MNC companies such as Microsoft and Apple.
As we get into start-ups and other companies to gain experience, we understand that good grades are not at all enough.
All top product-based companies look for certain Skills to give you a job.
Unfortunately, there is no college that focuses to help students gain skills.
Fortunately, Skillslash is conducting a masterclass to help you face interviews and showcase your skills to land your dream job.
The workshop will be led by Chirag Goel, who has been working with Product Companies for over 8 +years and has cracked SDE interviews at many companies including Microsoft and Flipkart.
so, don't miss out on the opportunity to learn from the best!
Register Now: https://skillslash.com/event/how-to-crack-sde-interviews?utm_source=LinkedIn+&utm_medium=InfluencerMarketing&utm_campaign=Atul-02&utm_content=SDEInterview
As we get into start-ups and other companies to gain experience, we understand that good grades are not at all enough.
All top product-based companies look for certain Skills to give you a job.
Unfortunately, there is no college that focuses to help students gain skills.
Fortunately, Skillslash is conducting a masterclass to help you face interviews and showcase your skills to land your dream job.
The workshop will be led by Chirag Goel, who has been working with Product Companies for over 8 +years and has cracked SDE interviews at many companies including Microsoft and Flipkart.
so, don't miss out on the opportunity to learn from the best!
Register Now: https://skillslash.com/event/how-to-crack-sde-interviews?utm_source=LinkedIn+&utm_medium=InfluencerMarketing&utm_campaign=Atul-02&utm_content=SDEInterview
Skillslash
Crack SDE Interviews at Product Companiest
Enroll in the Full stack course Event and learn from live classes. Get Knowledge by working on industry projects.
principles of oops
what is abstraction
what is encapsulation
what is class
what is object
diff b/w this & super &super()
method vs constructors
inheritance
polymorphism
overloading
overriding
interface
abstract class
interface vs abstract class
diff b/w static polymorphism and dynamic polymorphism
string vs string builder vs string buffer
what is collection
exceptional handling
what is abstraction
what is encapsulation
what is class
what is object
diff b/w this & super &super()
method vs constructors
inheritance
polymorphism
overloading
overriding
interface
abstract class
interface vs abstract class
diff b/w static polymorphism and dynamic polymorphism
string vs string builder vs string buffer
what is collection
exceptional handling
๐2๐1
Q1.) What is a frameWork?
A1.)1. a frameWork is a collection of jar and war files.
2. it consists of reUsable components and libraries.
3. it is collection of classes and interfaces
4. it provides structure for writing programs
Q2.) Types of frameWork ?
A2.)1. Invasive FrameWork
a frameWork that forces you to implement or extend
2. Non-Invasive FrameWork
a frameWork that do-not force to implement or extend
eg:- struts , hibernate , spring
Q3.) What is IOC & IOC Lifecycle ?
A3.) it is a design pattern that allows program control to be inverted
or
transfer from traditional in-process control structure to separate service provider .
LifeCycle of IOC
1. Initialization :- IOC container is initialised and configured.
2. Binding :- Components are registered with container & can be specifying interfaces .
3. Resolution :- Dependencies of the components are resolved and the appropriate instance is created
4. Invocation :- Container invokes specific methods of the components.
5. Destruction :- Component destroyed & restore released
Q4.) What is SingleTon class and Rules to create class ?
A4.) A class that is limited to one instance of itself
this means only one object of the class can be created
Most common use of this class is to provide global access to objects
RULES of Singleton class
1. class must be declared Private
2. private constructor
3. static variables of same type
4. public static method must return instance of class
Q5.) What is dependency Injection and Types
A5.) a class receives instances of object it depends upon external
source rather than creating them itself .
this allows class to be independent of how the object
it depends on are created & makes code easier to maintain test
Rules of DI
1. Constructor-based Dependency Injection:- in this dependent object is provided
as the parameter in the constructor of class .
it is provided when class is instantiated.
2. Setter-based Dependency Injection :- dependent object is provided in class through setter methods
this is useful when dependency is optional or when it can be changed even after class is instantiated
3. Interface-based Dependency Injection :- defined some methods that must be implemented by dependent objects
this is useful when class needs to be decoupled from dependent objects
allowing it into different implementations of dependent objects
4. Autowiring Dependency Injection :- this injection in spring
framework enables you to inject the object dependency implicitly.
It internally uses setter or constructor injection.
Autowiring can't be used to inject primitive and string values. It works with reference only.
Q6.) types of bean configuration technique in java
1. XML Based Configuration: This is the most common and popular way of configuring the Spring beans. The beans are configured using the XML file, which contains all the bean definitions.
2. Annotation Based Configuration: This type of configuration allows you to create beans using annotations. You donโt need to create an XML file for the beans.
3. Java Based Configuration: This type of configuration uses pure Java classes to configure the beans. The beans are configured using the @Bean annotation.
Q7.) What is Annotation and use of annotation?
A7.) a form of metaData , A way to provide additional information about a program construct without changing the program itself it can be used to provide information about class, methods or field specifying code generation or compilation instruction or providing external metadata from XML.
it allows developers to add custom information to their code without modifying the code itself , making it easier to keep track of important information .
this is useful when working on large code base or when trying to keep track of changes overtime .
Q8.) What is Auto-Wiring?
A8.) it enables frameWork to inject dependency into beans
A1.)1. a frameWork is a collection of jar and war files.
2. it consists of reUsable components and libraries.
3. it is collection of classes and interfaces
4. it provides structure for writing programs
Q2.) Types of frameWork ?
A2.)1. Invasive FrameWork
a frameWork that forces you to implement or extend
2. Non-Invasive FrameWork
a frameWork that do-not force to implement or extend
eg:- struts , hibernate , spring
Q3.) What is IOC & IOC Lifecycle ?
A3.) it is a design pattern that allows program control to be inverted
or
transfer from traditional in-process control structure to separate service provider .
LifeCycle of IOC
1. Initialization :- IOC container is initialised and configured.
2. Binding :- Components are registered with container & can be specifying interfaces .
3. Resolution :- Dependencies of the components are resolved and the appropriate instance is created
4. Invocation :- Container invokes specific methods of the components.
5. Destruction :- Component destroyed & restore released
Q4.) What is SingleTon class and Rules to create class ?
A4.) A class that is limited to one instance of itself
this means only one object of the class can be created
Most common use of this class is to provide global access to objects
RULES of Singleton class
1. class must be declared Private
2. private constructor
3. static variables of same type
4. public static method must return instance of class
Q5.) What is dependency Injection and Types
A5.) a class receives instances of object it depends upon external
source rather than creating them itself .
this allows class to be independent of how the object
it depends on are created & makes code easier to maintain test
Rules of DI
1. Constructor-based Dependency Injection:- in this dependent object is provided
as the parameter in the constructor of class .
it is provided when class is instantiated.
2. Setter-based Dependency Injection :- dependent object is provided in class through setter methods
this is useful when dependency is optional or when it can be changed even after class is instantiated
3. Interface-based Dependency Injection :- defined some methods that must be implemented by dependent objects
this is useful when class needs to be decoupled from dependent objects
allowing it into different implementations of dependent objects
4. Autowiring Dependency Injection :- this injection in spring
framework enables you to inject the object dependency implicitly.
It internally uses setter or constructor injection.
Autowiring can't be used to inject primitive and string values. It works with reference only.
Q6.) types of bean configuration technique in java
1. XML Based Configuration: This is the most common and popular way of configuring the Spring beans. The beans are configured using the XML file, which contains all the bean definitions.
2. Annotation Based Configuration: This type of configuration allows you to create beans using annotations. You donโt need to create an XML file for the beans.
3. Java Based Configuration: This type of configuration uses pure Java classes to configure the beans. The beans are configured using the @Bean annotation.
Q7.) What is Annotation and use of annotation?
A7.) a form of metaData , A way to provide additional information about a program construct without changing the program itself it can be used to provide information about class, methods or field specifying code generation or compilation instruction or providing external metadata from XML.
it allows developers to add custom information to their code without modifying the code itself , making it easier to keep track of important information .
this is useful when working on large code base or when trying to keep track of changes overtime .
Q8.) What is Auto-Wiring?
A8.) it enables frameWork to inject dependency into beans
matically , without explicit configuration.
it allows beans to be linked together without having explicitly specify their relationship in configuration file .
it also eliminates the need to specify bean names (manually) in configuration file.
Q9.) What is Java Qualifier & Use of Qualifier ?
A9.) it is used to provide additional information about a variables , methods or class .
it is used to add a level of type safety to code .
@Qualifier can be used to indicate which classes should be used when resolving dependency injection , to denote which method should be used when overriding & to provide additional metadata about a method or classes .
@Qualifier can also be used to indicate which parameter should be used in constructor or method.
Q10.) Scope & bean Scope modes ?
A10.)
1. Singleton: The singleton scope is the default scope used in the Spring framework. It creates a single instance of the bean and all requests for that bean use the same instance.
2. Prototype: The prototype scope creates a new instance of the bean every time a request is made.
3. Request: The request scope creates a new instance of the bean for each HTTP request.
4. Session: The session scope creates a new instance of the bean for each HTTP session.
5. Global Session: The global session scope is similar to the session scope, except it is shared across different servlet contexts.
Q11.) StereoType annotations & use ?
A11.) it is used to define & classify type of classes , fields & methods
it can be used to define / improve code readability & maintainability & to ensure that code elements are used properly.
it can be used to apply common behaviour such as applying security or logging ,across multiple elements
Q12.) DataType annotation & use ?
A12.) it is used to specify the type of date that variable is storing .
This helps prevent errors by ensuring the correct type of data is used when manipulating values .
Q13.) @ComponentScan:-it is used to detect & register components /beans as managed by Spring frameWork .
it is used to detect classes annotated with @Component , @Service ,@Repository & @Controller
@Configuration:- it is used to define bean definitions in application Context.
it is used to define beans & their properties as part of Spring Framework.
@Value :- it is used to inject literal values into fields ,methods & constructor
it is used to inject literal values in properties
@Required :- it is used to indicate the presence of a dependency for a bean .
it is used to indicate bean property must be configured in bean configuration file .
@Controller :- it is used on a class that provides web interfaces .
it is used to denote class as controller class & will
be detected automatically detected by spring framework
for Component Scan & managed as bean.
@Service :- it is used for class that contains business logic.
it is used to denote that the class is a service class
@Repository :- it is used to indicate that class is repository
it is used to mark class as DataAccess object.
it is used in combination with other annotation such as service & Component
@EnableAutoConfiguration :- automatically configuration all stereotype classes & manage springBoot entire cycle
Q14.) Spring Jdbc /Orm (Implemented methods & Persistent methods) ?
A14.) SpringJDBC:-
1. it is used to simplify managing database transactions
2. it provides templets for Data access & helps to eliminates common error
3. it provides wrapper around existing JDBC code & makes it easier to use
PURPOSE OF Implemented methods & Persistent methods IS TO automate data access and manipulation
Persistent Methods:
โข Create - allows you to create a new entry in the database.
โข Retrieve - allows you to retrieve an existing entry from the database.
โข Update - allows you to modify an existing entry in the database.
โข Delete - allows you to delete an existing entry from the database.
โข Save - allows you to save an exi
it allows beans to be linked together without having explicitly specify their relationship in configuration file .
it also eliminates the need to specify bean names (manually) in configuration file.
Q9.) What is Java Qualifier & Use of Qualifier ?
A9.) it is used to provide additional information about a variables , methods or class .
it is used to add a level of type safety to code .
@Qualifier can be used to indicate which classes should be used when resolving dependency injection , to denote which method should be used when overriding & to provide additional metadata about a method or classes .
@Qualifier can also be used to indicate which parameter should be used in constructor or method.
Q10.) Scope & bean Scope modes ?
A10.)
1. Singleton: The singleton scope is the default scope used in the Spring framework. It creates a single instance of the bean and all requests for that bean use the same instance.
2. Prototype: The prototype scope creates a new instance of the bean every time a request is made.
3. Request: The request scope creates a new instance of the bean for each HTTP request.
4. Session: The session scope creates a new instance of the bean for each HTTP session.
5. Global Session: The global session scope is similar to the session scope, except it is shared across different servlet contexts.
Q11.) StereoType annotations & use ?
A11.) it is used to define & classify type of classes , fields & methods
it can be used to define / improve code readability & maintainability & to ensure that code elements are used properly.
it can be used to apply common behaviour such as applying security or logging ,across multiple elements
Q12.) DataType annotation & use ?
A12.) it is used to specify the type of date that variable is storing .
This helps prevent errors by ensuring the correct type of data is used when manipulating values .
Q13.) @ComponentScan:-it is used to detect & register components /beans as managed by Spring frameWork .
it is used to detect classes annotated with @Component , @Service ,@Repository & @Controller
@Configuration:- it is used to define bean definitions in application Context.
it is used to define beans & their properties as part of Spring Framework.
@Value :- it is used to inject literal values into fields ,methods & constructor
it is used to inject literal values in properties
@Required :- it is used to indicate the presence of a dependency for a bean .
it is used to indicate bean property must be configured in bean configuration file .
@Controller :- it is used on a class that provides web interfaces .
it is used to denote class as controller class & will
be detected automatically detected by spring framework
for Component Scan & managed as bean.
@Service :- it is used for class that contains business logic.
it is used to denote that the class is a service class
@Repository :- it is used to indicate that class is repository
it is used to mark class as DataAccess object.
it is used in combination with other annotation such as service & Component
@EnableAutoConfiguration :- automatically configuration all stereotype classes & manage springBoot entire cycle
Q14.) Spring Jdbc /Orm (Implemented methods & Persistent methods) ?
A14.) SpringJDBC:-
1. it is used to simplify managing database transactions
2. it provides templets for Data access & helps to eliminates common error
3. it provides wrapper around existing JDBC code & makes it easier to use
PURPOSE OF Implemented methods & Persistent methods IS TO automate data access and manipulation
Persistent Methods:
โข Create - allows you to create a new entry in the database.
โข Retrieve - allows you to retrieve an existing entry from the database.
โข Update - allows you to modify an existing entry in the database.
โข Delete - allows you to delete an existing entry from the database.
โข Save - allows you to save an exi
sting entry in the database.
โข Merge - allows you to merge two existing entries in the database.
Implemented methods:
โข Data Access Object (DAO) - provides an interface for accessing data from the database.
โข Query Interface - provides a way to create, execute, and manage queries.
โข Transaction Management - provides an abstraction layer for managing transactions.
โข Object-Relational Mapping (ORM) - provides a way to map Java objects to database tables.
โข Object/Relational (O/R) Metadata Mapping - provides a way to define relationships between Java objects and database tables.
โข Data Access Template - provides a way to easily access and manipulate data in the database.
SPRING ORM:-
1. it is used to map objects into database tables.
2. it provides easy access to databased methods.
3. these methods are created by using object relational mapping configuration are used to perform required operations
4. **Additionally , persistent methods can save , retrieve data from database
Q15.) MVC in Spring & SpringBoot?
A15.) 1. Spring MVC is popular web-based framework for webapps
2. it provides model-view-controller architecture & components that help developers to build web apps easily.
1.Spring Boot is an extension of spring framework that makes easier to create standalone ,production grade spring based apps
2. it provides embedded webserver , so there is no-need to deploy an external server
3. it provides auto-configuration for web-apps
4. it provides CLI(Command line interface ) to quickly create & run apps.
Q16.) Spring MVC execution flow ?
A16.)
1. User sends an HTTP Request to a web browser.
2. DispatcherServlet, receives the request and checks the web.xml file to identify the appropriate Controller.
3. The DispatcherServlet maps the request to the appropriate Controller and calls its handler methods.
4. The Controller processes the request and generates the Model or view object.
5. The view object is passed to the appropriate View Resolver.
6. The View Resolver identifies the appropriate View Component and prepares the output.
7. The DispatcherServlet passes the output to the web browser.
Q17.) Difference between BeanFactory & Application Context?
A17.) BEANFACTORY
1. it is light weight container
2. it is used for basic dependency injection
3. it creates bean when asked
APPLICATION CONTEXT
1. it is heavy weight container
2. provides more advanced configuration as AOP, iL8n,& validations
3. it creates bean when it is loaded
4. it has the ability to publish events to the beans that are registered as listeners .
Q18.) What is MAVEN & purpose of maven tool?
A18.) it is used to build , manage & deploy s/w projects
it is used to define project structure, dependency , build & test process
it makes build system easy & uniform system
it automates process of downloading necessary dependencies & compiling source code into a package that can be deployed.
it supports in generating reports & do communication.
Q19.) What is dependency & purpose ?
A19.) it is relationship b/w 2 software components
where one component relies on the other components to function properly
purpose of dependency is to decouple components in order to make them modular , re-usable, maintainable.
dependencies also allow better collaboration b/w developers & make it easier to debug & test applications
Q20.) Describe POM.xml?
A20.) it contains information about project (config details )
it contain default values for most projects as well as the ability to override these values for specific projects
it contain project dependencies , plugins , goals , & other info needed to build project
it also contains projects version , developers , licences & other metadata.
Q21.) SpringBoot :-
a spring module that provide the RAD(rapid application developement) feature to the spring framework
the use of springboot is to develop webapp (J2EE) & to develop restful apps (microservices)
it makes it
โข Merge - allows you to merge two existing entries in the database.
Implemented methods:
โข Data Access Object (DAO) - provides an interface for accessing data from the database.
โข Query Interface - provides a way to create, execute, and manage queries.
โข Transaction Management - provides an abstraction layer for managing transactions.
โข Object-Relational Mapping (ORM) - provides a way to map Java objects to database tables.
โข Object/Relational (O/R) Metadata Mapping - provides a way to define relationships between Java objects and database tables.
โข Data Access Template - provides a way to easily access and manipulate data in the database.
SPRING ORM:-
1. it is used to map objects into database tables.
2. it provides easy access to databased methods.
3. these methods are created by using object relational mapping configuration are used to perform required operations
4. **Additionally , persistent methods can save , retrieve data from database
Q15.) MVC in Spring & SpringBoot?
A15.) 1. Spring MVC is popular web-based framework for webapps
2. it provides model-view-controller architecture & components that help developers to build web apps easily.
1.Spring Boot is an extension of spring framework that makes easier to create standalone ,production grade spring based apps
2. it provides embedded webserver , so there is no-need to deploy an external server
3. it provides auto-configuration for web-apps
4. it provides CLI(Command line interface ) to quickly create & run apps.
Q16.) Spring MVC execution flow ?
A16.)
1. User sends an HTTP Request to a web browser.
2. DispatcherServlet, receives the request and checks the web.xml file to identify the appropriate Controller.
3. The DispatcherServlet maps the request to the appropriate Controller and calls its handler methods.
4. The Controller processes the request and generates the Model or view object.
5. The view object is passed to the appropriate View Resolver.
6. The View Resolver identifies the appropriate View Component and prepares the output.
7. The DispatcherServlet passes the output to the web browser.
Q17.) Difference between BeanFactory & Application Context?
A17.) BEANFACTORY
1. it is light weight container
2. it is used for basic dependency injection
3. it creates bean when asked
APPLICATION CONTEXT
1. it is heavy weight container
2. provides more advanced configuration as AOP, iL8n,& validations
3. it creates bean when it is loaded
4. it has the ability to publish events to the beans that are registered as listeners .
Q18.) What is MAVEN & purpose of maven tool?
A18.) it is used to build , manage & deploy s/w projects
it is used to define project structure, dependency , build & test process
it makes build system easy & uniform system
it automates process of downloading necessary dependencies & compiling source code into a package that can be deployed.
it supports in generating reports & do communication.
Q19.) What is dependency & purpose ?
A19.) it is relationship b/w 2 software components
where one component relies on the other components to function properly
purpose of dependency is to decouple components in order to make them modular , re-usable, maintainable.
dependencies also allow better collaboration b/w developers & make it easier to debug & test applications
Q20.) Describe POM.xml?
A20.) it contains information about project (config details )
it contain default values for most projects as well as the ability to override these values for specific projects
it contain project dependencies , plugins , goals , & other info needed to build project
it also contains projects version , developers , licences & other metadata.
Q21.) SpringBoot :-
a spring module that provide the RAD(rapid application developement) feature to the spring framework
the use of springboot is to develop webapp (J2EE) & to develop restful apps (microservices)
it makes it
easy to develop stand-alone production grade spring based application that you can just run.
FEATURES OF SPRINGBOOT
1.create standalone applications
2.embeded tomcat & jetty servers
3.provide opionated starter dependencies to simplify your build configuration
4.automatically configure spring & 3rd party libraries whenever possible (LAMBOC)
5.provide production ready features such as metrics , healthchecks & externalised configuration
6.no XML file needed only annotations
7.having default database h2db
Q22.) Difference b/w spring & springboot
A22.)
S.No.
Spring
Spring Boot
1.
Spring is an open-source lightweight framework widely used to develop enterprise applications.
Spring Boot is built on top of the conventional spring framework, widely used to develop REST APIs.
2.
The most important feature of the Spring Framework is dependency injection.
The most important feature of the Spring Boot is Autoconfiguration.
3.
It helps to create a loosely coupled application.
It helps to create a stand-alone application.
4.
To run the Spring application, we need to set the server explicitly.
Spring Boot provides embedded servers such as Tomcat and Jetty etc.
5.
To run the Spring application, a deployment descriptor is required.
There is no requirement for a deployment descriptor.
6.
To create a Spring application, the developers write lots of code.
It reduces the lines of code.
7.
It doesnโt provide support for the in-memory database.
It provides support for the in-memory database such as H2.
Q23.) @SpringBootApplication โ
** the entry point of the spring boot application is the class contains @SpringBootApplication annotation & the main method
** it automatically scans all components included in the project by using @ComponentScan annotation
Indicates a configuration of class that declares one or more @Bean method & also triggers auto-configuration & component scanning
** this is convenience annotation this is equivalent to declare @Configuration + @EnableAutoConfiguration + @componentScan .
@RequestMapping(โ/โ) โ
It is used with class & method level in controller class & which indicates webapp http request or we can cast web-mapping of web request
@RequestBody โ
In controller & in rest controller and in rest controller to write data to in the webpage body of the response in the form of String or in form of JSON object
FEATURES OF SPRINGBOOT
1.create standalone applications
2.embeded tomcat & jetty servers
3.provide opionated starter dependencies to simplify your build configuration
4.automatically configure spring & 3rd party libraries whenever possible (LAMBOC)
5.provide production ready features such as metrics , healthchecks & externalised configuration
6.no XML file needed only annotations
7.having default database h2db
Q22.) Difference b/w spring & springboot
A22.)
S.No.
Spring
Spring Boot
1.
Spring is an open-source lightweight framework widely used to develop enterprise applications.
Spring Boot is built on top of the conventional spring framework, widely used to develop REST APIs.
2.
The most important feature of the Spring Framework is dependency injection.
The most important feature of the Spring Boot is Autoconfiguration.
3.
It helps to create a loosely coupled application.
It helps to create a stand-alone application.
4.
To run the Spring application, we need to set the server explicitly.
Spring Boot provides embedded servers such as Tomcat and Jetty etc.
5.
To run the Spring application, a deployment descriptor is required.
There is no requirement for a deployment descriptor.
6.
To create a Spring application, the developers write lots of code.
It reduces the lines of code.
7.
It doesnโt provide support for the in-memory database.
It provides support for the in-memory database such as H2.
Q23.) @SpringBootApplication โ
** the entry point of the spring boot application is the class contains @SpringBootApplication annotation & the main method
** it automatically scans all components included in the project by using @ComponentScan annotation
Indicates a configuration of class that declares one or more @Bean method & also triggers auto-configuration & component scanning
** this is convenience annotation this is equivalent to declare @Configuration + @EnableAutoConfiguration + @componentScan .
@RequestMapping(โ/โ) โ
It is used with class & method level in controller class & which indicates webapp http request or we can cast web-mapping of web request
@RequestBody โ
In controller & in rest controller and in rest controller to write data to in the webpage body of the response in the form of String or in form of JSON object
๐1
Q1.) principles of oops:-
1. Abstraction: Abstraction in Java is a process of hiding the implementation details and showing only functionality to the user.
2. Encapsulation: Encapsulation in Java is a process of wrapping code and data together into a single unit.
3. Inheritance: Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object.
4. Polymorphism: Polymorphism in Java is a concept by which we can perform a single action in different ways.
5. Class: A class in Java is a blueprint which includes all your data. A class can contain fields and methods to describe the behavior of an object.
6. Object: An object in Java is the physical as well as a logical entity, with some state and behavior.
7. Method: A method in Java is a collection of statements that are grouped together to perform an operation.
Q2.) what is abstraction :-
Abstraction in Java is the process of hiding or ignoring the implementation details and showing only the functionality. It helps to reduce the complexity and also improves the maintainability of the application. Abstraction can be achieved by using abstract classes and interfaces. An abstract class is a class that contains one or more abstract methods, which are methods without a body. An interface is a collection of abstract methods.
Q3.) what is encapsulation :-
Encapsulation in Java is the process of wrapping code and data together into a single unit. It is a mechanism of hiding of data implementation by restricting access to public methods. It prevents the data from being modified by accident and is a way to achieve data abstraction. Encapsulation helps developers to follow a modular approach for software development and to keep the internal representation of an object hidden from the outside world.
Q4.) what is class :-
In Java, a class is a blueprint or prototype from which objects are created. A class encapsulates data fields and methods, representing the properties and behavior of the objects. It is the basic building block of object-oriented programming.
Q5.) what is object:-
Object in Java is a basic concept of object-oriented programming, which refers to the physical or logical representation of a real-world entity. It is an instance of a class, and can contain attributes and methods that can be used to manipulate its state. An object is created when the class is instantiated.
Q6.) diff b/w this & super &super()
This keyword refers to the current object, or the object whose method or constructor is being called.
super keyword refers to the immediate parent class object.
super() is a constructor used to call the parent class constructor.
Q7.) method vs constructors :-
A method is a section of code within a class which performs a specific task, while a constructor is a special type of method used to create an instance of a class.
Methods are used to perform operations on objects, while constructors are used to create objects. A constructor is called when an object of a class is created, and it is used to initialize the object's state. Methods are called by the user to perform some action on the object, such as calculating a sum or printing out the object's state.
Q8.) inheritance :-
Inheritance in Java is the process by which one class (the subclass) can inherit the properties and methods of another class (the superclass). The subclass can add its own unique properties and methods, but it can also use the properties and methods from the superclass. This allows for code reuse and decreased complexity in the program.
Q9.) polymorphism :-
Polymorphism in Java is the ability of an object to take on many forms. The most common use of polymorphism in Java is when a parent class reference is used to refer to a child class object. Any Java object that can pass more than one IS-A test is considered to be polymorphic.
In Java, all Java objects are polymorphic since any object will pass the IS-A test for their own type and for the
1. Abstraction: Abstraction in Java is a process of hiding the implementation details and showing only functionality to the user.
2. Encapsulation: Encapsulation in Java is a process of wrapping code and data together into a single unit.
3. Inheritance: Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object.
4. Polymorphism: Polymorphism in Java is a concept by which we can perform a single action in different ways.
5. Class: A class in Java is a blueprint which includes all your data. A class can contain fields and methods to describe the behavior of an object.
6. Object: An object in Java is the physical as well as a logical entity, with some state and behavior.
7. Method: A method in Java is a collection of statements that are grouped together to perform an operation.
Q2.) what is abstraction :-
Abstraction in Java is the process of hiding or ignoring the implementation details and showing only the functionality. It helps to reduce the complexity and also improves the maintainability of the application. Abstraction can be achieved by using abstract classes and interfaces. An abstract class is a class that contains one or more abstract methods, which are methods without a body. An interface is a collection of abstract methods.
Q3.) what is encapsulation :-
Encapsulation in Java is the process of wrapping code and data together into a single unit. It is a mechanism of hiding of data implementation by restricting access to public methods. It prevents the data from being modified by accident and is a way to achieve data abstraction. Encapsulation helps developers to follow a modular approach for software development and to keep the internal representation of an object hidden from the outside world.
Q4.) what is class :-
In Java, a class is a blueprint or prototype from which objects are created. A class encapsulates data fields and methods, representing the properties and behavior of the objects. It is the basic building block of object-oriented programming.
Q5.) what is object:-
Object in Java is a basic concept of object-oriented programming, which refers to the physical or logical representation of a real-world entity. It is an instance of a class, and can contain attributes and methods that can be used to manipulate its state. An object is created when the class is instantiated.
Q6.) diff b/w this & super &super()
This keyword refers to the current object, or the object whose method or constructor is being called.
super keyword refers to the immediate parent class object.
super() is a constructor used to call the parent class constructor.
Q7.) method vs constructors :-
A method is a section of code within a class which performs a specific task, while a constructor is a special type of method used to create an instance of a class.
Methods are used to perform operations on objects, while constructors are used to create objects. A constructor is called when an object of a class is created, and it is used to initialize the object's state. Methods are called by the user to perform some action on the object, such as calculating a sum or printing out the object's state.
Q8.) inheritance :-
Inheritance in Java is the process by which one class (the subclass) can inherit the properties and methods of another class (the superclass). The subclass can add its own unique properties and methods, but it can also use the properties and methods from the superclass. This allows for code reuse and decreased complexity in the program.
Q9.) polymorphism :-
Polymorphism in Java is the ability of an object to take on many forms. The most common use of polymorphism in Java is when a parent class reference is used to refer to a child class object. Any Java object that can pass more than one IS-A test is considered to be polymorphic.
In Java, all Java objects are polymorphic since any object will pass the IS-A test for their own type and for the