SEO Interview Questions

What is SEO?
SEO or Search Engine Optimization is processing to rank your website or blog well.

A good rank means your website is indexed by search engines and will be found first if somebody searches the related keyword. The goal of SEO is to make your site reachable on www easily.

What are the techniques used for SEO?

There are two broad categories of SEO techniques:

  1. In page
  2. Off-Page

In-page SEO means content and page elements to be optimized for good rank and reachability.

Off-page SEO is to promote your sites on different platforms and submit artificially in directories.

What is In-Page SEO?

On-page, SEO is the Optimization of content in page and HTML elements that are scanned by crawlers of search engines.

Content should be unique, repetitive, error-free and without grammatical mistakes. The page must have a good title that can reflect your keyword and your goal to publish this page.

A good meta content and meta description help page in indexing.

What is Off-Page SEO?

Off-page, SEO is marketing and promoting your site. We have to promote our age for targeted audiences and demography.

What is Crawler?

The crawler is Web boat that scans the site content and structure and found the niche of writing.

Different search engines have different crawling algorithms but their goals are the same and that is to index the site as per the quality of contents and links.

What is PR or PageRank?

PageRank is an Analytical Method of Google to calculate the quality of content on the page. it shows How appropriate a page content is.

What is Indexing?

Indexing of a page or a website refers that the site is recognized by search engines. Now they will be reflected in search results.

What is a keyword?

A keyword is a single word or a phrase that highlights the center point of your content.

The whole content is all about this keyword.

We can say The keyword is a term and the content is the description of that word or explanation of those key phrases.

What is robots.txt?

Robots.txt is a text file used to give directives to the search engine crawlers.

These concerns the indexing and coaching of a webpage, directory, file or domain of a website.

What is meta-content and meta description?

The meta tag is placed inside the head tag in an HTML page.

A meta-content is an explanation of meta description and meta description is a keyword.

What do you mean by backlinks?

Backlinks as the name are the incoming links to your site or page.

They are submitted as an SEO process using off-page technique and when they are clicked, redirect to your website or blog.

Backlinks are the backbone of SEO. Google bot searches for links and this is a parameter to rank your page better.

What is the difference between do-follow and no-follow links?

Do-Follow means linking a website but allow the crawler to recognize that link. Do follow allow the link juice to gets passed. It helps to achieve a higher page rank. Do follow does not allow the link juice to gets passed. It does not affect the Page rank.

What is the purpose of robot.txt to be put in the root directory?

It is exclusion protocol.robot.txt communicates with the crawler and escapes the links that not follow.

What is organic traffic?

Organic traffic is a result of natural search results on search engine consoles. This is a better interpretation of good content and popularity over www.

Traffic coming from search results are organic because they are suggested by the crawler to visit this page for their search solution.

What is SEO friendly URL?

SEO friendly URLs are the URL without unnecessary characters that has a bad effect on Page Rank. Phrases should be separated by the dash and not by underscores. avoid using numbers, special characters, etc.

How does a good title help in SEO?

A good title means a title that is related to whole content and it allows the crawler to find the keyword. A search result listed the page title in its list.

What is the Google Search Console?

The Google Search Console is a free platform offered by Google to monitor a website. You will get free:

  • Crawl errors
  • Indexing data
  • Search queries
  • Backlinks information

You can also submit the XML sitemap

What is the main purpose of Search Engine Spiders and Boats?

Spiders index the contents of index sites. However, spiders do not examine sites for unethical activities.

I hope these collections of Search Engine Optimization will help in your interview. Please let us know your queries and feedback in the comment or through the contact page.

Thanks.

Spread the love

15 Advance Code Igniter Interview Questions and Answer


How routing is beneficial in Code Igniter?
Routing provides a way to alter your URL and redefine it according to you. It helps in security and SEO. We can create URL having keywords and phrases influential for SEO ranking.What is a helper?
Helpers are the file having functions for specific purposes. We can directly call them in our script.There is numerous type of helper:
  • Array Helper: It has functions that we use to manipulate arrays.
  • File Helper: Use of this helper is to play with files as upload an image.
  • HTML Helper : Html helper is used to compose HTML dom using php code.
  • URL Helper: We use it to create and construct or redirect URLs.
