Posts

List of JavaScript object method

Methods Description concat() It returns a new array object that contains two or more merged arrays. copywithin() It copies the part of the given array with its own elements and returns the modified array. every() It determines whether all the elements of an array are satisfying the provided function conditions. fill() It fills elements into an array with static values. filter() It returns the new array containing the elements that pass the provided function conditions. find() It returns the value of the first element in the given array that satisfies the specified condition. findIndex() It returns the index value of the first element in the given array that satisfies the specified condition. forEach() It invokes the provided function once for each element of an array. includes() It checks whether the given array contains the specified element. indexOf() It searches the specified element in the given array

What are life cycle hooks in VueJs?

beforeCreate -  The first component in the creation of 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 observations. Here, events are active and access to reactive data is enabled through templates that 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 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 component and the DOM re-renders.

List of JavaScript array method

Methods Description concat() It returns a new array object that contains two or more merged arrays. copywithin() It copies the part of the given array with its own elements and returns the modified array. every() It determines whether all the elements of an array are satisfying the provided function conditions. fill() It fills elements into an array with static values. filter() It returns the new array containing the elements that pass the provided function conditions. find() It returns the value of the first element in the given array that satisfies the specified condition. findIndex() It returns the index value of the first element in the given array that satisfies the specified condition. forEach() It invokes the provided function once for each element of an array. includes() It checks whether the given array contains the specified element. indexOf() It searches the specified element in the given array

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

CodeIgniter Interview Questions

CodeIgniter is an open-source MVC based framework for PHP. It is a loosely coupled framework that we can use for the rapid development of websites and mobile APIs. 1) How to check the version of the CodeIgniter framework? In system/core/CodeIgniter.php, check CI_VERSION constant value define(‘CI_VERSION’, ‘3.0.6’); 2) How to set CSRF token in CodeIgniter? CSRF is used to set the protection in CodeIgniter. To set CSRF, you have to put the corresponding config value True. Syntax: $config['csrf_protection'] = TRUE; 3) How many types of messages you can log in to CodeIgniter? There are three message types in Codeigniter. They are : Error Messages. These are actual errors, such as PHP errors or user errors. Debug Messages. These are messages that assist in debugging. For example, if a class has been initialized, you could log this as debugging info. Informational Messages. These are the lowest priority messages, simply giving information regarding some process.