Indigenous Science & Technology

Online Tutorials || Interviews - PHP



Interview Basics

0- On Board::Intro
1- Tell me something about you?
2- On what project currently you are working?
3- What is the your role?
4- What you do exactly on your project? 5- Do you work individual or in team? 6- What is strength of your team? 7- For how long you are working on your projects?

Technical Round

8- What is ini_set()?
9- What is session?
10- What is difference between session and cookies?
11- What is the uses of Resful API?
12- What is default time duration of session in php?
13- What is difference between primary key and unique key of mysql db-table?
14- What is difference between Get() & Post() method?
15- What is GIT?
16- Do ou know commond of GIT?
17- What is Error Reporting?
18- What is abstract class?
19- What is static method?
20- What are the two methods of migrations?
21- What is traits?
22- Is multi threading possible in PHP?
23- What is inheritance and its limitations?
24- What is polymorphism?
25- What is the procedures in mysql?
26- What is the interfaces?
27- What is the use of this keywords?
28- What is the object oriented programming in PHP?
29- What is the routes?
30- Tell me the folder structures of laravel?
31- What MVC framework you are familiar with?
32- How many years of experience is in laravel?
33- Do you know about CodeIgniter?
34- What are the aggregate function in PHP?
35- What is the object?
36- What is the difference between constructors and destructors?
37- Do you know about NodeJs or Angular Js?
38- What front end technologies you use?
39- On how many databse you worked on?
40- What is the difference between echo and print?
41- How to print value and datatypes at a same time?
42- What is the difference between while and for loop?
43- What is the difference between die() and exit() function?
44- How to prevent sql injection?
45- How to validate emails?
46- What is the validation function?
47- What is the Denial of Service attack?
48- What is the URI?
49- What is reverse routing?
50- How to define url in laravel?
51- Do you know about AWS?
52- Do you know about hosting?
53- What is composer?
54- What is the uses of PHP artisan command?
55- What is the middleware?
56- Difference between authentication and authorisation?
57- What is the uses of controller in laravel?
58- What is the uses of @include in laravel?
59- How to return data on views?
60- What is the db-table mapping in laravel?
61- What is the namespaces?
62- What is the MVC pattern?
63- Difference between laravel and codeigniter?
64- What is the use of bootstrap in laravel?
65- What is the app.php files?
66- What is the group routing?
67- What is the use of routes.php
68- What is the use of make keyword in laravel?
69- How to filter https request?
70- What is the uses of roll back function?
71- What is the web services
72- How to install Laravel

SQL References


Let's drive with my Examples...

Practicess
Do you have any questions?
Get involve in my projects...

Grab It

Let me tell something about PHP Interviews gone with me.

Latest News: (18/11/2020)

On Board::Intro

Fill it!

Fill it in Hindi!

Question-1: Tell me something about you?

Fill it!

Fill it in Hindi!

Question-2: On what project currently you are working?

Fill it!

Fill it in Hindi!

Question-3: What is the your role?

Fill it!

Fill it in Hindi!

Question-4: What you do exactly on your project?

Fill it!

Fill it in Hindi!

Question-5: Do you work individual or in team?

Fill it!

Fill it in Hindi!

Question-6: What is strength of your team?

Fill it!

Fill it in Hindi!

Question-7: For how long you are working on your projects?

Fill it!

Fill it in Hindi!

Question-8: What is ini_set()?

The ini_set() function allows you to change system attributes(in php.ini file) that affect the way your script is executed. Changes only affect the current script, and will revert back when the script ends. To use ini_set() , pass it the value you want to change as its first parameter, and the new value to use as its second parameter.

Ini_set () फ़ंक्शन आपको सिस्टम विशेषताओं (php.ini फ़ाइल में) को बदलने की अनुमति देता है जो आपकी स्क्रिप्ट को निष्पादित करने के तरीके को प्रभावित करता है। परिवर्तन केवल वर्तमान स्क्रिप्ट को प्रभावित करते हैं, और स्क्रिप्ट समाप्त होने पर वापस लौट आएंगे। Ini_set () का उपयोग करने के लिए, इसे वह मान दें जिसे आप इसके पहले पैरामीटर के रूप में बदलना चाहते हैं, और इसके दूसरे पैरामीटर के रूप में उपयोग करने के लिए नया मान।

Question-9: What is session?

A session is a way to store information (in variables) to be used across multiple pages. Unlike a cookie, the information is not stored on the users computer. Default time out of session in php is 24 minutes and 2 hours in laravel.

एक सत्र कई पृष्ठों में उपयोग की जाने वाली जानकारी (चर में) संग्रहीत करने का एक तरीका है। कुकी के विपरीत, जानकारी उपयोगकर्ता कंप्यूटर पर संग्रहीत नहीं है। पीएचपी में सत्र से बाहर डिफ़ॉल्ट समय 24 मिनट और लार्वा में 2 घंटे है।

Question-10: What is difference between session and cookies?

Cookies and Sessions are used to store informations. Cookies are only stored on the client-side machine(desktop/laptops/mobiles), while sessions get stored on the client as well as a server side. A session creates a file in a temporary directory on the server where registered session variables and their values are stored and send to client side through a file with the help of cookies.

कूकीज को स्टोर करने के लिए कुकीज़ और सत्र का उपयोग किया जाता है। कुकीज़ केवल क्लाइंट-साइड मशीन (डेस्कटॉप / लैपटॉप / मोबाइल) पर संग्रहीत की जाती हैं, जबकि सत्र क्लाइंट के साथ-साथ सर्वर साइड पर संग्रहीत होते हैं।

