Breaking

Followers

Friday, 21 July 2023

7/21/2023 12:23:00 am

OOP Job Interview Questions And Answers.

 Question - 1:

Can we call a base class method without creating instance?

Ans:

Yep. But ..

* Its possible If its a static method.

* Its possible by inheriting from that class also.

* Its possible from derived classes using base keyword.


Question - 2:

In which cases you use override and new base?

Ans:

Use the new modifier to explicitly hide a member inherited from a base class. To hide an inherited member, declare it in the derived class using the same name, and

modify it with the new modifier.


Question - 3:

What is a private constructor? Where will you use it?

Ans:

When you declare a Constructor with Private access modifier then it is called Private Constructor. We can use the private constructor in singleton pattern.

If you declare a Constructor as private then it doesn't allow to create object for its derived class, i.e you loose inherent facility for that class.

Example:

Class A

{

// some code

 Private Void A()

 {

 //Private Constructor

 }

}

Class B:A

{

//code

}

B obj = new B();// will give Compilation Error

Because Class A constructor declared as private hence its accessibility limit is to that class only, Class B can't access. When we create an object for Class B that

constructor will call constructor A but class B have no rights to access the Class A constructor hence we will get compilation error.


Question - 4:

Can we declare private class in a Namespace?

Ans:

No. If you try to create a private class in a Namespace, Compiler will throw a compile time error "Namespace elements cannot be explicitly declared as private,

protected, or protected internal".

Reason: The message says it all. Classes can only be declared as private, protected or protected internal when declared as nested classes, other than that, it doesn't

make sense to declare a class with a visibility that makes it unusable, even in the same module. Top level classes cannot be private, they are "internal" by default, and

you can just make them public to make them visible from outside your DLL.


7/21/2023 12:14:00 am

Javascript interview Question

 ● What is Ecmascript in Javascript

● What is difference between let ,cons and var

● What is spread operator, Rest operator ,

default parameter

● What is deep copy and shallow copy in

Javascript

● What is promise , callback function , async await

in in Javascript

● What is difference between promise and

callback in Javascript

● What is event bubbling and event capturing in

Javascript

● What is higher order function in Javascript

● Explain different-2 types of function in Javascript

● What is arrow function in Javascript

● Why we use call, apply bind method in

Javascript

● How many way to create object in Javascript

● What is prototype inheritance in Javascript

● What is typescript

● What are the array method , string method

● What is difference between java and javascript

● What is throttling and debouncing in js

● What is Null and undefined in javascript

● What are the falsy values in javascript

● What is execution context, event loop ,stack,

call queue,microtask queue in Javascript

● What is setTimeOut and setInterval in Javascript

● What is object.seal and object.freeze in

Javascript

● What is difference between map and set in

Javascript

● What is Weakmap and Weakset in Javascript

● What is sessionStorage, localStorage , cookie,

● Write a program to sort an array

● What is use of json.stringify and json parse()

method in Javascript

● What are is map, filter , reducer in javascript

● What is generator function in Javascript

● How to stop event propagation in Javascript

● What is closure in Javascript

● What is housing in Javascript

● What is dead zone in Javascript

● What is function currying in Javascript

● What is mutation observer in Javascript

● What is memorization in javascript

7/21/2023 12:12:00 am

Css Interview Question

 What is difference between css and css3

● What are the selector in css

● What is media query in css

● What is different position in css

● What is bom in css

● What is difference between PX,unit,em,rem in

css

● What is flex box in css

● What is pseudo selector in css

● How to make website responsive

● What are breakpoint for viewport responsive

device

● Why we use box-sizing in css


7/21/2023 12:11:00 am

HTML interview question

 ● What is <!Doctype html> in Html5

● What is difference between div and span in Html

● What is semantic tags and non semantic tags in

Html

● What is difference between html and html5

● What is Iframe tag in Html5

● What are the formatting tags in html

● What is difference <b> and <Strong> in html

● What is view port attribute in html

● What is attribute in html

● What is block level element and inline element in

html

● What is difference between Html and Html5


7/21/2023 12:10:00 am

React Js Interview Question

● What is React js

● What is difference between virtual dom and shallow

dom, dom in React js

● What is controlled and uncontrolled component in

React js

● What is hooks in React js

● What is jsx, babel, webpack

● What is Redux

● What is reducer, action, store in Redux

● What is middleware in Redux

● Explain data flow in Redux

● What is Redux-Thunk