What does autoload.php do?

It loads when the application start loading contains and default parts of application call. It has information to load the segments that we need to load automatically. For example, we may need to load some models automatically.

How can we connect code igniter to our database?
There is a database.php file in the config directory. We can put here our database information like database name, hostname, username and password and It will be connected.

Can we call multiple model function in a single controller function?
Yes, of course. We can call any number of model and their functions in a single controller class?

Can we write database queries in a controller?
Yes, we can write database queries directly in controllers but this is not a good practice. We should write database queries always in the model.

How can we pass data to view?
We create an array having a particular key and pass this array to load view call. We will have this data on the view page as having the name of the key given to data array.

<?php
$data['employee']=array("name"=>"Dhananjay");
$this->load->view("employee_info",$data);
?>

Now on the employee_info.php page, we will have a $employee variable and that will store the data passed in the array $data in the controller.

How can we pass a parameter to controller function?
A parameter can be passed to URL segment after backslash next to function route. Suppose “admin” is a controller , “all_user” is a function and “active” is a parameter. Now we have to pass this to function that it can list the active user so we can call as given below:

<?php echo site_url("admin/all_user/active")?>

What is a library in Code Igniter?
Code Igniter library is a utility to extend the functionality and to use some predefined functions and classes. We have different libraries for different purposes as upload, database etc.

How can we execute a raw query in Code Igniter?
Using query builder library of code igniter we can execute raw query. For example,

db->query($sql);
$result=$query->result_array();
?>

What is URL helper?
We use URL helper to do manipulation with URL. We can easily create custom URL, we can extract parameters from URL, we can easily create custom anchors, form action, and page redirection.

How the database library provide strength to Code Igniter framework?
Database library has query builder functions. It works with single data and also in batch data. It accepts the array and single values as parameters. Functions are very similar to MySQL query phrases and keywords. We can use almost the query using query builder. It fetches the data in all possible formats. We can select, update, join, delete the records in very simple and robust way.

How we will submit data using a form on code igniter view?
We can give the controller function route as the form action. When we will submit this for, the controller function will be called and data will be collected using $_GET or $_POST arrays, as the method defined in the form.

How we create a session variable and how will we get that value stored in a session variable?
Code igniter has session library.It uses four types of the driver to store session data:
1-files
2-database
3-redis
4-Memcached
The file is the default storage.
After loading session library we can use session class and its method to set or get the session value.

<?php 
$this->load->library('session');
//set session data
$this->session->set_userdata('user_session_name', 'session_value');

//check session
$this->session->has_userdata('user_session_name', 'session_value');

//get session data
$this->session->get_userdata('user_session_name', 'session_value');

//destroy session data
$this->session->unset_userdata('user_session_name');
?>

How can we upload any file in Code Igniter application?
Code igniter has upload library. We will use this library and set preferences in $config variable.
After initializing library we use call do_upload() function and it will complete the task.

Spread the love

HTML Interview Questions and Answers for Freshers

HTML stands for Hyper Text Markup Language. We can not say that HTML is a programming language but a markup language. HTML uses markup tags and they are designed to perform some particular task. For Example, Paragraph tag p is used to include any paragraph in a web page, Anchor tag a is used to add a hyperlink in a page.
HTML is not only limited to design but also it has advanced and can be used to develop device compatible applications fro smart Television, Digital Advertisement Display etc.Whatever can be the server side language say JSP, ASP or PHP, Python or Ruby HTML will be the display part. When we are talking about a web page we are talking about an HTML page. Basically, it is part of Web Design and case insensitive. We can have following questions that can be asked in interviews:

What is HTML?
HTML is a markup language and used to design a web page using marking tags.

How can we create an HTML page?
We can create a plain text file and .htm or .html as an extension, it will be converted to the HTML page.

What is the basic structure of HTML page?
HTML page is devided in to three segments
(1) Document Type markup  that is  html
(2) Head and Title portion that is head and title
(3) Main Content or body portion

 <html>  

      <head>
           <title></title>
      </head>
      <body>
      </body>
 </html> 