Question-11: What is the uses of Resful API?

A RESTful(REpresentational State Transfer) API is an architectural style for an application program interface (API) that uses HTTP requests to access and use data. That data can be used to GET, PUT, POST and DELETE data types, which refers to the reading, updating, creating and deleting of operations concerning resources. One of the key advantages of REST APIs is that they provide a great deal of flexibility. Data is not tied to resources or methods, so REST can handle multiple types of calls, return different data formats and even change structurally with the correct implementation of hypermedia.With the help of Restful API we can deal with any devices to display,update and delete data whout writing multiple version of code for multiple devices.

Restful (REpretational State Transfer) API एक एप्लिकेशन प्रोग्राम इंटरफ़ेस (API) के लिए एक वास्तुशिल्प शैली है जो डेटा तक पहुंचने और उपयोग करने के लिए HTTP अनुरोधों का उपयोग करता है। उस डेटा का उपयोग GET, PUT, POST और DELETE डेटा प्रकारों के लिए किया जा सकता है, जो संसाधनों से संबंधित कार्यों के पढ़ने, अपडेट करने, बनाने और हटाने के लिए संदर्भित करता है। REST एपीआई के प्रमुख लाभों में से एक यह है कि वे लचीलेपन का एक बड़ा सौदा प्रदान करते हैं। डेटा संसाधनों या विधियों से बंधा नहीं है, इसलिए REST कई प्रकार की कॉलों को संभाल सकता है, विभिन्न डेटा स्वरूपों को वापस कर सकता है और यहां तक ​​कि हाइपरमीडिया के सही कार्यान्वयन के साथ संरचनात्मक रूप से बदल सकता है। बाकी एपीआई की मदद से हम किसी भी डिवाइस को प्रदर्शित करने, अपडेट करने के लिए निपट सकते हैं। कई उपकरणों के लिए कोड के कई संस्करण लिखने के डेटा को पूरी तरह से हटा दें।

Question-12: What is default time duration of session in php?

24 minutes. Each session has a 'timeout' declared in seconds in the PHP. INI as session. gc_maxlifetime. This timeout (default of 24 minutes) is like a clock that is 'restarted' every time a user hits a page that uses a session (session_start()).

24 minutes. प्रत्येक सत्र में 'टाइमआउट' PHP में सेकंड में घोषित किया जाता है। सत्र के रूप में आई.एन.आई. gc_maxlifetime। यह टाइमआउट (24 मिनट का डिफ़ॉल्ट) एक ऐसी घड़ी की तरह होता है, जो हर बार तब होता है जब कोई उपयोगकर्ता किसी सत्र (सेशन_स्टार्ट ()) का उपयोग करने वाले पृष्ठ को हिट करता है।

Question-13: What is difference between primary key and unique key of mysql db-table?

Primary key will not accept NULL values whereas Unique key can accept one NULL value. A table can have only primary key whereas there can be multiple unique key on a table. A Clustered index automatically created when a primary key is defined whereas Unique key generates the non-clustered index.

प्राथमिक कुंजी NULL मान को स्वीकार नहीं करेगी जबकि अद्वितीय कुंजी एक NULL मान को स्वीकार कर सकती है। एक टेबल में केवल प्राथमिक कुंजी हो सकती है जबकि एक टेबल पर कई अद्वितीय कुंजी हो सकती है। एक प्राथमिक कुंजी परिभाषित होने पर स्वचालित रूप से बनाया गया क्लस्टर सूचकांक, जबकि अद्वितीय कुंजी गैर-संकुल सूचकांक बनाता है।

Question-14: What is difference between Get() & Post() method?

Difference between a GET and POST In GET method, values are visible in the URL. In POST method, values are not visible in the URL. GET has a limitation on the length of the values, generally 255 characters. POST has no limitation on the length of the values since they are submitted via the body of HTTP.

GET और POST के बीच अंतर GET विधि में, मान URL में दिखाई देते हैं। POST विधि में, मान URL में दिखाई नहीं देते हैं। जीईटी में मूल्यों की लंबाई पर सीमा होती है, आम तौर पर 255 वर्ण। POST की मानों की लंबाई पर कोई सीमा नहीं है क्योंकि वे HTTP के निकाय के माध्यम से प्रस्तुत किए गए हैं।

Question-15: What is GIT?

Git is a distributed version-control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity, and support for distributed, non-linear workflows.

सॉफ्टवेयर विकास के दौरान स्रोत कोड में परिवर्तन पर नज़र रखने के लिए Git एक वितरित संस्करण-नियंत्रण प्रणाली है। यह प्रोग्रामर के बीच समन्वय कार्य के लिए डिज़ाइन किया गया है, लेकिन इसका उपयोग फ़ाइलों के किसी भी सेट में परिवर्तन को ट्रैक करने के लिए किया जा सकता है। इसके लक्ष्यों में गति, डेटा अखंडता और वितरित, गैर-रेखीय वर्कफ़्लोज़ का समर्थन शामिल है।

Question-16: Do you know commond of GIT?

git init This command turns a directory into an empty Git repository. This is the first step in creating a repository. After running git init, adding and committing files/directories is possible. Usage: # change directory to codebase $ cd /file/path/to/code # make directory a git repository $ git init

