Solved

Ajax Interview Questions

Posted on 2006-07-08
14
10,219 Views
Last Modified: 2013-11-24
Hi Guys,

What are the entry level and intermediate-level questions that can be asked for a candidate claiming to have AJAX experience.


VERY URGENT

_____Jags.
0
Comment
Question by:jagadeesh_motamarri
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
- Entry level:
  - Is AJAX a programming language?
  - What is AJAX?
  - How new is AJAX?
  - Why can/should AJAX be used?
  - When should AJAX NOT be used?
  - What objects are used by AJAX programs?

- Intermediate-level?
  - Describe the  formats and protocols used/specified by AJAX
  - Describe some things that can't be done with AJAX
  - How should AJAX objects be created?
  - For what error conditions should programs check?
  - Are Finite State Machines (FSM's) appropriate for use with AJAX?
  - Identify and describe the state transitions that can/should occur within a transaction
0
 
LVL 15

Assisted Solution

by:bpmurray
bpmurray earned 150 total points
Comment Utility
Q. What does AJAX stand for and who coined the phrase?
A. "Advanced JavaScript And XML", coined by Jesse James Garret, Adaptive Path - http://adaptivepath.com/publications/essays/archives/000385.php
Q. What Javascript object is used to drive AJAX requests, and how does it differ on various browsers
A. XmlHttpRequest. It's an ActiveX object on IE, but is a native object on the other browsers (Firefox, Mozilla, Opera, Safari, Konqueror)
Q. How do you know that an AJAX request has completed?
A. The XHR.readyState is 4 and the XHR.status is 200 (or zero if the request is to a local file). The callback function is called four times - first with status=1, then 2,3, and finally 4.
Q. How does XML processing differ on the different browsers?
A. It's an ActiveX object on IE, but is native on the other browsers

Other areas to check up on:
   How do you process the returned XML data?
   If it's a Java/J2EE place: what about AJAX and JSF?
   How to populate the XML response on the server?
   How to terminate an active request?
   
0
 
LVL 10

Author Comment

by:jagadeesh_motamarri
Comment Utility
Guys,

Thank You for a quick response.

bpmurray ->> I liked the questions and answer format.


_____Jags.
0
 
LVL 10

Author Comment

by:jagadeesh_motamarri
Comment Utility
>> When should AJAX NOT be used?
Answer --->> ??

>> What objects are used by AJAX programs?
Answer --->> ??


___Jags.
0
 
LVL 15

Expert Comment

by:Raisor
Comment Utility
Hi,

Great that your homework nearly seems to be done!

:-)


Best regards,
Raisor
0
 
LVL 10

Author Comment

by:jagadeesh_motamarri
Comment Utility
Hi Raisor,

Can u please make it clear .....what do u mean.....>>> Great that your homework nearly seems to be done!

Thank You,
_____Jags.
0
 
LVL 15

Expert Comment

by:Raisor
Comment Utility
Hi,

"...academic honesty or other unethical behavior...
 
Most commonly, this means that Experts are prohibited from doing your homework for you. They'll guide you and teach you, but don't ask them to write code to answer a question that seems like it was written for a test. It should be noted that just like bribery, while it's bad to offer a bribe, it's worse to take it -- so don't do homework.

"Homework" is loosely defined as an assigment, project or quiz offered up an instructor of a technical, trade or eductional institution as part of a scheduled course of instruction, for which the student receives some kind of credit. The Moderators know what homework looks like, and it will be your task to convince them it isn't."
 
... can be found at http://www.experts-exchange.com/help.jsp#hi130


Best regards,
Raisor
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 10

Author Comment

by:jagadeesh_motamarri
Comment Utility
Hi Raisor,

Well...If u can see my previous posts...you will definitely know that i'm preparing for Interviews. And so is the reason why i'm asking the interview questions.

And moreover....if I specifically give you a problem and ask you to produce an answer ......you should then consider it to be a homework question. I asked general question....>> interview questions??

And does it make sense to include AJAX as a part of cirriculum. I don't think it has reached that level yet.

I suggest you not make guesswork...unless otherwise.

Thank You for your suggestion though...!!!
____Jags
0
 
LVL 15

Expert Comment

by:Raisor
Comment Utility
Hi,