What types of input tag are used nowadays?
There are many input tags introduced since HTML5. Some of the most used and popular input types are as below:

(1)text: this is used for alphabetical characters to input in the form.
(2)tel: this is used to input the telephone numbers
(3)date: date is used to input date.
(4)email: email is used to input date
(5)number: a number is used to input a number, negative, positive or zero
(6)textarea: Long text can be input using text area. For example, we can use to input the message in a contact form.
(7)Select type(combo): when we have to select from some options it may be multiple type selection.



How many methods are there for a form?

There are two methods for a form: get and post.

What is  br tag? 
It is called Break Line tag. When we have to break line in the paragraph we use Break Line tag.

What is meta tag?
Meta tag is a part of head section of a HTML page. It includes page information, content type information and device compatibility information. Meta tag helps page to be indexed in search engine directories.

How we can include a style sheet in an HTML page?
We can include a seperate style sheet using link tag inside head section.

 <link rel="stylesheet" type="text/css" href="style.css" />

What is arrtibutes of Tag?
Every tag has some advanced and customize features that developer can enhace. These features are known as arrtibutes. For example “bgcolor” is backgroud color , “font-style”,”width”,”height”,”align” etc. How the content will display it depends on the value given to different properties of tags.

What is table tag?
table tag is used to create a tabular structure to represent some statistical data in a web page. Table has number of rows and number of columns in each rows.

What are the arrtibutes of table tag?
Arrtibutes of table tag are as below:
1- Border
2- Width
3- Height
4- Align
5- Bgcolor etc.

What is the use of anchor tag?
Anchoe tag is used to create a hyperlink is a webpage. We can connect to pages on the site or any third pary link to our website. For exampe:

 <a href="www.facebook.com">Facebook</a>

List some attributes of anchor tag?
Attributes of anchor tag are as below:
(1)Href : What will be hyper link?
(2)target : where to open the link?
(3)title : what will be the title of tag, it will apear when mouse goes over link.

What is a div tag?
Div tag create a rectangular area in a web page. Further we can manipulate it using attributes and style. div tag is used to create layout of webpage.

What is form?
FORM tag is used to create a user form in web page to store user inputs. Input tags are used to collect the input values from user and form action hadle the request.

How to write a form tag in a web page?
We can include a form tag as given below:

 <form method="post" action="form-action.php">  
 <!---input elements--->
 </form>

What is marquee tag?
marquee tag is used to insert a moving element in the HTML page. For example, Notices are moving from left to right or top -bottom direction in an informational website.

Create a table having table head and foot?
We can create a table as given below:

 <table>  

      <thead>
           <tr>
                <th></th>
                <th></th>
           </tr>
      </thead>
      <tbody>
           <tr>
                <td></td>
                <td></td>
           </tr>
      </tbody>
      <tfoot>
           <tr>
                <td></td>
                <td></td>
           </tr>
      </tfoot>
 </table>


How Many types are lists?
There are three types of lists in HTML basically, as given below:
1- Unordered List  implemet by ul tag
2- Ordered list implement by ol tag
3- Data list implement by dl tag

What are the headings tag? What is the usage of Headings in HTML page?
HTML provides heading tags to implement document heading in the page. There are 6 headings H1, H2……H6.H1 has the biggest font size by default so we can use it as the main heading and other can be used as subheadings.

How can we include Javascript in HTML page?
We can include javascript code inside html page using  script tag. We can directly write code of javascript in pgae or we can use a seperate javascript page.

What is a responsive web page?
A responsive webpage is dynamic view page that is compatible to different types of display and orientation. To make a page responsive we use media query and view port acces to control orientaion and layout.

Spread the love

Most Common PHP-MySQL Interview Questions and Answers

There are some basic PHP Interview questions, asked in every interview often. They must be known to every interview aspirants.

Chances of asking these questions by Interviewer is very high because they just test your basic concepts of PHP. They highlight your understanding and command of the language. They are helpful to nail the first impression on the interviewer when you are in the interview.

An Interviewer expects that you should know the answers to these questions. After these questions, you will be asked to answer some hard-core questions and concepts.

What we have given here is experienced. these questions give you the pattern of often asked questions on Interviews along with their answers.