● What is Redux-Saga, Difference between

Redux-thunk and Redux-saga

● Difference between class component and function

component

● How can we implement componentWillUnmount in

function component

● useEffect,UseState, useMemo.useCallback hooks in

Details

● Explain lifecycle method in React js

● What is difference between export default and export

in React js

● What is portal in React js

● What is reconciliation in React js

● What is useRef in React js

● What is server side render in React js

● What is useStrict in React js

● What is fragment in React js

● What is react router in React js

● What is node module in React js

● What is the default localhost server port in react js.

how can we change the local server port

● What is high order component in React js

● What is pure component in React js

● What is difference state and props in React js

● How to optimize React js app

● What is difference between React js and Angular js

● What is prop drilling in React js how to overcome it

● What is context api in React js

● What is super, constructor, render function in React js

Thursday, 24 September 2020

9/24/2020 12:18:00 am

What should we do after hacked WordPress

We can follow the below steps after hacked WordPress:

Step1: Take the backup of Database, Uploads, and active theme

Step2: Make the list of active plugin

Step3: Setup the staging site on the local server with backup database

Step4: Activate all listed plugins and theme on the staging site

Step5: Move the uploads folder in the wp-content folder on the staging site

Step6: After that scan all files of WordPress, Theme, and plugin

Step7: After the move the file from local to server, please follow the below steps so that site will be not hacked again.


9/24/2020 12:16:00 am

Magento 2 – Create admin account via command line

Magento 2 provides different ways to create an admin account/user, we can create a new admin user from the admin panel and via the command line (CLI). Here is how to do it via CLI.

To create an admin user, Go to Magento 2 root folder, run the command:

php bin/magento admin:user:create

It will ask you: username, password, email, first, and last name. Fill all the details and the user will be created successfully.

For more information about the above command, you can use

php bin/magento admin:user:create --help

Usage: 
    admin:user:create [options]

Options:

–admin-user=ADMIN-USER(Required) Admin user
–admin-password=ADMIN-PASSWORD(Required) Admin password
–admin-email=ADMIN-EMAIL(Required) Admin email
–admin-firstname=ADMIN-FIRSTNAME(Required) Admin first name
–admin-lastname=ADMIN-LASTNAME(Required) Admin last name
–magento-init-params=MAGENTO-INIT-PARAMSAdd to any command to customize Magento initialization parameters

-h, –help Display this help message
-q, –quiet Do not output any message
-V, –version Display this application version
–ANSI Force ANSI output
–no-ANSI Disable ANSI output
-n, –no-interaction Do not ask any interactive question
-v|vv|vvv, –verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
    Creates an administrator


9/24/2020 12:14:00 am

Magento 2 – System Requirements

Magento is an open-source e-commerce platform written in PHP. It uses multiple other PHP frameworks such as Laminas and Symfony. In order to install Magento 2, a few specific server configurations must meet.

Operating SystemsLinux x86-64
Composer

Composer is required for developers who want to contribute to the Magento 2 codebase or develop Magento extensions.

Web ServersApache 2.2 or 2.4The apache mod_rewrite, mod_version, and env_module module must be enabled. (See Apache)
nginx 1.x(or latest mainline version)
PHP7.1.3+, 7.2.xMagento 2.3
7.0.4Magento 2.1.2 and later
7.0.2, 7.0.6 to 7.1.0Magento 2.1.x (all versions)
Not Supported:
PHP 7.1, 5.4Not Supported
PHP 7.0.5Known issue that affects code compiler.
Required PHP Extensions:
bc-math
curl
gd,
ImageMagick 6.3.7 (or later) or both
intl
mbstring
mcrypt
mhash
openssl
PDO_MySQL
SimpleXML
soap
xml
xsl
zip
Additional configuration:
safe_mode : off
memory_limit : 756M or more
DatabaseMySQL 5.6, 5.7
Compatible with MariaDB and Percona

Monday, 25 June 2018

6/25/2018 12:32:00 am

Drupal 8 Backend Specialist Exam Study Stuff.

Drupal Module Basics
  • Module programming fundamentals
  • Drupal code standards
  • Creating custom-programmed Drupal blocks
  • Implementing custom block access
  • Creating configurable blocks
Routes, Menu Links, and Services
  • Creating static and dynamic menu routes to map URLs to your custom page code
  • Adding and enforcing permissions and custom access callbacks
  • Defining menu links, local tasks (tabs), and action links
  • Altering routes and menu links from Drupal core and contributed modules
  • Using services with dependency injection
  • Creating your own services
  • Overriding and replacing services at runtime
