Posts

Showing posts from January, 2020

SQL Interview Questions

1) What are the usages of SQL? To execute queries against a database To retrieve data from a database To inserts records in a database To update records in a database To delete records from a database To create new databases To create new tables in a database To create views in a database 2) Does SQL support programming? No, SQL doesn't have loop or Conditional statement. It is used like commanding language to access databases. 3) What are the subsets of SQL? Data definition language (DDL) - Data definition language(DDL) allows you to CREATE, ALTER and DELETE database objects such as schema, tables, view, sequence etc. Data manipulation language (DML) - Data manipulation language makes user able to access and manipulate data. It is used to perform following operations. Insert data into database Retrieve data from the database Update data in the database Delete data from the database Data control language (DCL) - Data control

How can we optimize slow loading web sites?

1. Minify all CSS & js files. What is minify?  Minification is the process of removing all unnecessary characters from the source codes without changing their functionality. 2. Use optimized images instead of actual size image. What is image optimization?  Image optimization is about reducing the file size of your images as much as possible without sacrificing quality so that your page load times remain low. 3. Use Gzip compression. What is gzip compress?  Gzip is a method of compressing files. Compression allows your webserver to provide smaller file sizes which load faster for your website users.  4. During the image upload perform image resizing so the same image should be generated with multiple sizes that we can use at required positions. 5. SQL Query optimization- for better performance. 6. Enable cache - ( Redis / Memcache / file cache as cache driver ). For enabling browser level cache you can use IndexDb with expiry time& Cache-Control with

What is generator in PHP?

A generator is basically a normal function, but instead of returning a value it yields as many values as it needs to. It looks like a function but acts as an iterator. Generators use the  yield  keyword instead of return. Sample Example -  <?php function generator() { echo "Generator started"; for ($i = 0; $i < 5; ++$i) { yield $i; echo "Yielded $in"; } echo "Generator ended"; } foreach (generator() as $g);

Laravel interview questions

What is PHP artisan in Laravel? PHP is artisan is command line interface included with Laravel. It provides number of commands while developing laravel applications. Why we use Laravel? Progressive Framework Scale able Framework Large community  ORM Support Authentication Support Database Migrations Laravel Thinker and Seeder How can we configure variable in .env file? Set value in .env file => APP_Name = "Test_Laravel_Framewrok" Accessing value from .env file => env('APP_Name') How to set & get config variable in Laravel? set value in config file => config(['app.timezone' => 'YOUR TIME ZONE']); get value from config file => $value = config('app.timezone'); How can we determine current environment? Using - App::environment(); we can determine current environment. Ex - App::environment(['local', 'staging']) How to set debug mode in Laravel? In .env file we have env variable called "APP_DEBUG", If it

VueJs basic interview questions?

What are life cycle hooks in VueJs? beforeCreate - The first component in the creation hooks. This allows us to perform actions before our component has been added to DOM. We don't have access to DOM inside of this hook. Created -This hook is invoked when Vue has set up events and data observation. Here, events are active and access to reactive data is enabled though templates have not yet been mounted or rendered. beforeMount - The beforeMount hooks runs right before the initial render happens and after the template or render functions have been complied. Mounted - This is a most used hook and you will have full access to the reactive component, templates, and rendered DOM (via. this.$el). The most frequently used patterns are fetching data for your component. beforeUpdate - This hook runs after data changes on our component and the update cycle begins. But it runs right before the DOM is patched and re-renders. Updated - This hook runs after data changes on your compo

What is difference between http and https?

Start with http - Start with http:// https - Start with https:// Port http - It uses 80 port by default. https - It uses 443 port by default. Protocol http - It operates on tcp/tp level. https - It operates on http but uses encrypted tls/ssl. Data encryption http - It wont use data encryption. https - It use data encryption. SEO http - it wont help in search ranking. https - it helps in search ranking. Speed http - Speed fast. https - Speed slow. Scrambling  Data scrambling is the process to obfuscate or remove sensitive data. This process is irreversible so that the original data cannot be derived from the scrambled data. http - Does not scramble data https - It scramble data before transmission and at receiver end it de-scramble date to recover original data. There for transmitted information is secured and can not be hacked. Security Level http - It is less secured as data can be vulnerable to hackers.  https - It is designed to prev