Top Ajax Interview Questions and Answers

, , Leave a comment

Ajax Interview Questions and Answers
On demand of many readers, i have started to write on various interview questions answers.This post contains some very basic and useful ajax interview questions and answers.These questions are the suggestions from the beginners who faced various interviews and some of them are added by me. 

(1) What is Ajax?

Ans: Ajax is abbreviated as Asynchronous Javascript and XML. It is new technique used to create better, faster and more interactive web systems or applications. Ajax uses asynchronous data transfer between the Browser and the web server.
This technique is used to make internet faster and user friendly. It is not a programming language.

(2) What are Ajax applications?
Ans: Browser based applications and platform independent applications are used by Ajax.
(3) What are the advantages of Ajax?
Ans: Following are the advantages of Ajax:
  • Bandwidth utilization
  • It saves memory when the data is fetched from the same page.
  • More interactive
  • Speeder retrieval of data
(4)  What are the disadvantages of Ajax?
Ans: Following are the disadvantages of Ajax:
  • AJAX is dependent on Javascript. If there is some Javascript problem with the browser or in the OS, Ajax will not support.
  • Ajax can be problematic in Search engines as it uses Javascript for most of its parts.
  • Source code written in AJAX is easily human readable. There will be some security issues in Ajax.
  • Debugging is difficult (not impossible)
  • Increases size of the requests
  • Slow and unreliable network connection.
  • Problem with browser back button when using AJAX enabled pages.
(5) What are all the technologies used by Ajax?
Ans: AJAX uses following technologies:
  • JavaScript
  • XMLHttpRequest
  • Document Object Model (DOM)
  • Extensible HTML (XHTML)
  • Cascading Style Sheets (CSS)
(6) What Is the Format of an AJAX Request?
Ans: An AJAX request can be in any format:
  • Text File
  • HTML
  • JSON object
(7) How many types of triggers are present in update panel?
Ans : There are two types of triggers used in update panel:
  • PostBackTrigger : This works as full postback and it cannot work asynchronously
  • AsyncPostBackTrigger : Partial post back asynchronously
(8) Is an AJAX Request Synchronous or Asynchronous?
Ans: AJAX requests are asynchronous by nature, which means that they should run in the background independently of other events.
(9) What are the security issues with AJAX?
Ans: The Ajax calls are sent in plain text format, this might lead to insecure database access. The data gets stored on the clients browser, thus making the data available to anyone. It also allows monitoring browsing sessions by inserting scripts.
(10) Is AJAX code cross browser compatible?
Ans: Not totally. Most browsers offer a native XMLHttpRequest JavaScript object, while another one (Internet Explorer) require you to get it as an ActiveX object
(11) What are all the browsers support AJAX?
Ans: Following browsers support AJAX:
  • Internet Explorer 5.0 and above
  • Opera 7.6 and above
  • Netscape 7.1 and above
  • Safari 1.2 and above
(12) How can you test the Ajax code?
Ans: JSUnit is the client side javascript code used as part of JUnit. JSUnit has been used for Ajax code.
(13) How can you find out that an AJAX request has been completed?
Ans : ReadyState property is used to check whether AJAX request has been completed. If the property is equal to four, then the request has been completed and data is available.
(14) What is JSON in Ajax?
Ans: JSON is abbreviated as JavaScript Object Notation. JSON is a safe and reliable data interchange format in JavaScript, which is easy to understand for both users and machines.
(15) What are all the different data types that JSON supports?
Ans: JSON supports following data types:
  • String
  • Number
  • Boolean
  • Array
  • Object
  • Null
This list is not going to end… Please provide other QA that you know or you have faced in any interviews.Your suggestions will be appreciated.