Advanced Interview Questions
The register method in the Service Provider class binds classes and services to Service Containers.
And the boot method runs after the program includes all the dependencies in the container.
Then you can create routes and view composers in the boot method.
1- Offers a rich set of functionalities like Eloquent ORM, Template Engine, Artisan, Migration system for databases, etc
2- Libraries & Modular
3- It supports MVC Architecture
4- Unit Testing
5- Security
6- Website built in Laravel is more scalable and secure.
7- It includes namespaces and interfaces that help to organize all resources.
8- Provides a clean API.
1- Blade Templating
2- Routing
3- Eloquent ORM
4- Middleware
5- Artisan(Command-Line Interface)
6- Security
7- In-built Packages
8- Caching
9- Service Providers
10- Facades
11- Service Container
Lumen is a lightweight framework for building web applications in PHP. It is built on top of Laravel and follows the same best practices that you have come to know in Laravel.
Lumen was designed to be used as an alternative to Laravel when you only need to build small applications and services.
Laravel Mix is a wrapper around Webpack, a popular JavaScript module bundler. It simplifies the process of compiling assets such as JavaScript, CSS, and images, and provides a clean and expressive API for defining asset compilation tasks
Laravel Facades provide a static interface to classes available in the application's service container.
They allow you to access these classes in a simple and expressive way without needing to instantiate them manually.
The process of confirming a user's identification through credentials, like a username and password, is called authentication.
Authorization, on the other hand, is the process of determining whether a user has the necessary permissions to perform a certain action or access a certain resource.
- INNER JOIN returns only the rows that have matching values in both tables based on the join condition specified,
- OUTER JOIN returns all rows from one or both tables, with unmatched rows filled with NULL values where the join condition is not met.
MySQL query optimization involves various techniques such as indexing, using appropriate data types, minimizing the number of queries, optimizing table structure, avoiding unnecessary calculations, and utilizing query caching.
The JOIN statement in MySQL is used to retrieve data from multiple tables based on a related column between them.
Different types of joins include:
1- INNER JOIN (returns rows when there is a match in both tables),
2- LEFT JOIN (returns all rows from the left table and matching rows from the right table),
3- RIGHT JOIN (returns all rows from the right table and matching rows from the left table),
4- FULL JOIN (returns all rows when there is a match in either table).
SIX triggers are available in MySQL table.
1- BEFORE INSERT
2- AFTER INSERT
3- BEFORE UPDATE
4- AFTER UPDATE
5- BEFORE DELETE
6- AFTER DELETE
There are three types of relationships used in MySQL.
1- One-to-one:
- Elements with a one to one relationship can be included as columns in the table.
2- One-to-many:
- One to many or many to one relationships both are same. It will occur when one row in a table is related to multiple rows in different table.
3- Many-to-many:
- Many rows in a table are related to many rows in different table is called many to many relationship.
Constructor:
- A constructor is a special member function of a class that is automatically called when an object is created.
Destructor:
- A destructor is a special member function of a class that is automatically called when an object of the class goes out of scope or is deleted.
- Abstract:
1- Abstract class doesn’t support multiple inheritance (can extend only one abstract class)
2- Abstract contains constructors & data members.
3- An abstract class can have final, non-final, static and non-static variables.
4- A class that is abstract can have both abstract and non-abstract methods.
- Interface:
1- An interface supports multiple inheritance. (can implements more than one interface)
2- Interface doesn't contains constructors & data members.
3- The interface has only static and final variables.
4- An interface can only have abstract methods.
- Overloading deals with multiple methods in the same class with the same name but different signatures.
- Overriding deals with two methods, one in a parent class & one in a child class, that have the same signatures.
Polymorphism is composed of two words - “poly”, which means “many”, and “morph”, which means “shapes”.
Therefore, Polymorphism refers to something that has many shapes.
In OOP, Polymorphism refers to the process by which some code, data, method, or object behaves differently under different circumstances or contexts.
For Example:
(Shape) has a (Circle, Triangle, Square), This is called polymorphism from one thing.
There are two types of polymorphism:
1- Compile-time polymorphism (also known as static polymorphism) is achieved through function or operator overloading.
2- Runtime polymorphism (also known as dynamic polymorphism) is achieved through function overriding.
In general terms, an abstract class is a class that is intended to be used for inheritance.
An abstract class can consist of both abstract and non-abstract methods.
- It cannot be instantiated. (Cannot create object from)
- Made for other classes to inherit prop & methods from.
- can have methods & properties.
- can have abstract methods & non-abstract methods.
- abstract methods no body code. (only parameters or arguments)
- Class is a blueprint that you can create an object from.
- Object is a member in the main application.
For Example:
(Car) is a class.
(BMW, Ford) are objects.
1- OOPs is very helpful in solving very complex level of problems.
2- Highly complex programs can be created, handled, and maintained easily using object-oriented programming.
3- OOPs, promote code reuse, thereby reducing redundancy.
4- OOPs also helps to hide the unnecessary details with the help of Data Abstraction.
5- OOPs, are based on a bottom-up approach, unlike the Structural programming paradigm, which uses a top-down approach.
6- Polymorphism offers a lot of flexibility in OOPs.
1- It requires intensive testing
2- Not apt for minor problems
3- It requires good planning
4- It takes more time to solve problems
5- Problems need to be thought in term of objects
Yes. The limitations of inheritance are:
1- Increased execution effort and time.
2- Tight coupling of parent and child class.
3- Requires correct implementation.
4- Requires jumping between different classes.
The various types of inheritance include:
1- Single inheritance
2- Multiple inheritances
3- Multi-level inheritance
4- Hierarchical inheritance
5- Hybrid inheritance
1. Imperative Programming Paradigm:
- Procedural Programming Paradigm
- Object-Oriented Programming
- Parallel Programming
2- Declarative Programming Paradigm:
- Logical Programming Paradigm
- Functional Programming Paradigm
- Database Programming Paradigm