We try to give genuine answers, by verifying them from www.php.net, www.w3schools.com, and other popular tutorials site. After knowing the pattern It will be easy for you to explore more questions from various sources.

What is PHP?
PHP is a server-side scripting language. It is lightweight as well as enriched with OOPs features. PHP is freely available and has lots of frameworks, CMS to built robust and secure applications.

Explain these functions :
echo( ),print( ),print_r( ),die( ),exit( ),var_dump( )
var_dump($var):- Displays information about a variable.
echo() or echo: This is not actually a function.This doesn’t return a value after it takes parameter.
print() pritn : This is also not a function ,accepts always single parameter and returns 1.
print_r():-This prints the content and indexes of arrays and objects.
exit:-It terminates the current script with a message.
die(): This is identical to exit;

What are the differences amongst include(), require(),require_once(), require(),include()?
include(): Includes an external script into current script. On failure it emits Warning and allows script to continue, it does not terminate the execution of the script.
include_once(): On failure emits an compile E_COMPILE_ERROR  error. It terminates the script execution.

What is the difference between in_array() and is_array()?
Both of these function returns a boolean type.
in_array() :
If a value finds within an array it returns TRUE otherwise returns false.
is_array() :
It checks whether the type of variable is an array or not. It returns true if an array is passed into it. It can be applied to any type of array.

What is the difference between count() and sizeof()?
Literally we can say there is no difference between these two terms. Both of these have Identical behaviors.
count():- It counts all elements of an array or object.
sizeof():-Identical to count(), can say Alias.

What is the difference between json_encode() and json_decode()?
json_encode() converts a PHP array or an object into json string, and json_decode() convers an JSON string into PHP array or into PHP object.

Where do we store Session and Cookie?
The session is stored on the server whereas cookies are stored on the client machine in browsers.

How we use foreach loop in PHP?
Foreach loop is used to iterate an array or an object in PHP. For example

<?php 
foreach ($array as $key =>; $value){
echo "$value is at $key place";
}
?>

What are the differences amongst trim(),ltrim(),rtrim()?

  • trim():-It removes white spaces from both the sides of a string.
  • ltrim():-It removes white space from the left side of a string.
  • rtrim():-It removes white space from the right side of a string.

What are the constants , how we define them in PHP?
A constant is a name assigned to a value. It is like Identifiers but cannot change during script execution. We can define them usually in UPPER_CASE underscored string without $. For example: define(“CURRENT_YEAR”, “2017”);


What is $_GLOBAL?
$_GLOBAL Is a superglobal array and holds all the variables that are global and can be accessed from anywhere in the script. $_POST,$_GET,$_REQUEST,$_FILE,$_SESSION,$_COOKIE all are superglobal arrays available in PHP. We can call them anywhere in the script.


What is the difference between MySQL and mysqli?
MySQLi is the extension of MySQL and It is an improved version of MySQL. MySQLi supports OOPS features and compatible with PDO.


What unlink() function do in PHP?
It is used to delete a file or directory from its location.

What are the basic differences amongst Warning, Fatal Error, and Notice?
Fatal error results in the termination of the script, no further execution of the script is possible when it happens. Whereas Notice does not terminate the script, rather it notifies about some tolerable mistake and script after that line is able to execute. Warnings are the deprecated and bearable things in scripts. This doesn’t affect the result usually.

Which function is used to send email in PHP?
The mail() function is used to send emails in PHP. Learn more about The PHP mail() Function.

What is the difference between array_diff() and array_filter()?
array_diff() returns the array of values of difference of two arrays and array_filter() returns the arrays of values and filter null values or specific values. The function array_filter() also used a callback function but it is optional.


What is the difference between array_serach() and in_array()?
The method array_search() returns the key if the value is found in the array and the function in_array() return TRUE if it will find the values in the array. In case of a failure, both functions return FALSE.


What strlen() do?
strlen() is a PHP library function and it returns the length of string passed to it.


How substr() works?
substr() is a PHP library function and it returns the part of string passed with parameters to it. It accepts starting point, length of returning string and input string as parameters.


How str_replace() works?
It is used to replace a sub-string with another substring in an input string.

 

