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.
| 51. |
You Have An Asp.net Web Application Running On A Web-farm That Does Not Use Sticky Sessions - So The Requests For A Session Are Not Guaranteed To Be Served The Same Machine. Occasionally, The Users Get Error Message Validation Of Viewstate Mac Failed. What Could Be One Reason That Is Causing This Error? |
|
Answer» The most common REASON for this error is that the the machinekey value in machine.config is different for each server. As a result, viewstate encoded by one machine cannot be DECODED by ANOTHER. To rectify this, edit the machine.config FILE on each server in the web-farm to have the same value for machinekey. The most common reason for this error is that the the machinekey value in machine.config is different for each server. As a result, viewstate encoded by one machine cannot be decoded by another. To rectify this, edit the machine.config file on each server in the web-farm to have the same value for machinekey. |
|
| 52. |
What Does The Term Sticky Session Mean In A Web-farm Scenario? Why Would You Use A Sticky Session? What Is The Potential Disadvantage Of Using A Sticky Session? |
|
Answer» Sticky session refers to the feature of many commercial load balancing solutions for web-farms to route the requests for a PARTICULAR session to the same PHYSICAL machine that SERVICED the first request for that session. This is mainly used to ensure that a in-proc session is not lost as a result of requests for a session being ROUTED to different servers. Since requests for a USER are always routed to the same machine that first served the request for that session, sticky sessions can cause uneven load distribution across servers. Sticky session refers to the feature of many commercial load balancing solutions for web-farms to route the requests for a particular session to the same physical machine that serviced the first request for that session. This is mainly used to ensure that a in-proc session is not lost as a result of requests for a session being routed to different servers. Since requests for a user are always routed to the same machine that first served the request for that session, sticky sessions can cause uneven load distribution across servers. |
|
| 54. |
How Do You Assign Object Properties? |
|
Answer» OBJ["AGE"] = 17 or obj.age = 17. obj["age"] = 17 or obj.age = 17. |
|
| 55. |
How Do You Create A New Object In Javascript? |
|
Answer» VAR OBJ = NEW OBJECT(); or var obj = {}; var obj = new Object(); or var obj = {}; |
|
| 56. |
What Does Javascript Null Mean? |
|
Answer» The null value is a unique value representing no value or no object. It IMPLIES no object,or null string,no VALID BOOLEAN value,no number and no ARRAY object. The null value is a unique value representing no value or no object. It implies no object,or null string,no valid boolean value,no number and no array object. |
|
| 57. |
Name The Numeric Constants Representing Max,min Values |
|
Answer» Number.MAX_VALUE Number.MAX_VALUE |
|
| 58. |
How To Comment Javascript Code? |
|
Answer» USE // for LINE COMMENTS and Use // for line comments and |
|
| 59. |
How To Hide Javascript Code From Old Browsers That Dont Run It? |
|
Answer» Use the below specified style of comments <SCRIPT language=javascript> <!-- javascript code goes here // --> or Use the <NOSCRIPT>some HTML code </NOSCRIPT> tags and code the DISPLAY html statements between these and this will appear on the page if the BROWSER does not support javascript Use the below specified style of comments <script language=javascript> <!-- javascript code goes here // --> or Use the <NOSCRIPT>some html code </NOSCRIPT> tags and code the display html statements between these and this will appear on the page if the browser does not support javascript |
|
| 60. |
To Put A "close Window" Link On A Page ? |
|
Answer» <a href='javascript:window.CLOSE()' class='mainnav'> Close </a> <a href='javascript:window.close()' class='mainnav'> Close </a> |
|
| 61. |
What Looping Structures Are There In Javascript? |
|
Answer» for, while, do-while LOOPS, but no FOREACH. for, while, do-while loops, but no foreach. |
|
| 62. |
How To Accessing Elements Using Javascript? |
|
Answer» To do something interesting with HTML elements, we must first be able to UNIQUELY identify which element we want. In the example To do something interesting with HTML elements, we must first be able to uniquely identify which element we want. In the example |
|
| 63. |
How About 2+5+"8"? |
|
Answer» SINCE 2 and 5 are integers, this is number arithmetic, since 8 is a string, it’s CONCATENATION, so 78 is the RESULT. Since 2 and 5 are integers, this is number arithmetic, since 8 is a string, it’s concatenation, so 78 is the result. |
|
| 64. |
Taking A Developer's Perspective, Do You Think That That Javascript Is Easy To Learn And Use? |
|
Answer» One of the reasons JavaScript has the word "script" in it is that as a programming language, the vocabulary of the core language is compact compared to full-fledged programming LANGUAGES. If you already program in Java or C, you actually have to unlearn some concepts that had been beaten into you. For example, JavaScript is a loosely typed language, which means that a variable doesn't care if it's holding a string, a number, or a REFERENCE to an object; the same variable can even change what type of data it HOLDS while a script RUNS. The other part of JavaScript implementation in browsers that makes it easier to learn is that most of the objects you script are pre-defined for the author, and they largely represent physical things you can see on a page: a text box, an image, and so on. It's easier to say, "OK, these are the things I'm working with and I'll use scripting to make them do such and such," instead of having to dream up the USER interface, conceive of and code objects, and handle the interaction between objects and users. With scripting, you tend to write a _lot_ less code. One of the reasons JavaScript has the word "script" in it is that as a programming language, the vocabulary of the core language is compact compared to full-fledged programming languages. If you already program in Java or C, you actually have to unlearn some concepts that had been beaten into you. For example, JavaScript is a loosely typed language, which means that a variable doesn't care if it's holding a string, a number, or a reference to an object; the same variable can even change what type of data it holds while a script runs. The other part of JavaScript implementation in browsers that makes it easier to learn is that most of the objects you script are pre-defined for the author, and they largely represent physical things you can see on a page: a text box, an image, and so on. It's easier to say, "OK, these are the things I'm working with and I'll use scripting to make them do such and such," instead of having to dream up the user interface, conceive of and code objects, and handle the interaction between objects and users. With scripting, you tend to write a _lot_ less code. |
|
| 65. |
What Is The Difference Between Registerclientscriptblock And Registerstartupscript? |
|
Answer» RegisterClientScriptBlock EMITS the JavaScript just after the OPENING tag. RegisterStartupScript emits the JavaScript at the bottom of the ASP.NET PAGE just before the closing tag. RegisterClientScriptBlock emits the JavaScript just after the opening tag. RegisterStartupScript emits the JavaScript at the bottom of the ASP.NET page just before the closing tag. |
|
| 66. |
What Are The Ways To Emit Client-side Javascript From Server-side Code In Asp.net? |
|
Answer» The PAGE object in ASP.NET has TWO methods that allow emitting of client-side JavaScript: Page.RegisterClientScriptBlock("ScriptKey", "<script language=javascript>" + "function TestFn() { ALERT('Clients-side JavaScript'); }</script>"); ScriptKey is used to suppress the same JavaScript from being emitted more than once. Multiple CALLS to RegisterClientScriptBlock or RegisterStartupScript with the same value of ScriptKey emit the script only once, on the FIRST call. The Page object in ASP.NET has two methods that allow emitting of client-side JavaScript: Page.RegisterClientScriptBlock("ScriptKey", "<script language=javascript>" + "function TestFn() { alert('Clients-side JavaScript'); }</script>"); ScriptKey is used to suppress the same JavaScript from being emitted more than once. Multiple calls to RegisterClientScriptBlock or RegisterStartupScript with the same value of ScriptKey emit the script only once, on the first call. |
|
| 67. |
Methods Get And Post In Html Forms - What's The Difference?. |
|
Answer» GET: Parameters are passed in the QUERYSTRING. Maximum amount of data that can be SENT via the GET method is limited to about 2kb. POST: Parameters are passed in the request body. There is no limit to the amount of data that can be transferred using POST. HOWEVER, there are limits on the maximum amount of data that can be transferred in ONE name/value PAIR. GET: Parameters are passed in the querystring. Maximum amount of data that can be sent via the GET method is limited to about 2kb. POST: Parameters are passed in the request body. There is no limit to the amount of data that can be transferred using POST. However, there are limits on the maximum amount of data that can be transferred in one name/value pair. |
|
| 68. |
How To Add Buttons In Javascript? |
|
Answer» The most basic and ancient use of buttons are the "submit" and "clear", which appear slightly before the Pleistocene period. Notice when the "GO!" button is PRESSED it submits itself to itself and appends the name in the URL. The most basic and ancient use of buttons are the "submit" and "clear", which appear slightly before the Pleistocene period. Notice when the "GO!" button is pressed it submits itself to itself and appends the name in the URL. |
|
| 69. |
Example Of Using Regular Expressions For Syntax Checking In Javascript |
|
Answer» VAR re = new RegExp("^(&[A-Za-z_0-9]{1,}=[A-Za-z_0-9]{1,})*$"); var re = new RegExp("^(&[A-Za-z_0-9]{1,}=[A-Za-z_0-9]{1,})*$"); |
|
| 70. |
What Is A Fixed-width Table And Its Advantages? |
|
Answer» Fixed width tables are rendered by the browser based on the widths of the columns in the first row, resulting in a faster display in case of large tables. Use the CSS STYLE table-layout:fixed to SPECIFY a fixed width table. Fixed width tables are rendered by the browser based on the widths of the columns in the first row, resulting in a faster display in case of large tables. Use the CSS style table-layout:fixed to specify a fixed width table. |
|
| 71. |
How Can Javascript Make A Web Site Easier To Use? That Is, Are There Certain Javascript Techniques That Make It Easier For People To Use A Web Site? |
|
Answer» JavaScript's greatest potential gift to a Web site is that scripts can make the page more immediately interactive, that is, interactive WITHOUT having to SUBMIT every little thing to the SERVER for a server PROGRAM to re-render the page and send it back to the client. For example, consider a top-level navigation panel that has, say, six primary image map links into subsections of the Web site. With only a little bit of scripting, each map area can be instructed to pop up a more detailed list of links to the contents within a subsection whenever the user rolls the cursor ATOP a map area. With the help of that popup list of links, the user with a scriptable browser can bypass one intermediate menu page. The user without a scriptable browser (or who has disabled JavaScript) will have to drill down through a more traditional and time-consuming path to the desired content. JavaScript's greatest potential gift to a Web site is that scripts can make the page more immediately interactive, that is, interactive without having to submit every little thing to the server for a server program to re-render the page and send it back to the client. For example, consider a top-level navigation panel that has, say, six primary image map links into subsections of the Web site. With only a little bit of scripting, each map area can be instructed to pop up a more detailed list of links to the contents within a subsection whenever the user rolls the cursor atop a map area. With the help of that popup list of links, the user with a scriptable browser can bypass one intermediate menu page. The user without a scriptable browser (or who has disabled JavaScript) will have to drill down through a more traditional and time-consuming path to the desired content. |
|
| 72. |
What's Relationship Between Javascript And Ecmascript? |
|
Answer» ECMASCRIPT is yet another NAME for JavaScript (other NAMES include LiveScript). The current JavaScript that you see SUPPORTED in browsers is ECMAScript revision 3. ECMAScript is yet another name for JavaScript (other names include LiveScript). The current JavaScript that you see supported in browsers is ECMAScript revision 3. |
|
| 73. |
Is A Javascript Faster Than An Asp Script? |
|
Answer» Yes.Since javascript is a client-side SCRIPT it does require the WEB server's HELP for its computation,so it is always faster than any server-side script like ASP,PHP,etc.. Yes.Since javascript is a client-side script it does require the web server's help for its computation,so it is always faster than any server-side script like ASP,PHP,etc.. |
|
| 74. |
How To Read And Write A File Using Javascript? |
|
Answer» I/O operations like reading or writing a FILE is not possible with client-side javascript. However , this can be DONE by coding a Java APPLET that reads FILES for the SCRIPT. I/O operations like reading or writing a file is not possible with client-side javascript. However , this can be done by coding a Java applet that reads files for the script. |
|