Saturday, March 10, 2018

Dheeraj Punjabi

Top Html Interview Questions And Answers for Freshers.

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

Question #1 - What is HTML?
HTML is known as Hypertext Markup Language. It is a markup language for www (World Wide Web). This was invented by Tim Berners Lee during 1990’s. This language is used to create and display pages on the Web.

Question #2 - Different versions of HTML?
HTML has numerous renditions since it initiations amid 1990's. HTML variant are HTML, HTML+, HTML 2.0, HTML 3.2, HTML 4.0 and the most recent form HTML 5.

Question #3 - What is the role of <!DOCTYPE>?
<!DOCTYPE> remains for Document Type Declarations. <!DOCTYPE> is utilized to indicate the web programs what sorts of documents(such as SGML or XML Documents) it will get. <!DOCTYPE> is proclaimed over the <html> tag.

Question #4 - What are HTML tags?
HTML labels like watchwords which have indicated work, for instance, for passage we can utilize HTML tag(<p>). HTML labels generally comes in combine like, <p>, </p>. Most of the tags are having their closing tags. But there are single HTML tags that do not require an end tag. Cases are the <img> tag and <br> tag.

Question #5 - How do you create Tables in HTML?
HTML tables are created using <table> tags. To divide a HTML table, we have to use <tr>, which is table row. Likewise we <td> and <th>.

Question #6 - What is HTML Element?
An HTML component is everything from beginning to the closure of HTML tag. For instance, <p> This is a HTML Element</p>, in this case, from beginning tag to consummation label everything is HTML component and "This is a HTML Element" will be Element Content.

Question #7 - What is HTML Attribute?
HTML attribute adds extra data to the HTML Elements. For instance, <font size="5" color="green">, here size and color are html attributes.

Question #8 - What is Hyperlinks?
Hyperlinks are utilized to explore to another document with the assistance of content, picture or with a gathering of words.

Question #9 - Which are the basic editors for HTML?
There are various editors for designing in HTML like Notepad, Notepad++, EditPlus and WYSIWYG HTML editors etc. But mostly Notepad is using HTML Designers.

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 - How will you align a table to the right or left?
- For align the table to the right, we can use <TABLE ALIGN=" right">
- For align the table to the left, we can use <TABLE ALIGN=" left">

Question #13 - Does a hyperlink apply only to text?
- The hyperlinks can be applied to both text as well as the images.
- This can be done simply by using <a href> tag.
- It means that even the images can become clickable links with a capability to take the visitor to the next page.

Question #14 - What are HTML forms?
HTML forms takes information and sends the data to the servers.

Question #15 - What are HTML blocks?
HTML blocks can be characterized by HTML tags like <span> and <div>.

Question #16 - What is the distinction amongst <div> and <span> components?
<div> tags are utilized to characterize segment in record blocks shrewd while <span> tag is utilized to characterize area in archives inline.

Question #17 - You need just a vertical scrollbar and no level scrollbar on your page. How might you do it?
- This should be possible by characterizing the frame with SCROLLING="auto" and having substance to simply fit into this frame.
- SCROLLING="yes" gets the scroll bar on both the sides, even when not required.
- SCROLLING="no" doesn't get the scrollbars by any stretch of the imagination, even when they are required.

Question #18 - What is <body> element in HTML document?
The <body> element characterizes the records body. It contains every one of the substance of the report (like content, pictures, hues, designs, and so on.).

Question #19 - What is image mapping in HTML?
Image map lets you connect to a wide range of site pages utilizing a single picture. You can characterize shapes in pictures that you need to make some portion of a image mapping.

Question #20 - What is the use of using alternative text in image mapping?
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 - Differentiate between get and post method?
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 is contained in HTML markup?
-Character-based data types 
-Several key components, including elements (and their attributes)
-Character references and entity references.
-Also the document type declaration.

Question #24 - What are the limitations when serving XHTML pages?
Maybe the greatest issue is the poor browser support XHTML as of now appreciates. Web Explorer and various other client specialists can't parse XHTML as XML. Accordingly, it isn't the extensible dialect it was guaranteed to be. There are numerous different issues. Take your pick.

Question #25 - What is difference between HTML and XHTML?
1. HTML is utilization of Standard Generalized Markup Language(SGML) while XML is use of Extensible Markup Language(XML).
2. HTML is a static Web Page while XHTML is dynamic Web Page.
3. HTML enables software engineer to perform changes in the labels and utilize property minimization though XHTML when client require another markup label then client can characterize it in this.
4. HTML is tied in with showing data though XHTML is tied in with depicting the data.

More About Interviewing:

Read More

Monday, February 19, 2018


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 doesn’t support oops concepts
PHP5 supports oops concept
Error handling is not good
Error handling is better
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.
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 = '';  // 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

Thursday, February 15, 2018


Top 35 Essential JavaScript Interview Questions and Answers

Here I am sharing top 35 essential javascript interview questions and answers for freshers and experienced. This list of javascript interview questions and answers will be helpful for javaScript beginner who just started their career as javascript developer, and surely help you during interview session.

Question #1 - What is JavaScript?

JavaScript is a client side scripting language with an inbuilt object-oriented capability that allows developers to build up client side validations with HTML pages. It is object-based, lightweight and cross platform.

Question #2 - How to use external JavaScript file in a HTML page?

Lets assume a js file name is myscript.js. So to use this external file we write code as below 

<script type="text/javascript" src="myscript.js"></script>  

Question #3 - what are the JavaScript properties.

