Showing posts with label interview questions. Show all posts
Showing posts with label interview questions. Show all posts

Friday, July 20, 2018

phpMyPassion

Top CSS Interview Questions And Answers for Freshers.

Top css interview questions and answers for freshers & experienced || PhpMyPassion

Here I am sharing most asked CSS interview questions and their answers for  beginners. This list of CSS interview answers surly helpful for CSS beginners or web designers who just want to began their profession as a web designer. I recommend read out these interview questions before the interview. 

Question #1 - What is CSS?
CSS stands for Cascading Style Sheet. It is a popular styling language that is used with HTML to design web pages.

Question #2 - What is the latest version of CSS?
As of now CSS latest version is CSS3 . Latest Features of CSS3

Question #3 - What are the different types of CSS?
There are three types of CSS.
  • Inline CSS : Inline Style Sheet is used to style only a small piece of code.
  • Internal CSS : Embedded/Internal style sheets are put between the <head>...</head> tags.
  • External CSS : This is used to apply the style to all the pages within your website by changing just one style sheet.
Question #4 - What is CSS selector?
It is a string that identifies the elements to which a particular declaration will apply. It is also referred as a link between the HTML document and the style sheet. It is equivalent of HTML elements. For More Follow

Question #5 - What is the difference between class selectors and id selectors?
There are two difference between class selectors and id selectors as below.
  • A class selector is a name refenced by a full stop (“.”) and an ID selector is a name refenced by a hash character (“#”).
  • An ID can be used to identify one element, whereas a class can be used to identify more than one.
Question #6 - What is Responsive Web Design?
Responsive web design is a technique that render all website pages differently on different sizes of devices. 
The purpose of responsive design is to have one site, but with different elements that respond differently when viewed on devices of different sizes.

Question #7 - What is the CSS Box model and what are its elements?
The CSS box model is used to define the design and layout of elements of CSS.
The elements are as below:
  • Margin
  • Border
  • Padding
  • Content
Question #8 - Explain the difference between visibility: hidden and display: none?

visibility: hidden
simply hides the element but it will occupy space and affect the layout of the document.

display: none
also hides the element but will not occupy space. It will not affect the layout of the document.

Question #9 - What is the z-index and how is it used?
The z-index property in CSS controls the vertical stacking order of elements that overlap. As in, which one appears as if it is physically closer to you. z-index only effects elements that have a position value other than static (the default).
The z-index default value is zero, and can take on either a positive or negative number.

An element with a higher z-index is always stacked above than a lower index.
Z-Index can take the following values:
  • Auto: Sets the stack order equal to its parents.
  • Number: Orders the stack order.
  • Initial: Sets this property to its default value (0).
  • Inherit: Inherits this property from its parent element.
Question #10 - What are some of the common lists that can be used when designing a page?
Basically, HTML used some of the common lists these are following:-
– Ordered list
– Unordered list
– Definition list
– Menu list
– Directory list
Each of this list types makes use of a different tag set to compose.

Question #11 - Advantage of collapsing white space?
- This enables the designers to mastermind the HTML code in an efficient and intelligible organization.
- The browser collapses the multiple white spaces into a single white space in HTML.

Question #12 - What is the float property of CSS?
Float property is used to align the image to the right or left along with the texts to be wrapped around it. It doesn't change the property of the elements used before it

Question #13 - What is the difference between CSS2 and CSS3?

CSS3 is the advance level of CSS2.0. In CSS3 we have new properties - border radius, box shadow, text shadow, multiple background images, gradient , animations, transition, transform and much more.

Question #14 - What is the syntax to link external style sheet?

Syntax :-

<HTML>
<HEAD>
   <LINK REL=STYLESHEET HREF="Test.css" TYPE="text/css">
</HEAD>
</HTM

Question #15 - How embedded/internal style can be linked with HTML documents?

You can linked as below:-
<HEAD>
<STYLE TYPE=”text/css”>
style {text-indent: 15pt;}
style1{text-color: #060000;}
</STYLE>
</HEAD>

Question #16 -What are advantages of using CSS?
There are several advantages of CSS. as below -
  • CSS saves time.
  • Pages load faster.
  • Easy Maintenance.
  • Superior style to HTML
  • Multiple device compatibility.
  • Platform independence.
Question #17 - What are the components of CSS style?

There are three components of CSS style.
  • Selector − A selector is an HTML tag at which a style will be applied. This could be any tag like <h1> or <table> etc.
  • Property − A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc.
  • Value − Values are assigned to properties. For example, color property can have value either red or #F1F1F1 etc.
Question #18 - What Property is used to make a font italic or oblique
You can use font-style property to make a font italic or oblique.
example:- #anchor{font-style:italic;}

Question #19 - What property is used to increase or decrease the size of a font?
You can use font-size property to increase or decrease the size of a font.
example :- #anchor{font-size:14px;}

Question #20 - what property is used to set the color of a text?
When you use image maps, it can easily become confusing and difficult to determine which hotspots corresponds with which links. Using alternative text lets you put a descriptive text on each hotspot link.

Question #21 - what property used to align the text of a document?
HTML techniques sends ask for utilizing get a post strategy. GET post ask for information from the server and POST is utilized to submit information to the server.

Question #22 - What bullet types are available?
With ordered lists, you can select to use a number of different list types including alphabetical and Roman numerals. The type attribute for unordered lists can be set to disc, square, or circle.

Question #23 - What property is used to underline, overline and strike through text?
The text-decoration property is used to underline, overline, and strikethrough text.

Question #24 - What property is used to capitalize text or convert text to uppercase or lowercase letters?
The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters.

Question #25 - What property is used to set the text shadow around a text?
The text-shadow property is used to set the text shadow around a text.

More About Interviewing:

Read More

Monday, February 19, 2018

phpMyPassion

Basic PHP Interview Questions and Answers for Freshers

Here I am sharing top most asked basic PHP interview questions and answers for freshers that will helpful for freshers to get a job. All questions are related to PHP programming language so do prepare before the interview.

Question #1 - What is PHP?

PHP is an open source server side scripting language mostly used for web applications. Its easy to learn compare to other programming language. PHP also a object oriented programming language like java, .net and c++.

Question #2 - Who is the father of PHP and when it is developed?

PHP was developed in year 1994 by Rasmus Lerdorf.

Question #3 - What is the use of "echo" in php?

Mainly "echo" used to print a data on screen, for an Example: <?php echo 'This is my first website'; ?> , if we run it on browser, it will print the text on the screen.
Question #4 - How to include a file to a php page?

We include a file using "include('filepath.php') " or "require('filepath.php')" function with file path as its parameter.

Question #5 - What is the difference between PHP4 and PHP5?

Below are the difference :-

Sr. No.
PHP4
PHP5
1.
PHP4 doesn’t support oops concepts
PHP5 supports oops concept
2.
Error handling is not good
Error handling is better
3.
PHP4 doesn’t show the function parameter hint.
PHP5 supports function’s perameter
Question #6 - What's the difference between include and require?

If the file is not found by require(), it will cause a fatal error and stop the execution of the script. If the file is not found by include(), a warning will be generate, but execution will continue.

Question #7 - Differences between GET and POST methods ?

We can only send 1024 bytes through GET method but by POST method can transfer large amount of data and POST is also a secure method than GET method .

Question #8 - What is the use of 'print' in php?

Print commonly used to print text on screen like echo but print has a return type.  you can use with out parentheses with its argument list.
Example 
print('50 PHP Interview questions'); 
print 'Job Interview questions ');

Question #9 - What is the difference between echo and print

Below are the difference between echo and print :-

  • Print has a return type value while Echo doesn't return any value.
  • Echo is faster then Print.
  • In Echo you can pass multiple argument while single argument can be pass in Print.

Question #10 - what is the use of isset() in php?

isset() function is used to ensure if a variable is set and is not NULL

Question #11 - What is the difference between $var and $$var?

Both are and just like a variable only difference is $var is only a variable while $$var is variable in a another variable. for an example -
$var = 'love';  //only a variable
$$var = 'PhpMyPassion.com';  // a variable that contain another vairable

means ${$var} where $var is equals to 'love'; so we can say $love is equals to $$var

Question #12 - What is the maximum  filesize that can be uploaded in PHP and how can we increase it?

The maximum size of a file that can be uploaded is set 2MB By default. if you want to change, you can do that by changing the maximum uploaded size value inside php.ini file set by upload_max_filesize = 5M and restart all the services.

Question #13 - How can we get the value of current session id?

You can get the current session id by using session_id() function in PHP.

Question #14: How to identify server IP address in PHP?

you can identify server IP address by using $_SERVER['SERVER_ADDR']; 


Read More

Tuesday, February 13, 2018

phpMyPassion

Top 35 Frequently Asked PHP Interview Questions And Answers for 1 year experience

According to my experience here I am sharing top 35 frequently asked PHP interview questions and answers for 1 year experiences PHP developer, This list of PHP interview questions and answers will be helpful for PHP experience developer.



Question #1 - What is the difference between $message and $$message?

They are both variables But $message is a variable with a fixed name. $$message is a variable whose name is stored in $message. For example, if $message contains "var", $$message is the same as $var.

Question #2 - How to include a file to a php page?

We include a file using "include('filepath.php') " or "require('filepath.php')" function with file path as its parameter.

Question #3 - What's the difference between include and require?

If the file is not found by require(), it will cause a fatal error and stop the execution of the script. If the file is not found by include(), a warning will be generate, but execution will continue.

Question #4 - Differences between GET and POST methods ?

We can only send 1024 bytes through GET method but by POST method can transfer large amount of data and POST is also a secure method than GET method .

Question #5 - require_once(), require(), include().What is difference between them?

require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page). So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error.

