ASP Interview Questions
1.
a = 1 </SCRIPT> a = 2 </SCRIPT> <% Response.Write a %>
In the sample code shown above, what will be written to the
screen?
A. 1
B. 2
C. 1, 2
D. 1&2
E. Nothing.
2.
<% Set Application("Thing") = Server.CreateObject("THINGDOER.thingy") %>
The above code appears in the global.asa file. What would it
accomplish?
A. It would create a “Thing” object and place it in Contents Collection of
the Application object.
B. It would create a “Thing” object and place it in StaticObjects
Collection of the Application object.
C. It would create a “Thing” object and place it in the Application.Buffer
Collection Of the Application object.
D. It would create an application-level variable named “Thing” with the
value of the object property “THINGDOER.thingy”.
E. It would fail to create a “Thing” object because the code requires the
Application.Lock and Application.Unlock methods.
3.
<% iPos = Instr("Hello World","r") %>
Referring to the above, what is the value of iPos?
A. 0
B. 1
C. 2
D. 8
E. 9
4.
<% varType = rsTest("field1").type %>
In the database table, if the datatype for field1 (shown
above) is Number, what is the value of varType?
A. The field value.
B. A string description.
C. The field name.
D. NULL.
E. An enumerator.
5. What is the program ID (ProgID) for ActiveX Data Objects in 2-tier and 3-tier database applications?
A. ADO
B. RDODB
C. ADODB
D. RDS
E. OLEDB
6. Which choice is NOT an ADO collection?
A. Properties
B. Records
C. Fields
D. Errors
E. Parameters
7. Which will NOT set the scope of an Active Server Component?
A. Setting the [component name].scope property.
B. Using the Server.CreateObject method.
C. Placing it in the Session or Application OnStart event handler.
D. Instantiating the component in the global.asa file.
E. Using the
8. How to handle Error in ASP
A. Using On Error Goto
B. Using On Error Resume
C. Using On Error Resume Next
D. Using On Error Goto 0
9.
<%
intA = 3
sStrA = "Hello World"
sStrB = "Hello World" + intA
Response.Write sStrB
%>
What would be the result of the above code?
A. Type mismatch error
B. “Hello World, Hello World, Hello World”
C. 0
D. “Hello World 3”
E. “Hello World”
10. What happens when a client submits a form which changes the
value of an Application variable?
A. Client actions cannot change Application variables.
B. The change is not visible to any client until the application is stopped
and started.
C. The change is only visible to future requests made by that
client during their current session.
D. The change is visible to all clients, but only after they
complete their current sessions and begin a new session.
E. The change is visible to all clients immediately after the
form is processed by the server.
11. ADO is an object model for accessing which of the
following?
A. Relational data via Jet.
B. Local or SQL data via Jet.
C. Relational data via ODBC.
D. Non-relational data via DSN-less ODBC.
E. All types of data via OLE DB.
12. Which of the following are Server Object methods ( Choose Two)
A. HTMLEncode,MapPath
B. URLEncode,ScriptTimeout
C. URLEncode,CreateObject
D. ScriptTimeout,Abandon
13. Following is the code Server.MapPath (“.”) consider the path is C:\Inetpub\WWWRoot\MAT\Default.asp. What will be the output
A. C:\InetPUb
B. C:\InetPUb\WWWroot
C. C:\InetPUb\wwwroot\MAT
D. Error
14. ClientCertificate is a collection of
A. Server
B. Response
C. Request
D. ObjectContext