The Database API
  • The module lifecycle: install, uninstall, update
  • Creating tables on module install: The Schema API
  • The static query API
  • The dynamic query API
  • Accessing external databases from Drupal
  • Using EntityQuery to query Drupal entities like nodes, users, comments, etc.
The Theme API
  • Using render arrays
  • Defining your own templates with Twig
  • Defining libraries of CSS and Javascript
The Drupal Form API
  • Creating forms in Drupal
  • Form validation and processing
  • Changing forms created by other modules
The Configuration and State APIs
  • Storing and retrieving configuration values
  • Providing default configuration with your module
  • Configuration schema
  • Storing runtime values with the State API
The Cache Metadata API
  • Using cache metadata to specify invalidation rules for cached render arrays
  • Understanding cache tags, max age, and cache contexts
  • Creating custom cache tags, and how to invalidated tagged caches
Reference URL study:


Drupalize.me reference video:
Fundamental web development concepts

Drupal core API


Debug code and troubleshooting


Theme Integration


Performance


Security

1.      Demonstrate ability to analyze and resolve security issues arising from site configuration
2.      Demonstrate ability to analyze and resolve security issues arising from site custom code
3.      Demonstrate the ability to implement Drupal core security mechanisms
4.      https://drupalize.me/topic/security

Leveraging Community

1.      https://drupalize.me/topic/contributing-drupal
2.      https://drupalize.me/topic/drupal-coding-standards
3.      https://drupalize.me/series/command-line-basics-series

Practical guide for stronger concept:

·        http://www.d8cards.com
General Guide concept:
·        https://github.com/WidgetsBurritos/d8-studyguide

Wednesday, 21 March 2018

3/21/2018 04:00:00 am

How to format pendrive through command line



First open the cmd the follow these steps given below:

  1. Diskpart
  2. list disk
  3. select disk
  4. clean
  5. create partition primary
  6. select partition 1
  7. active
  8. format fs=fat32 quick

Monday, 12 March 2018

3/12/2018 04:23:00 am

Free SSL certificates with Let's Encrypt

Introduction


I have show you how to set up a TLS/SSL certificate from Let’s Encrypt on an Ubuntu 16.04 server running Apache as a web server.


All steps given below one by one.

1. Before run these command take website backup.

2. Install the Let's Encrypt Client
   
      sudo add-apt-repository ppa:certbot/certbot

You'll need to press ENTER to accept.

3. Now update you ubuntu server.

    sudo apt-get update

4. Install Certbot from the new repository.

    sudo apt-get install python-certbot-apache

5. To execute the interactive installation and obtain a certificate that covers only a single domain, run the certbot command like so, where example.com is your domain
 
   sudo certbot --apache -d shashank.com

6.  If you want to install a single certificate that is valid for multiple domains or subdomains, you can pass them as additional parameters to the command. The first domain name in the list of parameters will be the base domain used by Let’s Encrypt to create the certificate, and for that reason we recommend that you pass the bare top-level domain name as first in the list, followed by any additional subdomains or aliases:

   sudo certbot --apache -d shashank.com -d www.shashank.com

7. Now SSL is install and your site running with https.

When the installation is finished, you should be able to find the generated certificate files at /etc/letsencrypt/live. You can verify the status of your SSL certificate with the following link (don’t forget to replace shashank.com with your base domain).

8. Download certificates. this url run on your browser with your domain name.

https://www.ssllabs.com/ssltest/analyze.html?d=shashank.com&latest


9. Verifying Certbot Auto-Renewal

Let’s Encrypt certificates only last for 90 days. However, the certbot package we installed takes care of this for us by running certbot renew twice a day via a systemd timer. On non-systemd distributions this functionality is provided by a cron script placed in /etc/cron.d. The task runs twice daily and will renew any certificate that's within thirty days of expiration.

To test the renewal process, you can do a dry run with certbot:

  sudo certbot renew --dry-run

Wednesday, 24 January 2018

1/24/2018 10:19:00 pm

User can delete own profile and its content

I've added my first #module at "Drupal.org" for #drupal 7. basically, this #module is created to so that authenticated users can delete their profiles.

URL: https://www.drupal.org/project/userprofiledelete

Install with #drush: drush en -y userprofiledelete;