Spread the love

Top 10 Interview Questions and Answers for PHP freshers

What is difference between $_GET and $_POST?
$_GET stores data sent by HTML form ‘get’ method or the value of variable encoded with URL whereas the $_POST collects the data submitted by “post” method of HTML form. $_GET has a character limit whereas no such limit defined by PHP for the POST.


How many types of array are there in PHP?
Basically, there are three types of arrays in PHP
1- Indexed arrays
2- Associative arrays
3- Multidimensional Arrays


How to convert a string into array and vice-versa?
We can cover an array into a string and a string into an array using explode() and implode() methods.These methods use some delimiter to concat values of arrays and also at the time of splitting a string into an array.

How you can find IP address of Local machine accessing PHP sites?
PHP has a number of superglobals.$_SERVER has some autodetected values. We can use this variable to get the IP address as given below:

1
$_SERVER[‘REMOTE_ADDR’] ; ?>



In how many ways we can fetch data from MySQL database?
There are four standard ways to fetch data from MySQL database in PHP. They are listed below:
1-mysql_fetch_array()
2-mysql_fetch_assoc()
3-mysql_fetch_row()
4-mysql_fetch_object()

Is PHP an Open Source?
Yes, PHP is absolutely free, and it is an Open Source.It can be used under GPL.

Does PHP supports OOPs Features?
Yes, PHP is a full-featured server-side scripting language and enriched with Object Oriented Programming system approach. We can define a class, constructor. We can create Objects and can implement oops features like Abstraction, Polymorphism, Inheritance, and Encapsulation.

What is the difference between array_merge and array_combine?
We can differentiate between the two terms while understanding their definitions.
array_merge(): Merge Elements of arrays in a single array while preserving their indexes. But array_combine() returns a new array where values in one array are keys in new arrays and values of another array values in new arrays.

What is the Latest stable version of PHP and MySQL?
You should check these things before your Interview because the version the things are updating frequently.
For PHP: www.php.net
For MySQL: www.mysql.com

Spread the love

OOPS interview questions and answers

What is OOPS(Object Oriented Programming System)?
OOPS, that is Object Oriented Programming System is a modularized system of programming. Chunks of programs are designed in such a manner that we can reuse them, modify them and also can rework on them.


What is a class?
A class is a collection or a group to represent similar type entities having identical properties and behavior.A class does not exist in physical but a concept to visualize real-world entities.


What is an object?
An object is a blueprint of a class. It is a prototype what class defines. When we have a working object we can say it is an instance.

How can we differentiate between Procedural Programming System and OOPS?
An object-oriented language is based on modules that are Object but procedural programming has no such concepts.
OOPS is able to encapsulate data and member functions in a single block but procedural programming language represents a discrete structure.
A procedural language is based on top-down approach whereas object-oriented language is based on the bottom-up approach of the algorithm.
A procedural language is rigid in nature, but OOPS provide flexibility and reusability of code.

What are the basic pillars of OOPS?
Fundamental pillars of OOPS and are as follows:
1-Abstraction
Hiding the sensitive data or the way of implementation, but revealing the necessary data to the end user.It limits the scope of variables, methods.Abstraction is to implement the security features in OOPS and so in application.
2-Encapsulation
Encapsulation is the wrapping of data and data functions in a single block of codes. It contains the data definitions and behavior definition in a single block that is Class.
3-Inheritance
Inheritance provides flexibility features to OOPS. It allows a class to share its functions, variables to other classes and the classes that will be using the functions definitions and data variables of other class called child class, and this phenomenon is called Inheritance.
4-Polymorphism
Polymorphism is a way to reimplement the methods in child-class or in a subclass that is already implemented in the parent class.It gives flexibility to an object to represent it and to use its many forms as per the function definitions in classes.


What is a constructor in OOPS?
The constructor is a method which is called automatically when an Object of a class is instantiated.The constructor has the same name as that of the class and it does not return.


What is the basic difference between overloading and overriding?
Overloading
When two methods are defined with the same name in a single class but they must have different signatures, then this phenomenon is known as Overloading.
overriding
When a method defined in the parent class is reimplemented by subclass or child class, then this phenomenon is known as overriding.