Other commands:
git add
git commit
git status
git config
git branch
git checkout
git merge


Working with remote repositories
git remote To connect a local repository with a remote repository. A remote repository can have a name set to avoid having to remember the URL of the repository. Usage: # Add remote repository $ git remote # List named remote repositories $ git remote -v
other commands
git clone
git pull
git push

गिट इनिट यह कमांड एक निर्देशिका को एक खाली गिट रिपॉजिटरी में बदल देता है। यह भंडार बनाने का पहला कदम है। गिट इनिट चलाने के बाद, फ़ाइलों / निर्देशिकाओं को जोड़ना और कमिट करना संभव है। उपयोग: # निर्देशिका को कोडबेस में बदलें $ cd / file / path / to / code # निर्देशिका को एक गिट रिपॉजिटरी बनाते हैं $ git init

अन्य कमांड: git add
git कमिट
git स्टेटस
git config
git शाखा
गिट चेकआउट
git मर्ज


दूरस्थ रिपॉजिटरी के साथ कार्य करना दूरदराज के दूरस्थ रिपॉजिटरी के साथ स्थानीय रिपॉजिटरी को जोड़ने के लिए। दूरस्थ रिपॉजिटरी में रिपॉजिटरी के URL को याद रखने से बचने के लिए एक नाम सेट हो सकता है। उपयोग: # दूरस्थ रिपॉजिटरी जोड़ें $ git रिमोट <कमांड> <रिमोट_URL> # रिमोट रिपॉजिटरी नाम की सूची $ git रिमोट -v
अन्य कमांड git क्लोन
पकड़ खींचो
git push
credit: http://guides.beanstalkapp.com/version-control/common-git-commands.html

Question-17: What is Error Reporting?

The error reporting function is a built-in PHP function that allows developers to control which and how many errors will be shown in the application. Remember, the PHP ini configuration has an error_reporting directive that will be set by this function during runtime.

त्रुटि रिपोर्टिंग फ़ंक्शन एक अंतर्निहित PHP फ़ंक्शन है जो डेवलपर्स को नियंत्रित करने की अनुमति देता है कि कौन सी और कितनी त्रुटियों को एप्लिकेशन में दिखाया जाएगा। याद रखें, PHP ini विन्यास में एक error_reporting निर्देश है जो रनटाइम के दौरान इस फ़ंक्शन द्वारा सेट किया जाएगा।

Question-18: What is abstract class?

Abstract classes and methods are when the parent class has a named method, but need its child class(es) to fill out the tasks. An abstract class is a class that contains at least one abstract method. An abstract method is a method that is declared, but not implemented in the code.

सार कक्षाएं और विधियाँ तब होती हैं जब मूल वर्ग में एक नामित विधि होती है, लेकिन कार्यों को भरने के लिए उसके बाल वर्ग (तों) की आवश्यकता होती है। एक अमूर्त वर्ग एक ऐसा वर्ग है जिसमें कम से कम एक अमूर्त विधि होती है। एक अमूर्त विधि एक विधि है जिसे घोषित किया जाता है, लेकिन कोड में लागू नहीं किया जाता है।

Question-19: What is static method?

Static methods can be called directly - without creating an instance of the class first. Static methods are declared with the static keyword: Syntax ?php class ClassName { public static function staticMethod() { echo "Hello World!"; } } ?

स्टैटिक विधियों को सीधे कहा जा सकता है - पहले कक्षा का एक उदाहरण बनाए बिना। स्थैतिक कीवर्ड के साथ स्टेटिक तरीके घोषित किए जाते हैं: वाक्य - विन्यास ? Php क्लास क्लासनाम { सार्वजनिक स्थैतिक समारोह staticMethod () { गूंज "हैलो वर्ल्ड!"; } } ?

Question-20: What are the two methods of migrations?

A migration class contains two methods: up and down . The up method is used to add new tables, columns, or indexes to your database, while the down method should reverse the operations performed by the up method.

एक प्रवास वर्ग में दो विधियाँ शामिल हैं: ऊपर और नीचे। अप विधि का उपयोग आपके डेटाबेस में नए टेबल, कॉलम या इंडेक्स को जोड़ने के लिए किया जाता है, जबकि डाउन विधि को अप विधि द्वारा किए गए संचालन को उलट देना चाहिए।

Question-21: What is traits?

Traits are a mechanism for code reuse in single inheritance languages such as PHP. A Trait is intended to reduce some limitations of single inheritance by enabling a developer to reuse sets of methods freely in several independent classes living in different class hierarchies.

लक्षण एकल विरासत भाषाओं जैसे PHP में कोड पुन: उपयोग के लिए एक तंत्र हैं। एक विशेषता विभिन्न वर्ग पदानुक्रम में रहने वाले कई स्वतंत्र वर्गों में स्वतंत्र रूप से तरीकों के सेट का पुन: उपयोग करने के लिए एक डेवलपर को सक्षम करके एकल विरासत की कुछ सीमाओं को कम करने का इरादा है।

Question-22: Is multi threading possible in PHP?

Yes you can do multi-threading in PHP with pthreads From the PHP documentation: pthreads is an object-orientated API that provides all of the tools needed for multi-threading in PHP. PHP applications can create, read, write, execute and synchronize with Threads, Workers and Threaded objects. Warning: The pthreads extension cannot be used in a web server environment. Threading in PHP should therefore remain to CLI-based applications only.

