InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How can we assign more values through the response text? |
|
Answer» We can send multiple text values through any response text with the HELP of a concatenation operator (|). By splitting the text data into VARIOUS SEGMENTS using the pipe operator like this: responseText.split(‘|’). It RENDERS an array of text that DEVELOPERS can send through JSQN in an array format. In other words, if the response is text, we can stringified array that can be parsed in client-side. |
|
| 2. |
How can a developer improve the AJAX performance? |
|
Answer» For IMPROVING performance of AJAX, we can go through the following steps: |
|
| 3. |
How is auto-complete textbox related to AJAX? |
|
Answer» Text HINTS and auto-complete TEXTBOXES are two WIDESPREAD uses of AJAX. When the user on the client-side types a couple of letters, a listing of all values that begin with these typed letters appears below as recommendations. BEHIND this operation, the application makes a callback to a web service. This web service then fetches all values that START with these characters. |
|
| 4. |
How will you define response time in an AJAX-based web application? |
|
Answer» The response time, also known as LATENCY, is the time SPREAD that passes from the COMMENCEMENT of a client-based request PROCESSING to the server until its ENDS. When the time duration is longer than the expected time or regular time, it is called delay. |
|
| 5. |
How can developers manage concurrent requests? |
|
Answer» We can write a JavaScript closure or CREATE a SEPARATE user-defined function to manage concurrent requests. After the CODE finishes the processing, developers must pass the callback function and the URL as parameters to the object (AJAX interaction). Alternatively, we can also USE MULTIPLE Fetch API calls since it implements Promises. |
|
| 6. |
Describe the use of Cache false in AJAX call. |
|
Answer» AJAX requests by default, ISSUE all requests. But browsers may send responses with the HELP of CACHE. For preventing such a scenario, developers can set the cache to false. We can apply this concept to prevent CACHING of all future AJAX requests, IRRESPECTIVE of jQuery method used. |
|
| 7. |
Is it possible to send an image using AJAX? |
| Answer» | |
| 8. |
Does AJAX contain media functions? |
|
Answer» Ajax does not cater to built-in MULTIMEDIA functions. It is not so supportive of in-built applications. But it can USE other browser functionalities and PLUGINS such as QuickTime, SVG, and FLASH. Developers can achieve AJAX-based general multimedia functions through mashup and HACK. |
|
| 9. |
Are there any security issues with AJAX? |
|
Answer» JavaScript acts as glue and renders plain view to the user through the view source of the page. It can't access the local file system without proper user permission. AJAX interaction can fetch data from servers-side components from where the entire page GETS loaded. DEVELOPERS can use a proxy pattern to perform AJAX interactions with external services. In this case, the developer would have to be careful not to expose the application model. Cybercriminals and reverse engineers can be MAJOR threats to the server-side components if they understand the data EXCHANGE method. |
|
| 10. |
What are the two well-known methods developers use to handle cross-domain AJAX Calls? |
|
Answer» Cross-domain CALLING renders the ability to automatically and concurrently access or change data among two or more VARIED SECURITY domains. |
|
| 11. |
Mention some technical issues that occur in AJAX? |
|
Answer» AJAX provides the ability to update a page dynamically through AJAX interaction. That MAY result in a drastic change in the form, appearance, or even the state of a web page. USING the back & forward button, navigating through an AJAX-based page, or printing the page DIRECTLY from the browser can create issues. So, while designing and developing an AJAX-based application, developers should consider that the expected behavior the page may reflect in case of navigation. |
|
| 12. |
Show me, how will you create AJAX objects? |
|
Answer» We can CREATE AJAX objects by USING the following syntax: var ajax= New ajaxObject('page PATH')Here the 'page path' is the URL used for the object to call. The URL must be of the same domain as the WEBPAGE. |
|
| 13. |
How is encoding handled in AJAX? |
|
Answer» There are 2 DIFFERENT ways of handling ENCODING in AJAX. These are:
|
|
| 14. |
What do you understand by callbacks? |
|
Answer» Developers use AJAX to perform callbacks. These callbacks are ACTIONS (FUNCTIONS) that are executed when an asynchronous task completes and is used to handle the outcome. This callback process takes a round trip to and from the SERVER without posting the complete page to the server. Thus, this technique helps AJAX interact with the server without a page refresh. By not performing a TOTAL postback and sending all form-related data to the server, the AJAX callback helps in reducing network utilization. |
|
| 15. |
Apart from HTML, JavaScript, DOM, and CSS, conceptually, what else do we need to create our own AJAX functionality? |
|
Answer» Apart from understanding the basic working scenario of HTML, JavaScript, DOM, and CSS, a developer also needs to understand the concept of HTTP request & response. Developers can encounter subtle bugs if they do not have a fair understanding of the GET and POST methods when they REMAIN configured with XMLHTTPREQUEST and HTTP response codes. |
|
| 16. |
Is it feasible to set session variables from JavaScript? |
|
Answer» It is not feasible or likely to produce or set any SESSION VARIABLES STRAIGHTWAY from JavaScript. This is because AJAX is a works on the client-side, and we can USE AJAX asynchronously. |
|
| 17. |
What are the real-life situations where we cannot use AJAX within our application? |
|
Answer» We cannot leverage the functionalities of AJAX if -
|
|
| 18. |
Name some protocols used by AJAX. |
|
Answer» Names of some protocols used by AJAX are: |
|
| 19. |
AJAX stands for Asynchronous JavaScript and XML. What does the asynchronous term mean? |
|
Answer» The term "Asynchronous" means that a wide variety of events can OCCUR independently of one another using AJAX. As soon as the client-side INITIALIZES an AJAX-based callback to the server, the client won't have to wait for any response. The APPLICATION will continue to use the WEB application while processing the request. |
|
| 20. |
How to debug a JavaScript and AJAX-based application? |
|
Answer» There are debugging tools that allow server-side and client-side debugging separately. For Mozilla Firefox and Google Chrome, there is a browser extension debugger called FireBug. It provides information RELATED to AJAX calls. So, the developers using AJAX in their application would always need to include the capability to access the JAVASCRIPT runtime, inspect the browser DOM, and check the HTTP REQUESTS and responses (using XMLHttpRequest). Apart from this extension, developers can ALSO use the "alert()" function calls inline like that of System.out.println() to perform debugging wherever necessary. |
|
| 21. |
Should one use the HTTP GET request or the POST request for any AJAX call? |
|
Answer» While retrieving data, the AJAX request MUST USE the HTTP GET request. It is because the data won't alter for a presented request URL. One should use the HTTP POST when the STATE requires an update on the server. |
|
| 22. |
Mention the name of some well-known AJAX frameworks. |
|
Answer» Some well-known AJAX enabled/enabler frameworks are:
|
|
| 23. |
Mention the name of some web browsers that support AJAX? |
|
Answer» Some well-known WEB BROWSERS that SUPPORT AJAX are Google Chrome, Opera, Mozilla Firefox, Microsoft EDGE and Safari. |
|
| 24. |
What are the different tools that developers use for debugging any AJAX-based websites or applications? |
|
Answer» Some POPULAR tools that help developers debug any AJAX-based WEBSITE and apps are: |
|
| 25. |
How is JSON related to AJAX? |
|
Answer» JSON stands for JavaScript Object Notation. It is an open standard data interchange format that LEVERAGES human-readable text. It allows transmitting data OBJECTS having attribute-value in pairs & arrays. Such a file format for data sharing is both human and machine understandable. JSON is a faster alternative to XML. Although AJAX uses XML, there is also a possibility where AJAX can use JSON for exchanging data between a browser and a server. The JSON format is easy to understand, fast and supports strings, values, numbers, and objects. Due to its benefit and ease of use, many DEVELOPERS PREFER to use JSON for passing AJAX-based UPDATES within a client and a server. |
|
| 26. |
What is the purpose of the callback function in AJAX? |
|
Answer» In AJAX, the callback functions AID in handling responses from the server. Such functions can either be a named FUNCTION (that developers use frequently) or an ANONYMOUS function. Developers can IMPLEMENT a broad spectrum of AJAX tasks on a website by simply creating a function that does the XMLHttpRequest execution along with a callback function, which accomplishes each AJAX TASK. |
|
| 27. |
What is the use of Fetch API? |
|
Answer» Fetch works as an INTERFACE to create the AJAX request in JavaScript. All modern browsers largely use it. Developers leverage the Fetch to call any API that works in TANDEM with AJAX. When an application calls or USES the Fetch, it returns a promise along with a Response object. The promise gets rejected when it encounters a network error. The server will again respond with a status code for the application when the connection comes back. When the DEVELOPER uses the Fetch, the status CODES are usually 200s, 400s, or 500s. |
|
| 28. |
Mention three real-time applications of AJAX. |
|
Answer» There are different situations where developers can use AJAX.
|
|
| 29. |
What are the various ready states of an AJAX request? |
|
Answer» Five different READY states are there in an AJAX request. These are:
|
|
| 30. |
Does AJAX work smoothly with other well-known programming languages? |
|
Answer» AJAX works smoothly with VARIOUS other PROGRAMMING LANGUAGES. AJAX is client-side so it really does not matter how the remote service/API is BUILT. AJAX just NEEDS to remotely connect to the service to fetch/send data. |
|
| 31. |
Mention the 2 methods for cross-domain Ajax calls. |
|
Answer» There are 2 METHODS that helps in TRANSFERRING data between multiple security domains.
|
|
| 32. |
Is it an easy job to develop an AJAX application rather than using a traditional approach? |
|
Answer» In the modern context of WEB development, AJAX is really simple to work with. Although the semantics of AJAX use HTML, XML, CSS, JavaScript, and JSON, it HELPS decouple web apps or webpage displays from data transfer for stable performance. That makes it advantageous compared to the traditional APPROACH to website development. It also renders libraries like Axios that are simple promise-based HTTP clients for the browser and node.js. Axios delivers a simple-to-use library that comes with a TINY package as an extensible interface. |
|
| 33. |
Mention any two security issues AJAX developers’ face. |
|
Answer» As with any technology, there are several issues that developers face. TWO key security issues associated with the AJAX are: |
|
| 34. |
What are synchronous requests in AJAX? |
|
Answer» XMLHttpRequest can render both synchronous and asynchronous COMMUNICATIONS for AJAX. In AJAX, synchronous requests are those requests where the JavaScript will stop processing the DEVELOPER's program until it receives a result from the server. In this situation, when the application processes such synchronous requests, the browser remains frozen effectively. Hence, developers should carefully CONFIGURE such requests, MAKING the server respond to the user ACCORDING to the requirement. Synchronous requests remain in a waiting state for the server response after requesting to continue with the next script execution. |
|
| 35. |
How will you send a request for AJAX in JavaScript? |
|
Answer» AJAX creates HTTP requests with the HELP of XMLHttpRequest. It promotes transferring data between the client and the SERVER, which is the request and response SELECTION. Developers can perform the same operation and fetch data from URL WITHOUT a page refresh through AJAX. There are THREE steps for doing this:
|
|
| 36. |
AJAX uses XMLHttpRequest. What is its purpose? |
|
Answer» XMLHttpRequest has VARIOUS tasks when applied with AJAX. These are:
|
|
| 37. |
What are the various technologies that AJAX uses? |
|
Answer» AJAX is an abbreviation of the initials of different technologies. They are:
|
|
| 38. |
What are the limitations of AJAX? |
|
Answer» There are a few limitations that AJAX users should keep in mind. These are:
|
|
| 39. |
How will you explain in a single line the concept of polling in AJAX? |
|
Answer» It is the process of FETCHING data from the SERVER to RECEIVE near-live data regularly. |
|
| 40. |
What are the important methods of XMLHttpRequest associated with AJAX? |
|
Answer» The IMPORTANT METHODS of XMLHttpRequest are:
|
|
| 41. |
Can you mention some real-life projects and web applications that are using AJAX? |
|
Answer» Some real-life PROJECTS and WEB APPLICATIONS that USE AJAX are:
|
|
| 42. |
What are the advantages of AJAX? |
|
Answer» The various ADVANTAGES of AJAX are:
|
|
| 43. |
What is AJAX? |
|
Answer» AJAX, which is Asynchronous JavaScript and XML, is a CLUSTER of related TECHNOLOGIES that helps in creating asynchronous web applications. It helps in fetching data asynchronously for sending and retrieving them without a page reload. With the use of AJAX, web developers can build faster and interactive web applications. With the help of AJAX, developers can send and retrieve data asynchronously without disturbing the behavior and appearance of the page. It runs in the background and decouples the data interchange layer from its PRESENTATION layer. It allows the web pages to change their CONTENT dynamically without reloading the complete page. |
|