Difference between class and an object?
A class is a definition and object is a prototype of that definition.An object contains states and behaviors and a class is a template of an object. An object is an instance of a class and it is working model of a definition that we can call a class.


What are the specifiers?
Specifiers or modifiers define the scope of variables and methods in OOPS.They implement a secure structure and access level in the architecture of an application.There is some important access specifiers are as follows:
Private:
Restricts the access to the class itself. Even Child or subclass are also not allowed to use private functions and data.
Protected:
A protected function or variable or member is accessible within the class and within the child class or subclass only. It cannot be accessible from anywhere else.
Public:
It provides an open accessibility to members. Either within the class or within child class or from anywhere in the script, It will be accessible.


What is a destructor?
the destructor is a function which can be called automatically when an object is deleted.

Spread the love

Code igniter Interview Questions and Answers

What is MVC?
MVC is a three-tier architecture of application development approach.Almost the popular languages use this pattern. MVC provides Modular structure to an application. Three interconnected parts are Model, View, and Controller.
M: Model, that means data handling and information interchange. Implement CRUD.
V: view i.e. front end and representational parts, where user interacts with machine
C: Controller, The business login, handle user request an passes to model and in return provide results to the user.

What is difference b/w MVC and HMVC?
HMVC is a hierarchical MVC, The whole application is modularized in interconnected modules and each module has its own MODEL, VIEW, CONTROLLER. In HMVC a module is a complete package of User Interface, business logic, and data handling. So MVC is discrete whereas HMVC contains MVC at each level.

How we can load a model in CI controller?
We can call load a model in the constructor as given in the following example:

1
2
3
4
//load model $this->load->(‘users_model’,’users’);
//call model
$this->users->add_new_user($data);
?>

We can also assign an alias to ci_model. We can use ‘users’ to call a model rather than calling ‘users_model’.

What is autoload.php in the config?
This is a file where preloaders are defined. Suppose we want to include database library, any model, URL library, sessions etc, then we can assign all these things here.

What helpers do in CI?
Helpers are the simple PHP functions returning some values and we can call them anywhere in our project once we initialized them.

What are the libraries in CI, explain some popular libraries?
The library is the packages which are designed to implement a particular set of functionalities. For example Database. Once we Initialized it, we do any operation on the database.

What are Hooks?
Hooks provide flexibility to CI core. We can modify the core functionality of CI without disturbing core files and use hooks.Learn more about Hooks in CodeIgniter

How we define URL and redirect in CI?
We use URL helper and then we can create redirect links :

1

these functions provide the way to create URL.

How to write a SELECT query in CI model?
We can write a select query in code igniter using the standard conventions of CI as given below:

1
2
3
4
//table name ‘users’ $this->db->select(‘users’);
$query=$this->db->get();
$result=$query->result();
?>

How to call a CI model Controller?
The following example illustrates, how to call a model in code igniter controller:

1
2
3
4
//load model $this->load->(‘users_model’,’users’);
//call model
$this->users->add_new_user($data);
?>

What are the views?
A view is the display part of the application. It renders the results on screen and provides UI.We can assemble views files in directories as well.

How we define controller in CI?
A controller is the backbone of MVC. It creates a connection between model and view.We can define a controller as illustrated:

1
‘BASEPATH’) OR exit(‘No direct script access allowed’);


How controllers and models are different?
Controllers deals with business logic. When user Instruct the machine to do something, controller listens to that response while interaction another side with a model for data. Whereas a model is data handling layer. It saves data to the database and it requests data from the database that further goes to the controller to display on view.

What is the convention to call controller function with a parameter in CI?
We can call a controller function in uri using the a pattern given below. First part of URI is base URL. Base URL followed by controller route and followed by function name , parameters.
base_url/controller_name/controller_function/param1/param2
[Controller Class]/[controller methos]/[parameters]

How to write JOIN Query in Code Igniter?
Code Igniter has a very rich Database library. It provides a flexible way to call and create logics. Either we can use raw queries or we can use join() function.