Simple Test
#!/usr/bin/php ?php class AsyncOperation extends Thread { public function __construct($arg) { $this->arg = $arg; } public function run() { if ($this->arg) { $sleep = mt_rand(1, 10); printf('%s: %s -start -sleeps %d' . "\n", date("g:i:sa"), $this->arg, $sleep); sleep($sleep); printf('%s: %s -finish' . "\n", date("g:i:sa"), $this->arg); } } } // Create a array $stack = array(); //Initiate Multiple Thread foreach ( range("A", "D") as $i ) { $stack[] = new AsyncOperation($i); } // Start The Threads foreach ( $stack as $t ) { $t->start(); } ?
Output
First Run 12:00:06pm: A -start -sleeps 5 12:00:06pm: B -start -sleeps 3 12:00:06pm: C -start -sleeps 10 12:00:06pm: D -start -sleeps 2 12:00:08pm: D -finish 12:00:09pm: B -finish 12:00:11pm: A -finish 12:00:16pm: C -finish Second Run 12:01:36pm: A -start -sleeps 6 12:01:36pm: B -start -sleeps 1 12:01:36pm: C -start -sleeps 2 12:01:36pm: D -start -sleeps 1 12:01:37pm: B -finish 12:01:37pm: D -finish 12:01:38pm: C -finish 12:01:42pm: A -finish

हाँ, आप pthreads के साथ PHP में मल्टी-थ्रेडिंग कर सकते हैं PHP प्रलेखन से: pthreads एक ऑब्जेक्ट-ओरिएंटेड एपीआई है जो PHP में मल्टी-थ्रेडिंग के लिए आवश्यक सभी उपकरण प्रदान करता है। PHP एप्लिकेशन थ्रेड, वर्कर्स और थ्रेडेड ऑब्जेक्ट के साथ बना, पढ़, लिख, निष्पादित और सिंक्रनाइज़ कर सकते हैं। चेतावनी: वेब सर्वर वातावरण में pthreads एक्सटेंशन का उपयोग नहीं किया जा सकता है। PHP में थ्रेडिंग केवल CLI- आधारित एप्लिकेशन तक ही रहनी चाहिए।

Credit:
Stackoverflow

Question-23: What is inheritance and its limitations?

Main disadvantage of using inheritance is that the two classes (base and inherited class) get tightly coupled. This means one cannot be used independent of each other. Also with time, during maintenance adding new features both base as well as derived classes are required to be changed.

वंशानुक्रम का उपयोग करने का मुख्य नुकसान यह है कि दो वर्गों (आधार और विरासत में मिला वर्ग) कसकर युग्मित हो जाते हैं। इसका मतलब यह है कि एक दूसरे से स्वतंत्र उपयोग नहीं किया जा सकता है। इसके अलावा समय के साथ, रखरखाव के दौरान नई सुविधाओं को जोड़ने के लिए दोनों आधारों के साथ-साथ व्युत्पन्न वर्गों को बदलना आवश्यक है।

Question-24: What is polymorphism?

Polymorphism is one of the PHP Object Oriented Programming (OOP) features. In general, polymorphism means the ability to have many forms. If we say it in other words, "Polymorphism describes a pattern in Object Oriented Programming in which a class has varying functionality while sharing a common interfaces.".

बहुरूपता PHP ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग (OOP) सुविधाओं में से एक है। सामान्य तौर पर, बहुरूपता का अर्थ है कई रूपों की क्षमता। अगर हम इसे दूसरे शब्दों में कहें तो, "पॉलीमॉर्फिज्म ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग में एक पैटर्न का वर्णन करता है जिसमें एक वर्ग में एक समान इंटरफेस साझा करते हुए कार्यक्षमता भिन्न होती है।"

Question-25: What is the store procedures in mysql?

A stored procedure is a subroutine stored in the database catalog. Applications can call and execute the stored procedure. The CALL SQL statement is used to execute a stored procedure. Stored procedures can have IN , INOUT and OUT parameters, depending on the MySQL version.

एक संग्रहीत प्रक्रिया डेटाबेस कैटलॉग में संग्रहीत एक सबरूटीन है। अनुप्रयोग संग्रहीत कार्यविधि को कॉल और निष्पादित कर सकते हैं। कॉल SQL स्टेटमेंट का उपयोग किसी स्टोर किए गए कार्यविधि को निष्पादित करने के लिए किया जाता है। MySQL संस्करण के आधार पर संग्रहीत प्रक्रियाओं में IN, INOUT और OUT पैरामीटर हो सकते हैं।

Question-26: What is the interfaces?

PHP - What are Interfaces? Interfaces allow you to specify what methods a class should implement. Interfaces make it easy to use a variety of different classes in the same way. When one or more classes use the same interface, it is referred to as "polymorphism".

PHP - इंटरफेसेस क्या हैं? इंटरफ़ेस आपको यह निर्दिष्ट करने की अनुमति देता है कि किसी वर्ग को किन तरीकों को लागू करना चाहिए। इंटरफेस एक ही तरह से विभिन्न वर्गों का उपयोग करना आसान बनाते हैं। जब एक या अधिक वर्ग एक ही इंटरफ़ेस का उपयोग करते हैं, तो इसे "बहुरूपता" कहा जाता है।

Question-27: What is the use of this keywords?

this keyword is used inside a class, generally withing the member functions to access non-static members of a class(variables or functions) for the current object. Let's take an example to understand the usage of $this .