Never mind jagadeesh_motamarri!

I'm sure you know what you're doing ... so do I think about the answering experts ... and I'm not a moderator at EE ... it's just a piece of experience that led me to think about your question just the way I thought ... anyway, please don't mind my hint jagadeesh_motamarri!


Best regards,
Raisor
0
 
LVL 10

Author Comment

by:jagadeesh_motamarri
Comment Utility
Hi Raisor,

Thank You for the understanding...!!!

_Jags.
0
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
Q: When should AJAX NOT be used?
A: It would not be appropriate to use AJAX when the "answer/result" can be determinded
    by the client.  Generally, the purpose of AJAX is to submit a short request to the server,
    and process the response in such a way as to add value to the currently displayed page.
    It would also not be appropriate to use AJAX when the magnitude of the response is such
    that it would be easier, and more clear to redisplay the page.

Q: What objects are used by AJAX programs?
A: The most bovious / correct answer would be "XmlHttpRequest".
     However, personally, I would seriously consider someone who discussed the use
     of the callback routine, and most specifically "the response" as "objects".
0
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
Q: When should AJAX NOT be used?
A: (continued)...
     or, to display a totally new page instead.
0
 
LVL 41

Accepted Solution

by:
HonorGod earned 350 total points
Comment Utility
(sigh... now, you want to make me work... :-)

Q:  Is AJAX a programming language?
A:  No

Q: What is AJAX?
A: In one sense, AJAX is simply an acronym for "Asynchronous JavaScript And XML"
    In another, it is a protocol for sending requests from a client (web page) to a server,
    and how the information is / should be communicated between the client and the
    server

Q: How new is AJAX?
A: The terminology is new, but the techniques are not.


Q: Why can/should AJAX be used?
A: AJAX is best suited for small (hopefully unobtrusive) updates to the current
    web page, based on information that is not available until it has been provided
    by the end user.

Q: When should AJAX NOT be used?
A:  See above

Q: What objects are used by AJAX programs?
A: See above

Q: Describe the  formats and protocols used/specified by AJAX
A: The client web page is responsible for creating the XmlHttpRequest,
     and therefore the connection from the web page to some application
     on the server.
     Part of this connection identifies how the response can / should be
     provided to the client code - via the use of a "callback" routine.
     The callback routine is invoked multiple times with a status code,
     indicating the reason for the invocation.
     If the request can be successfully completed by the server application,
     a responce should also be provided.

Q: Describe some things that can't be done with AJAX
A: Sending a request to a server outside of the domain from which
    the web page originated.

Q: How should AJAX objects be created?
A: In a browser general manner, if at all possible.

Q: For what error conditions should programs check?
A: The connection can not be established
    The request does not complete in a timely fashion
    Unexpected response

Q: Are Finite State Machines (FSM's) appropriate for use with AJAX?
A: Possibly
    There are circumstances under which an FSM might be appropriate.
    It depends upon the complexity of the environment, and the number
    of machines that might need to be contacted in order to obtain the
    response to the request.

Q: Identify and describe the state transitions that can/should occur within a transaction
A: - Reset : When the XmlHttpRequest object is created, no connection yet exists between the clent, and the server.
      Open  : When the xmlHttp.open() is issued, the request is being prepared for transmission to the server
      Sent   : When the xmlHttp.send() is issued, the request is transmitted to the server application
      Rcvd   : When the xmlHttp callback routine is called, the readyState and status fields of the object define why the routine was called

Q: What values exists for the XmlHttpRequest.readyState field, and what do they mean?
A: readyState values:
    0 = uninitialized
    1 = loading
    2 = loaded
    3 = interactive
    4 = complete  

Q: When is it appropriate to access, or use the other fields within the XmlHttpRequest object?
A: The most important field is the readyState field.  Once a value of 4 (i.e., complete) is received,
    then the next most important field is status.  The value of status will be the same as the
    HTTP Status Code values as documented here:  http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
0
 
LVL 15

Expert Comment

by:bpmurray
Comment Utility
Q: Is it possible to achieve similar results without the XmlHttpRequest object?
A: A hidden IFrame (actually an IFrame of size 0px * 0px due to a bug in IE) can be used to retrieve data, and its contents can then be processed in a similar manner to the response from an XHR call.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now