1
2
3
4
5
6
$this->db->select(‘t1.name,t2.email’);
    $this->db->from(‘table1 as t1’);
    $this->db->join(‘table2 as t2’, ‘t1.id = t2.user_id’, ‘left’);
    $query = $this->db->get();
    return $query->result();
?>

How to apply where clause in Code Igniter?
Using Code Igniter Database library function ‘where()’ we can apply where clause.

1
2
3
4
5
6
7
8
$where=array( ’email’=>me@example.com,
‘status’=>’active’
);
$this->db->select(‘name,email,mobile’);
$this->db->get(‘users’);
$query=$this->db->where($where);
$result=$query->result();
?>

What is routing?
Routing is a way to define URI and how to call controller methods with a particular URI.
Routing provides flexibility to change the way we call controller functions. We can rename controller and functions. This enhances the security features as well as we can create SEO friendly URLs.

What is the way to fetch query results in CI?
Ther are many ways to fetch result in Code Igniter. Some of them are as follows:
result();
result_array();
row();
row_array();
unbuffered_row();

How we call controller method using AJAX?
Simply we can call the URL using proper method and parameters, and then handle those request on a controller and if required we can render a view.

How to define a session variable in CI?
First of all, we need to load session library and then we can call some library functions to accomplish this task:

1
2
3
4
//load library $this->load->library(‘session’);
//define a session variable named ‘user_id’
$this->session->set_userdata(‘user_id’, $user_id);
?>

 

Spread the love

WordPress Basic Interview Questions and Answers

 What is WordPress?

WordPress is a content management tool and available as an open source. It is based on PHP-MySQL application.Nowadays WordPress is used for blogs, informational sites, e-commerce store, learning management system, booking systems and for various applications.
What is a CMS?
A CMS is a tool to manage content for a website. It provides the dynamic functionality to change, add design. A CMS can be used to manage various type organized data. WordPress is the most popular CMS.

What is the latest stable version running of WordPress?
Wordpress updates frequently. It has a giant community of contributors and a team of world-class programmers and Technocrats. We can find the latest version on www.wordpress.org.
What is difference between wordpress.org and wordpress.com?
wordpress.org provide the official software, themes, plugins, documentation of WordPress. Whereas wordpress.com is a hosting service. You can host your free blogs and sites on wordpress.com. it has pre-installed WordPress latest version.
What is a post in WordPress?
A post is an article that you publish on your blog.Post make a sense of blogging. here you can publish your day to day activity, articles, notifications.
What is a page in WordPress?
Pages are the landing pages that remain static on the website. Like, contact us, about us, team, Homepage.
What are the features of WordPress that make it most popular CMS?
What is a plugin in WordPress?
A plugin is an executable code snippet, that enhances the WordPress functionality. WordPress has unlimited flexibility to modify its functionality and to add new functionality. We can add features to WordPress without touching the core of software and plugins do that. We have plugins for various purposes. For example, Contact Form, Google Map, gallery, Menu, Font style, Slider etc.
What is custom post type – CTP ?
Wordpress has the flexibility to define the content type. It has Post and Page as the core, but we can create our own content type. This is called Custom Post Type or CTP.
What is taxonomy?
Taxonomy is a term that uses a word to group the contents and content types.We have a category, tag, Link Category, Post formats as default taxonomies.
Which types of application we can develop using WordPress?
Wordpress is used for varieties of applications like Informative Websites, E-commerce, Learning Management System, Ticket Booking Management, Hotel Booking, and rental, Printing Customization, news and media channel websites, Forums etc.
What is woo commerce?
Woocommerce is a plugin that converts a simple WordPress site into a fully functional e-commerce portal.
What is a theme in WordPress?
A theme is a complete package of application that changes the functionality, UI of the WordPress site as defined inside it. A theme contains Stylesheets, templates, javascript, function file, header, footer, page and post page.
What is style.css in WordPress?
The main style sheet of the theme is style.css by default. It also contains the theme Information.This is one of the mandatory parts of a theme.
What is a child theme in WordPress?
A child theme is an option to modify a theme, without changing its core files.
What are widgets in WordPress?
Widgets are the UI segments that are replaceable and easily manageable from admin side.A widget is dragged and dropped into the widget area. The widget provides additional flexibility to templates.
What is a hook? What are the difference between actions and filters in WordPress?
Hook allows us to hook a function with WordPress native functions.There are two types of hooks (1) Action and (2) Filter.Actions are the post events functions. they are followed by some other functions. For example, we can add an action to recent post display and It will be called when the recent post function will be called. Filters are the rewriting of functions. A filter modifies the function with that it will be hooked.
How can we export content from a WordPress site?
Wordpress has inbuilt tool for export and import contents. We can import content using XML file or we can export our content to an XML file.
Where we will find the menu section in admin?
We can find the menu section in the appearance section. We can manage various types of menu and their location from here. We can add items or remove items from the menu.
Does WordPress produce SEO friendly URLs?
Wordpress possesses a very strong in-page SEO feature. It has the option to modify the URL and make it SEO friendly. We can also modify meta content, title etc.
What is permalink?
Permalink is URL of post, page, media etc. We can modify it while editing the post or page.
What is a meta in WordPress?
Meta provides a metadata type structure for WordPress. We can add additional fields and their values using meta.
What is the usual meta used in WordPress?
There are many types of meta in WordPress as post meta, user meta, term meta, comment meta.
What are the default roles exist for WordPress users?
There are 5 default roles exist in WordPress are:
1-Administrator,
2-Subscriber,
3-Contributor,
4-Author,
5-Editor
Is WordPress an open source?
Yes, WordPress is an Open Source and freely available to use under GPL.
What server-side scripting language used by WordPress?
PHP is used as the serverside scripting language in WordPress.
What are the templates in WordPress?
Templates are the different types of page layout in WordPress. We can choose one of them while posting or adding content.