इस कीवर्ड का उपयोग एक वर्ग के अंदर किया जाता है, आम तौर पर वर्तमान ऑब्जेक्ट के लिए एक वर्ग (चर या कार्यों) के गैर-स्थिर सदस्यों तक पहुंचने के लिए सदस्य फ़ंक्शन के साथ। आइए $ $ के उपयोग को समझने के लिए एक उदाहरण लें।

Question-28: What is the object oriented programming in PHP?

OOP stands for Object-Oriented Programming. Procedural programming is about writing procedures or functions that perform operations on the data, while object-oriented programming is about creating objects that contain both data and functions. Object-oriented programming has several advantages over procedural programming:
OOP is faster and easier to execute
OOP provides a clear structure for the programs
OOP helps to keep the PHP code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug
OOP makes it possible to create full reusable applications with less code and shorter development time
Tip: The "Don't Repeat Yourself" (DRY) principle is about reducing the repetition of code. You should extract out the codes that are common for the application, and place them at a single place and reuse them instead of repeating it.

OOP का मतलब ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग है। प्रक्रियात्मक प्रोग्रामिंग उन प्रक्रियाओं या कार्यों को लिखने के बारे में है जो डेटा पर कार्य करते हैं, जबकि ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग उन वस्तुओं को बनाने के बारे में है जिनमें डेटा और फ़ंक्शन दोनों शामिल हैं। ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग में प्रक्रियात्मक प्रोग्रामिंग पर कई फायदे हैं:
OOP निष्पादित करने के लिए तेज़ और आसान है
OOP कार्यक्रमों के लिए एक स्पष्ट संरचना प्रदान करता है
OOP PHP कोड DRY "अपने आप को दोहराएं नहीं" रखने में मदद करता है, और कोड को बनाए रखना, संशोधित करना और डीबग करना आसान बनाता है
OOP कम कोड और कम विकास समय के साथ पूर्ण पुन: प्रयोज्य अनुप्रयोगों को बनाना संभव बनाता है
युक्ति: "खुद को दोहराएं नहीं" (DRY) सिद्धांत कोड की पुनरावृत्ति को कम करने के बारे में है। आपको उन कोड को निकालना चाहिए जो अनुप्रयोग के लिए सामान्य हैं, और उन्हें एक ही स्थान पर रखें और इसे दोहराने के बजाय उनका पुन: उपयोग करें।

Question-29: What is the routes?

Routing in Laravel allows you to route all your application requests to its appropriate controller. The main and primary routes in Laravel acknowledge and accept a URI (Uniform Resource Identifier) along with a closure, given that it should have to be a simple and expressive way of routing.
Route is a way of creating a request URL of your application. These URL do not have to map to specific files on a website. The best thing about these URL is that they are both human readable and SEO friendly. In Laravel 5.5, routes are created inside the routes folder.

लारवेल में रूटिंग से आप अपने सभी एप्लिकेशन अनुरोधों को उसके उपयुक्त नियंत्रक तक ले जा सकते हैं। लारवेल में मुख्य और प्राथमिक मार्ग एक बंद होने के साथ-साथ एक यूआरआई (यूनिफ़ॉर्म रिसोर्स आइडेंटिफ़ायर) को स्वीकार और स्वीकार करते हैं, यह देखते हुए कि इसे रूटिंग का एक सरल और अभिव्यंजक तरीका होना चाहिए।
। मार्ग आपके आवेदन का अनुरोध URL बनाने का एक तरीका है। इन URL को किसी वेबसाइट पर विशिष्ट फ़ाइलों के लिए मैप नहीं करना पड़ता है। इन URL के बारे में सबसे अच्छी बात यह है कि वे दोनों मानव पठनीय और एसईओ के अनुकूल हैं। Laravel 5.5 में, मार्गों को रूट फ़ोल्डर के अंदर बनाया गया है।

Question-30: Tell me the folder structures of laravel?

The Root Directory. The App Directory. The app directory contains the core code of your application. The Bootstrap Directory. The bootstrap directory contains the app. The Config Directory. The Database Directory. The Public Directory. The Resources Directory. The Tests Directory. The Vendor Directory.

रूट निर्देशिका। एप्लिकेशन निर्देशिका। एप्लिकेशन निर्देशिका में आपके एप्लिकेशन का मुख्य कोड होता है। बूटस्ट्रैप निर्देशिका। बूटस्ट्रैप डायरेक्टरी में ऐप है। विन्यास निर्देशिका। डेटाबेस निर्देशिका। सार्वजनिक निर्देशिका। संसाधन निर्देशिका। टेस्ट निर्देशिका। विक्रेता निर्देशिका।

Question-31: What MVC framework you are familiar with?

I am familiar with Laravel and CodeIgniter.

Fill it in Hindi!

Question-32: How many years of experience is in laravel?

4 Years+

Fill it in Hindi!

Question-33: Do you know about CodeIgniter?

Yes, I know. It is based on MVC pattern but having component oriented programming procedures not ORM (Object Realation Mapping) like Laravel.

Fill it in Hindi!

Question-34: What are the aggregate function in PHP?

Sum, avrage, max, min are the aggregate functions in PHP.

Fill it in Hindi!

Question-35: What is the object?

An Object is an individual instance of the data structure defined by a class. We define a class once and then make many objects that belong to it. Objects are also known as instances. Object contains properties of classe as well as methods.

Fill it in Hindi!