Question #6: How to get the location of php.ini?

You can get the location of php.ini by using <?php phpinfo(); ?> code.


Question #7 - Differences between GET and POST methods ?


We can only send 1024 bytes through GET method but by POST method can transfer large amount of data and POST is also a secure method than GET method .

Question #8: How to identify server IP address in PHP?

you can identify server IP address by using $_SERVER['SERVER_ADDR']; 

Question #9: What is use of header() function in PHP ?

Header() function is mostly used to Redirect from one page to another -

<?php header("Location:page.php"); ?>

Question #10 - What type of inheritance supports by PHP?

There are following type of inheritance 

  • Single Inheritance - Support by PHP
  • Multiple Inheritance - Not support
  • Hierarchical Inheritance - Support by PHP
  • Multilevel Inheritance - Support by PHP
Question #11 - What is the use of 'print' in php?

Print commonly used to print text on screen like echo but print has a return type.  you can use with out parentheses with its argument list.
Example 
print('50 PHP Interview questions');  
print 'Job Interview questions ';

Question #12 - What is the difference between Session and Cookie?

Both are used to store user information on server. The main difference between sessions and cookies is that sessions are stored on the server, and cookies are stored on the user's computers in the text file format. Cookies can't hold multiple variable while session can hold multiple variables..We can set expiry for a cookie,The session only remains active as long as the browser is open.Users do not have access to the data you stored in Session,Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity tracking