Below are the properties of JavaScript −
  • JavaScript is open and cross-platform.
  • JavaScript is a lightweight, interpreted programming language.
  • JavaScript is client side scripting language.
  • JavaScript is easy to integrate with HTML.
  • JavaScript is complementary to and integrated with Java.
  • JavaScript is designed for creating network-centric applications.
Question #4 - What is arguments object in JavaScript?

JavaScript variable arguments represents the arguments passed to a function.
Question #5 - What is the use of HTML5 Canvas element ?

Canvas used to draw graphics on a web page by the help of javascript.
Question #6 -  What is DOM? What is the use of document object?

DOM known as Document Object Model. A document object represent the html document. mostly It is used to access and change the content of html.
Question #7 - Is javascript case sensitive?

Yes, Javascript is case sensitive.

Question #8 - What is difference between == and === operator?

== is a comparison operator while === is a hard equality operator. == checks value only while === check value and datatype. 5=="5" id true but 5==="5" is false.

Question #9 - What is an AJAX request and what is a simple example of where a AJAX request would be used.

AJAX known as "Asynchronous JavaScript and XML". It is commonly used client side process to get or post data from remote server without reloading page.

Question #10 - What is Event bubbling and Event Capturing.

Event Propagation are the order that event fire on element. 

Bubbling :-

Bubbling is when a event fire on the element and then bubble up DOM Tree. Means First child and then parent will call. 

Capturing :-

Capturing is exactly opposite. First parent node is called and then propagates down towards target element.

Question #11 - How to get value of input box using jQuery ?

You can get value of input box using below function..


Question #12 - how to remove a class in jquery?

You can remove a class form a html element like :-
<p class="perag">This is a paragraph.</p>

Question #13 - What are JavaScript Data Types?

Below are the JavaScript Data types:-

  • String
  • Boolean
  • Number
  • Function
  • Object
  • Undefined
Question #14 - What are the features of jQuery, has been used in web applications?

jQuery uses features like Sliding, File uploading and accordian in web applications.
Question #15 - What are the basic selectors in jQuery?

Following are the basic selectors in jQuery:
  • Element ID
  • CSS Name
  • Tag Name
  • DOM hierarchy
Question #16 - Assign Any Variable Name A Value Of “hello World”, And Print That Variable’s Contents To The Console.?

  var t = “Hello World”;  

Question #17 - How do you select all elements with the class of “selected” in jQuery?

We use below code to select all elements with the class.


Question #18 - How to convert a string to lowercase?

You can convert a string to lowercase by following below script..
var str='I Love';
str = str.toLowerCase();

Output:- i love
Question #19 - How to modify the URL of page without reloading the page?

We use pushState javascript function as below..
window.history.pushState('page2', 'I Love PhpMyPassion', '/nextpage.php');

Question #20 - How to get current date in JavaScript?

We use below code to get current date in JavaScript.
var today = new Date();

Question #21 - How to open URL in new tab in javascript?

We use below code to open URL in new tab in javascript.'','_blank');

Question #22 - How to declare a variable as CONSTANT  in JavaScript like in PHP?

You can declare a variable  as constant in javascript as below.
var CONSTANT_NAME = "constant value";

Question #23 - How to set a default parameter value for a JavaScript function?

/** Here stClass is parameter in which we have set the default value i.e senior_secondary **/
function functionGetClass(name, stClass)
   stClass = typeof stClass !== 'undefined' ? stClass : 'senior_secondary';
    console.log('name='+name+', Class= '+stClass);


Question #24 - How to convert JSON Object to String?

var pobject=['Php','Is','My','Passion']

Question #25 - How to convert JSON Object to String?

var jsonpData = '{"name":"phpmypassion","year":2017}';
var pobject = JSON.parse(jsonpData);

Question #26 - What is the best way to detect a mobile device in jQuery?

We can detect a mobile device in jQuery using below code -
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {


Question #27 - How to detect mobiles including ipad using navigator.useragent in javascript?

We can detect a mobile device including ipad using navigator.useragent in jQuery using below code -
 if(navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) ||  navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/iPhone/i)){
        console.log('Calling from Mobile');      
    console.log('Calling from Web');      

Question #28 - How do I declare a namespace in JavaScript?

We use below code to declare a namespace in JavaScript.
var myNamespace = {

    functionA: function() {   },

    functionB: function() {    }

    functionC: function() {    }


Question #29 - How can you create an Array in JavaScript?

You can create an array in JavaScript using the below code.
var x = [];
var y = [1, 2, 3, 4, 5];

Question #30 - How can you create an Object in JavaScript?

JavaScript supports Object concept and you can create an object using the object literal as follows −
var student= {
   name: "sonia",
   age: 20

Question #31 - How can you read properties of an Object in JavaScript?

We can write and read properties of an object using the dot notation as follows −
// Getting object properties  // ==> sonia
student.age   // ==> 20
// Setting object properties = "monica"  // <== monica
student.age  = "22"      //  <== 22

Question #32 - What is a named function in JavaScript? How to define a named function?

A named function always declare with a name when it is defined. A named function can be defined using function keyword as below−
function name(){
   // do some stuff here

Question #33 - What is the purpose of 'this' operator in JavaScript?

"this" keyword always refers to the current context in JavaScript.

Question #34 - How many types of functions JavaScript supports?

A function in JavaScript can be either named or anonymous.

Question #35 - What are the JavaScript data types?

There are two types of data types in JavaScript:

  • Primitive Data Types
  • Non-primitive Data Types
Read More