Question-36: What is the difference between constructors and destructors?

Constructor is special type of function which automatically get called when the object is created. Destructor is also special type of function which automatically get called when the object is destroyed. Used to initialize the instance of a class. Used to de-initialize objects already existing to free up memory for new accomodation.

Fill it in Hindi!

Question-37: Do you know about NodeJs or Angular Js?

Yes, I know.

Fill it in Hindi!

Question-38: What front end technologies you use?

Bootstrap 4, JavaScript, JQuery, HTML5, CSS3, NodeJs, AngularJs.

Fill it in Hindi!

Question-39: On how many databases you worked on?

Mysql, Postgres Sql and MongoDB.

Fill it in Hindi!

Question-40: What is the difference between echo and print?

echo and print are more or less the same. They are both used to output data to the screen. The differences are very small: echo has no return value while print has a return value of 1 so it can be used in expressions. echo can take multiple parameters (although such usage is rare) while print can take one argument. print_r() can be used to display array values(Key & Value) while cho can not be.

Fill it in Hindi!

Question-41: How to print value and datatypes at a same time?

We use var_dump() to display values and data-type of a variable at a same time.

Fill it in Hindi!

Question-42: What is the difference between while and for loop?

Functionally, a for loop is similar to a while loop; it's mean that, each can be rewritten as the other with no change to the outcome or side effects. However, each has different meanings. A while loop runs while a condition holds true; the condition is static, though circumstances change. A for loop runs over a sequence without checking conditions.

Fill it in Hindi!

Question-43: What is the difference between die() and exit() function?

Use die() when there is an error and have to stop the execution. e.g. die( 'Oops! Something went wrong' ); Use exit() when there is not an error and have to stop the execution.

Fill it in Hindi!

Question-44: How to prevent sql injection?

Use prepared statements and parameterized queries. These are SQL statements that are sent to and parsed by the database server separately from any parameters. This way it is impossible for an attacker to inject malicious SQL. You basically have two options to achieve this: 1.)Using PDO (for any supported database driver):
$stmt = $pdo->prepare('SELECT * FROM employees WHERE name = :name'); $stmt->execute([ 'name' => $name ]); foreach ($stmt as $row) { // Do something with $row } 2.) Using MySQLi (for MySQL): $stmt = $dbConnection->prepare('SELECT * FROM employees WHERE name = ?'); $stmt->bind_param('s', $name); // 's' specifies the variable type => 'string' $stmt->execute(); $result = $stmt->get_result(); while ($row = $result->fetch_assoc()) { // Do something with $row }

Fill it in Hindi!

Question-45: How to validate emails?

Option-1:
The easiest and safest way to check whether an email address is well-formed is to use PHP's filter_var() function.
In the code below, if the e-mail address is not well-formed, then store an error message:
$email = test_input($_POST["email"]); if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailErr = "Invalid email format"; }
Option-2:
The code below shows a simple way to check if the name field only contains letters, dashes, apostrophes and whitespaces. If the value of the name field is not valid, then store an error message:
$name = test_input($_POST["name"]); if (!preg_match("/^[a-zA-Z-' ]*$/",$name)) { $nameErr = "Only letters and white space allowed"; }
Note: The preg_match() function searches a string for pattern, returning true if the pattern exists, and false otherwise.

Fill it in Hindi!

Question-46: What is the validation function?

An HTML form contains various input fields such as text box, checkbox, radio buttons, submit button, and checklist, etc. These input fields need to be validated, which ensures that the user has entered information in all the required fields and also validates that the information provided by the user is valid and correct.
There is no guarantee that the information provided by the user is always correct. PHP validates the data at the server-side, which is submitted by HTML form. You need to validate a few things:
Empty String
Validate String
Validate Numbers
Validate Email
Validate URL
Input length

Fill it in Hindi!

Question-47: What is the Denial of Service attack?

When you consider all the possible attacks that you are likely to come under when running a successful web site, the most feared attack is denial of service - when a hacker, or potentially a group of hackers, conspire to stop your web site from working as intended. It may well be that this involves taking your database server offline, making your whole web site run slow, or, worse, taking your web site offline entirely. There are three methods of denial of service (DoS), of which two are essentially the same: A malicious user with a fast Internet connection bombards your web server with requests, thereby overloading it A malicious user with accomplices, who may be unwitting, bombard your web server with requests, thereby overloading it. In this situation, the attackers do not need fast Internet connections - 100 requests from 10,000 people are as damaging as 1,000,000 requests from one person. A malicious user finds a hole in your web site that forces your server to perform an inordinate amount of work, thereby overloading the server. Of the three, the first two are impossible to defend against - the world's largest sites have been taken offline by this form of denial of service, and there is nothing you can do irrespective of whether you are using PHP. The last option, however, is something you can guard against. If you have holes in your code that can be exploited by outsiders to cause your web server to chew up 99% of your CPU time, you are in trouble. A popular mistake is to write code that results in URLs like this: www.example.com/article.php?file=aboutus.php www.example.com/article.php?file=products.php www.example.com/article.php?file=legal.php The code for article.php will read in the $_GET['file'] variable, then include() the necessary file into the script. This might make sense at first, but consider what happens if a clever use modified the URL to this: www.example.com/article.php?file=article.php What will happen is that article.php will load, then include()article.php, which will load, then include()article.php, which will load, then... and so on. This will continue going on and on until your server hits the maximum execution time for a script and terminates. However, during this time your web server will be performing large amounts of unnecessary work, and will be slower for other clients connecting to it. Now consider what would happen if that same malicious user loaded that URL three times quickly - or thirty. From that, consider what would happen if that user loaded the URL three thousand times - nothing difficult, considering that can be handled even with a slow connection. At three thousand almost-simultaneous connections, even a normal web server would have trouble coping. However, if each of those three thousand resulted in a CPU-consuming infinite include() loop, the server would simply stop responding to new requests and may well even crash. Author's Note: if you are think three thousand pages is too much for just one client to handle, think again - HTTP has a special access method called "HEAD" that sends a request to the server, makes the server process the page fully, then returns only the header information of the page - this is usually only around 100 bytes. Three thousand times 100 bytes is three hundred thousand bytes, or 300 kilobytes - well within the reach of even lowly modem users. The moral of the story is that you should always keep in mind the possibility that malicious users may use your own code against you. The most obvious solution to the problem detailed here is not include files based upon a variable, but if that is not possible then at least consider using include_once() to stop the recursion.
SOURCE: Denial of Service Attacks

