Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 10328
  • Last Modified:

Ajax Interview Questions

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
jagadeesh_motamarri
Asked:
jagadeesh_motamarri
  • 5
  • 4
  • 3
  • +1
2 Solutions
 
HonorGodCommented:
- 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
 
bpmurrayCommented:
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
 
jagadeesh_motamarriAuthor Commented:
Guys,

Thank You for a quick response.

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


_____Jags.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
jagadeesh_motamarriAuthor Commented:
>> When should AJAX NOT be used?
Answer --->> ??

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


___Jags.
0
 
Ralf KlattPrincipal ConsultantCommented:
Hi,

Great that your homework nearly seems to be done!

:-)


Best regards,
Raisor
0
 
jagadeesh_motamarriAuthor Commented:
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
 
Ralf KlattPrincipal ConsultantCommented:
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
 
jagadeesh_motamarriAuthor Commented:
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
 
Ralf KlattPrincipal ConsultantCommented:
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
 
jagadeesh_motamarriAuthor Commented:
Hi Raisor,

Thank You for the understanding...!!!

_Jags.
0
 
HonorGodCommented:
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
 
HonorGodCommented:
Q: When should AJAX NOT be used?
A: (continued)...
     or, to display a totally new page instead.
0
 
HonorGodCommented:
(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
 
bpmurrayCommented:
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

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 5
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now