Spread the love

PHP array Interview Question and Answers

What is an array?
An array is a collection of data in a sequential manner. In PHP an array may hold many types of data.


How to define an empty array in PHP?
There are many ways to define arrays in PHP

1
2
$cars=[];
$cars=array();
How to check that a variable is an array in PHP?
There is library method to check, whether a variable is an array or not.
is_array($variable); – the function accepts a variable as a parameter and returns Boolean. If variable passed in it is an array it returns TRUE.


How to check the size of array?
We can find the size of an array using sizeof() function.


How many types of arrays are there in PHP we use?
Usually, there are three types of arrays in PHP:
1- Indexed Array
2- Associative array
3- Multidimensional Array
How can we add new value into an array in rum time?
We can do this using php method array_push(). There is another way we can simply assign new value to array and it will hold the next index. For example
1
2
3
4
5
$car=array(‘BMW’,’Benz’);
$car[]=’Toyota’;
$car[]=’Sujuki’;
?>
And finalil it will print: BMW,Benz,Toyota,Sujuki.
How can we remove a value from an array in PHP?
We can remove a value from an array in php using unset() method. We have to unset the index of that value.Suppose we have to delete ‘BMW’ from above array, then we have to unset the index of ‘BMW’ and tht is 0, so It will be as :
1
2
3
unset($car[0]);
?>
Demostrate foreach loop on a PHP array.
We are assuming that we have to print the name of cars in list using foreach loop. So we can do this as given in code snippet:
1
2
3
4
5
foreach($car as $key=>$value){
    echo “This a brand new “.$value;
    echo ”
“;
}?>
What will be the output when we execute the PHP code given below?
1
2
3
4
$array=array(1,2,3,4,5,6,7,8);
echo sizeof($array);
?>
OUTPUT:
Out of the above code will be the size of array. It will be 8.
How to sort an associative array in ascending order, according to the value?
We can use PHP library function asort(). This will sort the array in ascending order. In descending order, we will use arsort(). These functions return sorted arrays.
What is the function that we can use to remove the duplicate valuse from array in PHP?
PHP has array_unique() function to remove the duplicate values from array.
1
2
3
4
5
6
$fruits=array(“a”=>”mangow”,”b”=>”orange”,”c”=>”apple”,”d”=>”mangow”);
print_r(array_unique($fruits));
?>
?>
We aill get a list of uniq values.
How we can find an array of keys of another associative array?
Pass an associative array in function array_keys() and this will return an array of keys.
Spread the love

Top Interview Questions and Answers

Exit mobile version