Fill it in Hindi!

Question-48: What is the URI?

URI(Unifrom Resource Identifier) = URL(Uniform Resource Locatior) + URN(Uniform Resource Name) .

Fill it in Hindi!

Question-49: What is reverse routing?

Reverse routing is the process of generating the URL that would lead to a route, given a symbolic reference to the route (could be name of the route/view/controller or a reference to the controller, depending on the framework).

Fill it in Hindi!

Question-50: How to define url in laravel?

Fill it!

Fill it in Hindi!

Question-51: Do you know about AWS?

Yes, I know.

Fill it in Hindi!

Question-52: Do you know about hosting?

Yes, I know.

Fill it in Hindi!

Question-53: What is composer?

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Fill it in Hindi!

Question-54: What is the uses of PHP artisan command?

The Laravel PHP artisan serve command helps running applications on the PHP development server. As a developer, you can use Laravel artisan serve to develop and test various functions within the application. It also accepts two additional options. You can use the host for changing application's address and port.

Fill it in Hindi!

Question-55: What is the middleware?

Middleware provide a convenient mechanism for filtering HTTP requests entering your application. For example, Laravel includes a middleware that verifies the user of your application is authenticated. If the user is not authenticated, the middleware will redirect the user to the login screen.

Fill it in Hindi!

Question-56: Difference between authentication and authorisation?

Fill it!

Fill it in Hindi!

Question-57: What is the uses of controller in laravel?

Controllers are meant to group associated request handling logic within a single class. In your Laravel project, they are stored in the app/Http/Controllers' directory. The full form of MVC is Model View Controller, which act as directing traffic among the Views and the Models.

Fill it in Hindi!

Question-58: What is the uses of @include in laravel?

To include multiple view file in a view file.

Fill it in Hindi!

Question-59: How to return data on views?

Views hold the presentation logic of a Laravel application. It is served separately from the application logic using laravel's blade templating engine. Passing data from a controller to a view is as simple as declaring a variable and adding it as a parameter to the returned view helper method.

Fill it in Hindi!

Question-60: What is the db-table mapping in laravel?

Each database table has a corresponding "Model" which is used to interact with that table.

Fill it in Hindi!

Question-61: What is the namespaces?

In computing, a namespace is a set of signs that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified. Namespaces are commonly structured as hierarchies to allow reuse of names in different contexts. In PHP Namespaces are qualifiers that solve two different problems: They allow for better organization by grouping classes that work together to perform a task. They allow the same name to be used for more than one class.

Fill it in Hindi!

Question-62: What is the MVC pattern?

Model–view–controller is a software design pattern commonly used for developing user interfaces that divides the related program logic into three interconnected elements. This is done to separate internal representations of information from the ways information is presented to and accepted from the user. In PHP MVC is an application design pattern that separates the application data and business logic (model) from the presentation (view). MVC stands for Model, View & Controller. The controller mediates between the models and views. Think of the MVC design pattern as a car and the driver.

Fill it in Hindi!

Question-63: Difference between laravel and codeigniter?

Codeigniter is Object-oriented whereas Laravel is relational Object-Oriented. Codeigniter doesn't come with built-in authentication features whereas Laravel comes with authentication class features. Codeigniter doesn't have an inbuilt Unit testing tool while Laravel has an inbuilt Unit testing tool.

Fill it in Hindi!

Question-64: What is the use of bootstrap in laravel?

Writing CSS After installing the laravel/ui Composer package and generating the frontend scaffolding, Laravel's package. json file will include the bootstrap package to help you get started prototyping your application's frontend using Bootstrap. However, feel free to add or remove packages from the package.

Fill it in Hindi!

Question-65: What is the app.php files?

Fill it!

Fill it in Hindi!

Question-66: What is the group routing?

Route groups allow you to group several routes together, and apply any shared once to the entire group, to reduce this duplication.

Fill it in Hindi!

Question-67: What is the use of routes.php?

Routing rules are defined in your application/config/routes.php file. In it you'll see an array called $route that permits you to specify your own routing criteria.

Fill it in Hindi!

Question-68: What is the use of make keyword in laravel?

The make method accepts the name of the class or interface you wish to resolve: $api = $this->app->make('HelpSpot\API'); One advantage to using the make method, is that Laravel will automatically inject any dependencies the class may define in it's constructor.

Fill it in Hindi!