Question #13 - How to set cookies in PHP?

We can set cookies like Setcookie("user", "ram", time()+3600);

Question #14 - How to create a session? How to set a value in session ? How to Remove data from a session?


Create session : session_start();
Set value into session : $_SESSION['USER_ID']=1;
Remove data from a session : unset($_SESSION['USER_ID'];

Question #15 - What are different type of sorting functions in PHP?

sort() - sort arrays in ascending order. 
asort() - sort associative arrays in ascending order, according to the value.
ksort() - sort associative arrays in ascending order, according to the key.
arsort() - sort associative arrays in descending order, according to the value.
rsort() - sort arrays in descending order.
krsort() - sort associative arrays in descending order, according to the key.
array_multisort() - sort the multi dimension array.

Question #16 - What is the use of explode() function ?

This function is used to split a string into an array. Syntax : array explode( string $delimiter , string $string [, int $limit ] ); 

Question #17 - What is the difference between explode() and split() functions?

Split function splits string into array by regular expression. Explode splits a string into array by string.
Both function are used to breaks a string into an array, the difference is that Split() function breaks split string into an array by regular expression and explode() splits a string into an array by string. explode() is faster than split() because it does not match the string based on regular expression.  


Question #18 - What is the use of mysql_real_escape_string() function?

mysql_real_escape_string() function mainly used to escapes special characters in a string for use in an SQL statement

Question #19 - How to redirect a page in php?

we can redirect a page by using header("Location:index.php"); function.

Question #20 - How to find the length of a string?


we can use strlen() function to find the length of a string
Question #21 - what is the use of isset() in php?

isset() function is used to ensure if a variable is set and is not NULL

Question #22 - How to delete a file from the system

we can delete a file by using Unlink() function in php.

Question #23 - what is the difference between javascript and PHP ?

Commonly JavaScript known as Client side scripting language while PHP is a server side scripting language.

Question #24 - What is MIME? 

Full form of MIME is "Multi-purpose Internet Mail Extensions".
It is extension of e-mail protocol helps to exchanges the different kids of data files over the internet.
Data files may be audio, video, images, application programs and ASCII etc.

Question #25 - How to create a mysql connection?

we can create connection by using function mysql_connect(hostname,username,password,database);

Question #26 - How to select a database?

we can select database by using mysql_select_db($db_name); function and we can also select a database by using function mysql_query('use databaseName'); 


Question #27 - How To Select The nth Highest Record In MySQL?

The query to get the nth highest record is as follows:


SELECT 
    *
FROM
    table_name
ORDER BY column_name DESC
LIMIT n - 1, 1;

Question #28 - What is the difference between mysql_fetch_array() and mysql_fetch_assoc() ?

mysql_fetch_assoc() function Fetch data as an associative array, While mysql_fetch_array() fetches data as an associative array, a numeric array, or both

Question #29: What type of inheritance does not support by PHP ?

Only Multiple Inheritance does not support by PHP.


Question #30: What is PEAR?

PEAR stands for PHP Extension and Application Repository. PEAR is a framework and repository for re-usable PHP components.

Question #31: How to get duplicate values from array?


you can get duplicate values from an array by using array_diff_assoc($arr, $arr_unique); for an example :


<php 
         $arr = ('anil','anil','sonia','monica','sunita','sunita','raj');
         $arr_unique = array_unique($arr);
         $arr_duplicates = array_diff_assoc($arr, $arr_unique);
         print_r($arr_duplicates);
?>

It will return :

             Array(
                          [1] => anil

                          [2] => sunita
                       )


Question #32 - What is CSS?


CSS known as cascading Style Sheet. It is a best technique to style and present HTML.
Question #33 - What are the differences between ID and class in CSS? 


ID is used to identify one element , while a class is used to identify more than one element.

Question #34 - How stop the execution of a php scrip ?


We mostly use exit() function to stop the execution of a page


Question #35 - How to strip whitespace (or other characters) from the beginning and end of a string ?

Read More