Question-69: How to filter https request?

Fill it!

Fill it in Hindi!

Question-70: What is the uses of roll back function?

This is a great feature for when you run a migration, and then you need you need to rollback or revert the last one instead of the whole batch.

Fill it in Hindi!

Question-71: What is the web services?

The term Web service (WS) is either: a service offered by an electronic device to another electronic device, communicating with each other via the World Wide Web, or a server running on a computer device, listening for requests at a particular port over a network, serving web documents (HTML, JSON, XML, images), and creating[clarification needed] web applications services, which serve in solving specific domain problems over the Web (WWW, Internet, HTTP) In a Web service a Web technology such as HTTP is used for transferring machine-readable file formats such as XML and JSON. In practice, a web service commonly provides an object-oriented Web-based interface to a database server, utilized for example by another Web server, or by a mobile app, that provides a user interface to the end-user. Many organizations that provide data in formatted HTML pages will also provide that data on their server as XML or JSON, often through a Web service to allow syndication, for example, Wikipedia's Export. Another application offered to the end-user may be a mashup, where a Web server consumes several Web services at different machines and compiles the content into one user interface.

Fill it in Hindi!

Question-72: How to install Laravel?

Steps-1: Installing Composer.
Get Composer
Step-2: Installing laravel Via Composer Create-Project.
Open cmd and run: composer create-project --prefer-dist laravel/laravel blog
Step-3: Check installation:
run in cmd: php artisan serve

laravel development server started on http://localhost:8000/ Step-4: That's it.

Folders and files on fresh laravel installation:

folders:-->
app
bootstrap
config
database
public
resources
storage
tests
vendor
files:-->
.env
.env.example
.gitignore
artisan
composer.json
composer.lock
env-original
gulpfile
package.json
phpunit
readme.md
server

Fill it in Hindi!

Question-73: How to make model in laravel?

> php artisan make:model Models/users
After making model , it can be found under folder: app/Models/users.php

Fill it in Hindi!

Question-74: How to create migrations in laravel?

> php artisan make:migration create_tasks_table --create=tasks
After making migrations , it can be found under folder: /database/migrations folder

Fill it in Hindi!

Question-75: What is Eloquent Models?

> Eloquent is Laravel’s ORM which provides simple Active-record Implementation for working with database. Each Database table can have corresponding Eloquent model. Eloquent Model represents database entities and can be used to query data as well as insert and update data to the tables. So, let’s make a model for our tasks table using make:model command.
php artisan make:model Task
After making migrations , it can be found under folder: app/Models folder

Fill it in Hindi!

Question-76: What is One-to-Many Relationship?

Relationships are used to connect tables. Eloquent provides way to connect their models through eloquent relationships. One-to-many relationship means when one model owns multiple amounts of another model.For our example: single user can have many tasks thus one-to-many relationship exists between User table and Task Table. It's very easy to define and use Eloquent relationship and the benefit is, you don’t have to run query at all. Eloquent will bind the models so you will have to only use functions.
Let’s edit Task Model and User Model to create Eloquent Relationship:
Task Model (task.php found in app/task.php):
use App\Models\User; class Task extends Model { public function user() { return $this->belongsTo(User::class); } }

Fill it in Hindi!

Question-77: What is Artisan Tinker?

Laravel provides a command-line interface known as Artisan. Artisan contains various commands and among them, we will now discuss about Tinker. Tinker allows you to interact with your entire Laravel application through console window without the need of accessing web interface. Major benefit of tinker is you can test relationships, debug data and access Eloquent ORM, jobs, tests, events etc. So we will also be using Tinker in our laravel tutorial. Let’s say you registered to the app and created two tasks. Now you check those tasks directly in the console window as below:
$ php artisan tinker >App\User::first()->tasks;
Tinker directly access database so this is a great tool for testing functions as well as the data.

Fill it in Hindi!

Question-78: What is Controllers?

Controllers are used to direct traffic between views and models and they can group multiple request handling logic into a single class. Thus, generally they receive all the request and based on their logic, they redirect or return respective data. In our example, now we are moving towards front-end, thus we should make controllers through which we can handle requests coming to our application. Execute below command to create controller for tasks:
php artisan make:controller TasksController
This will create TasksController and you can find that in app/Http/Controllers directory.

Fill it in Hindi!

Question-79: What is Routing?

Routing means to accept the request and redirect it to appropriate function. Our app needs five routes which will do following: Login
Register
Display list of all our tasks
Add new tasks
Delete existing tasks
Login and register are added by Laravel Jetstream so now we need to take care of only three routes.
Laravel provides various route files inside '/routes' folder for various use cases. For example: routing configuration for API will go in '/routes/api.php' file while routing configuration for our regular web application will go in '/routes/web.php'.
Now, let’s edit web.php. Below is the edited version of file. Make changes accordingly:

Fill it in Hindi!

Question-80: What to do if route doesnt wor?

Hello! I also encountered this problem before. Please check your Apache's httpd.conf file. Make sure that you enabled the LoadModule rewrite_module modules/mod_rewrite.so by removing the # from the start line of the code. And also change inside the httpd.conf from Require all denied to Require all granted, AllowOverride All, and Options Indexes FollowSymLinks
Follow: https://laracasts.com/discuss/channels/laravel/route-not-working-1 route-not-working

Fill it in Hindi!

Question-: ?



Fill it in Hindi!

Question-: ?



Fill it in Hindi!

More Practices