ASP, ADO and IIS interview questions

This came in the mail from the reader who recently went through a job interview process. He didn’t mention the company name.

  1. Why do you use Option Explicit?
  2. What are the commonly used data types in VBScript?
  3. What is a session object?
  4. What are the three objects of ADO?
  5. What are the lock-types available in ADO? Explain.
  6. What are the cursor types available in ADO? Explain.
  7. What is a COM component?
  8. How do you register a COM component?
  9. What is a virtual root and how do you create one?
  10. What is a database index, how do you create one, discuss its pros and cons?
  11. How do you use multiple record sets (rs.NextRecordSet)?
  12. As soon as you fetch a record set, what operations would you perform?
  13. Define a transaction. What are ACID properties of a transaction?
  14. How would you remotely administer IIS?
  15. What is RAID? What is it used for?
  16. What is normalization? Explain normalization types.
  17. What is the disadvantage of creating an index in every column of a database table?
  18. What are the uses of source control software?
  19. You have a query that runs slowly, how would you make it better? How would you make it better in .NET environment?
  20. What is a bit datatype? What is it used for?
  21. How would you go about securing IIS and MS-SQL Server?
  22. What is the difference between Request(”field”) and Request.Form(”field”)?
This entry was posted in VB, Windows. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

27 Comments on ASP, ADO and IIS interview questions

  1. Minnie
    Posted 7/11/2004 at 10:00 am | Permalink

    All questions are good and helpful too.Its good to have a website of interview questions.

  2. Steve Campbell
    Posted 7/12/2004 at 1:49 pm | Permalink

    1) Why do you use Option Explicit?
    To force that all variables are declared.

    2) What are the commonly used data types in VBScript?
    Trick question? All data types in VBScript are variants.

    3) What is a session object?
    A session object is a server object that lets you store information that is associated with a specific connection to the server.

    7) What is a COM component?
    Any VB6 DLL is a COM component, as is any Windows DLL or EXE that supports the COM interfaces.

    8) How do you register a COM component?
    regsvr mycomponent.dll

    16) What is normalization? Explain normalization types.
    Database normalization is the process of changing a relational database structure to be the most efficient for the particular purpose. The most commonly known form is “Third Normal Form”, which allows for zero duplicate data, except for foreign keys.

    17) What is the disadvantage of creating an index in every column of a database table?
    Insert and update performance will suffer, and the database indexes may take a lot of hard disk space.

    18) What is a bit datatype? What is it used for?
    In SQL Server, the bit datatype allows values of NULL, 0 (false) and 1 (true). Of course, it can be specified as a not-null column, in which case it only allows 0 and 1.

    22) What is the difference between Request(”field”) and Request.Form(”field”)?
    The former term allows simultaneous querying of both the form fields and the querystring fields.

  3. Maria
    Posted 9/1/2004 at 12:27 pm | Permalink

    What is the difference between function and sub?

  4. Deepak Sharma
    Posted 9/14/2004 at 3:43 am | Permalink

    Nice Question. But if the conceptual question or question based on certain situation or scenario can be provided, that will be too good.

  5. Mohd Haneef
    Posted 9/26/2004 at 8:08 am | Permalink

    What is the difference between function and sub?
    Function can return value !!!
    public function myFunction()as boolean
    end function

  6. umar iqbal
    Posted 10/8/2004 at 3:36 am | Permalink

    Very nice. Trust me many companies ask these type of question especially when u r taking interview on phone.

  7. malini
    Posted 11/1/2004 at 7:58 am | Permalink

    What is a database index, how do you create one, discuss its pros and cons?

  8. Sandhya
    Posted 11/3/2004 at 7:44 pm | Permalink

    3. # objects of ADO are Command object, Connection object and Recordset object.

  9. Maria
    Posted 11/4/2004 at 2:06 pm | Permalink

    How do you handle the err.handling in VB?

  10. Khushru
    Posted 11/14/2004 at 10:49 pm | Permalink

    4>What are the three objects of ADO?
    Ans > The 3 types of Primary objects are Command, Connection and Recordset and secondary objects are parameters, properties and errors

  11. Khushru
    Posted 11/14/2004 at 10:54 pm | Permalink

    5> What are the lock-types available in ADO? Explain.
    Ans> There are 5 Lock types available in ADO they are 1) AdLockReadOnly, 2) AdLockOptimestic, 3) AdLockPassimestic, 4) AdLockBatchOptimestic and 5)AdLockUnspecified

  12. Rajesh Nair
    Posted 11/19/2004 at 2:05 pm | Permalink

    Is polymorphism possible in VB??

  13. Jerin
    Posted 12/14/2004 at 1:52 am | Permalink

    What is RAID?
    RAID(Redundant Arrays of Inexpensive Disks)
    is a technology used to increase hardware perfomance and tolerance.

  14. Jerin
    Posted 12/14/2004 at 1:57 am | Permalink

    Lock Types Available in ADO:

  15. Jerin
    Posted 12/14/2004 at 2:01 am | Permalink

    There are Four different Lock Types.They are 1)adLockReadOnly(default) 2)adLockOptimistic 3)adLockPessimistic(Not avilable for Client side)4)adLockBatchOptimistic. All the four lock types are available for server side.

  16. Posted 3/21/2005 at 2:33 pm | Permalink

    Some more that no one’s answered yet:

    -What are the commonly used data types in VBScript?

    All variables in VBScript/VB are variants in general, but that’s an oversimplification. If you’re doing math, you should use CInt, CDbl, or some other numeric type conversion on all incoming variables. Also, if you know a variable is numeric, it’s good form (although not required) to CStr it before using it as a string.

    -What is a virtual root and how do you create one?

    A virtual root is essentially a new web site in IIS. You’d create one in the MMC by either selecting “New Virtual Site” from the site context menu, or clicking “Create” in the Home Directory tab in the properties for any existing folder. Using the first method, you can also create a virtual root that points to a logical directory outside the current web root. The new virtual root is largely, although not completely, as configurable as a new web site.

    -What is a database index, how do you create one, discuss its pros and cons?

    To create one, use CREATE INDEX. As answered previously, an index hurts the insert/update performance of the table slightly but greatly helps the select performance of queries that use the keys involved. In SQL Server, if a column is in a multi-column index, any query using that column (even without the others involved) will be sped up; in some other databases, this is not the case. In general, if a table is primarily used for insert (e.g. — the table where you collect name/email of people who sign up for your newsletter), don’t index it. If it’s primarily used for select (e.g. — the product table), index it based on the execution plan of the most common queries (which should often be in an SP, if available, anyway).

    -How do you use multiple record sets (rs.NextRecordSet)?

    Just like that… If your query returned multiple recordsets and returned objRst from .Execute, use Set objRst = objRst.NextRecordSet. If there’s another recordset, it’ll be Nothing. Beware of this with DB stacks that are not fully ADO compliant. VBScript sometimes hangs.

    -How would you remotely administer IIS?

    There really isn’t a beautiful secure method to administer any web server remotely. That having been said, Win2K and Win2K3 come with a limited terminal services server built in for remote administration of the server. Set it up as remote client and use the TS client or Remote Desktop Connection on the client to login. From there, use MMC as if you were logged on locally.

    There’s also an admin site built into IIS, but I’ve never seen any secured or hardened setup where it hadn’t been deleted in step 1 of system installation.

    -What are the uses of source control software?

    If you have two people developing against a code base, you need source control. If the two people aren’t sitting next to each other (and often if they are), you probably want software for source control. It prevents two people from modifying the same thing at the same time and generally deals with versioning.

    -You have a query that runs slowly, how would you make it better? How would you make it better in .NET environment?

    There are lots of answers, each of which work better or worse depending on the environment. Here are enough to pass most interviews:
    1. Add hardware. Usually the last solution.
    2. Find out if there’s something holding it up. Network bottlenecks, authentication errors, old or trial DB stacks, and long lists of handled exceptions can kill your query.
    3. Run the query directly against the DB on the local machine. If it’s slow, check the execution plan. You may be doing too many table scans. Indexes might help.
    4. If you can, and you usually can, use a stored procedure instead of a direct parameterized query.
    5. If your “.NET environment” is WinForms, put the query runner in a separate thread. In any type of application, consider taking the thread out of the system ThreadPool for long-running queries. It’s small and it can block under heavy load. The .NET compiler creates async proxies for lots of stuff and they’re surprisingly easy to use.
    6. Check your execution plan. The first query I write to get my product out the door on schedule to satisfy a RAD manager is usually very different from the one that should be in production code that all the users run hundreds of times a day.

    -How would you go about securing IIS and MS-SQL Server?

    (In general, it is very dangerous to let a developer secure anything. Developers often write secure code but aren’t generally the best at securing systems. You *need* a good sysadmin for this. If the company you’re interviewing with wants developers to be sysadmins, seriously consider not taking the job. Then again, sometimes the decision is to go with it anyway… in that case, this answer assumes you’re on 2K or 2K3.)

    Most importantly, and the one step that will make the most difference: stay up to date on patches and keep security software (AV, firewall, IDS, maybe even packet logging, etc.) running.

    IIS authenticates against domain users (even if the domain is “Local Machine”). Make sure you have no spurious users, and secure everyone’s passwords. If possible, segregate public web machines into different ACL segments (e.g. — a different domain). Also, be careful with security policies. The standard server install comes with hardened LSP templates, which you should consider if you’re not experienced enough to build your own. Non-front tiers should have tight security policies barring anyone outside the adjacent tiers (and maybe a test machine or two) from access.

    SQL Server is difficult and annoying to harden if you’re not experienced. The warning for not having a sysadmin goes double for not having a proper DB admin. Logging on SQL 2000 is sparse from the security perspective, so also consider a third party intrusion detection system (Longhorn promises changes). Change the sa password to something that looks like the result of a SHA1 hash.

    -What is the difference between Request(”field”) and Request.Form(”field”)?

    Aside from that mentioned above, Request(string) searches Form, QueryString, Session, cookies, and Application, using the first correct it finds. I’m not up on the exact order; I *think* it’s the order above, but you really should check the docs. Using the defult accessor (i.e. — not specifing “Form” or “QueryString”) adds overhead, so be aware of it for performance-critical sections of code.

  17. Prem
    Posted 3/29/2005 at 2:05 am | Permalink

    6. What are the cursor types available in ADO? Explain.

    The cursor types are- adOpenForwardOnly, adOpenKeyset, adOpenDynamic and adOpenStatic.
    The default opotion is forward only. The simplest type of cursor is the static cursor (adOpenStatic). It generates a static list of rows at the point in time it is executed. You can move forward and backward through result sets. If another user changes a record in your cursor you won’t see the change. Forward only cursors (adOpenForwardOnly) are static cursors but you can only go forward through the rows. Dynamic cursors (adOpenDynamic) show changes that other users make and allow you move forward and backward. Keyset cursors (adOpenKeyset) are like dynamic cursors but you can’t see records that are added by other users and deleted records in not accessible.

  18. Prem
    Posted 3/29/2005 at 2:27 am | Permalink

    21. How would you go about securing IIS and MS-SQL Server?

    In IIS there are 4 types of authentication security - Basic, Anonymous, Digest & Integrated windows Authentication.
    Basic- Users are presented with logon dialog generated by browser. The data is sent through network which is not secure(password is not encrypted).
    Anonymous-Any users can access the website provided itsnot been restricted. If any ip address is blocked then that machine will not be able to browse the site.
    Digest-This is similar to basic but data sent is encrypted and protected.
    Integrated windows-This uses the windows login authentication mode.When you try to access a machine through network windows authentication dialog pops up asking for username & password. It works in similar way. This can be usefult for intranet purpose.

    To secure Sql server you can either use windows authntication mode or set users and roles for particular database or set a strong sa password.
    Windows Authentication-Expand a server group.Right-click a server, and then click Properties.On the Security tab, under Authentication, click Windows only.
    Users & Roles- In enterprise manager u can create a separate user & role for individual.
    Strong sa password-Change the system admin password other than sa.

  19. Posted 4/21/2005 at 1:40 pm | Permalink

    A directory that appears to be a subfolder to the root of the server but may actually exist in a subfolder that is any number of levels under the root or elsewhere on the network. In PWS you can create a Virtual Dir by going to Advanced and then clicking Add and browsing for the directory.

  20. abdullah
    Posted 4/26/2005 at 6:11 am | Permalink

    why we use public function within a form , instead of private

  21. pradeep
    Posted 5/14/2005 at 8:33 am | Permalink

    sir,
    how to optimize oracle database server?
    thank you

  22. sumit
    Posted 5/20/2005 at 2:11 am | Permalink

    hi….

    it’s good to have a site that provides interview questions.
    this will really add to the moral of the person preparing for the interview,
    specially freshers.

    I have one question……
    Can anybody tell me what is Detum(or datum)?

  23. Afroze Qasim
    Posted 7/20/2005 at 2:39 pm | Permalink

    Questions:
    1.Why do you use Option Explicit.
    2.What are the data types in VBScript.
    3.What is a session Object.
    4.What are the three Objects of ADO.
    5.What are the lock-types available in ADO.Explain.
    6.What are the cursor types available in ADO.Explain.
    7.What is a COM component.
    8.How do you register a COM component.
    9.What is a virtual root and how do you create one?.
    10.What is a database index, how do you create one, discuss it’s pros and cons.
    11.What is the default language of ASP.
    12.How do you use multiple record sets( rs.NextRecordSet ). 13.As soon as you fetch a record set, what operations would you perform.
    14.Define a transaction. What are acid properties of a transaction.
    15.How would you remotely administer IIS.
    16.What is RAID? What is it used for.
    17.What is normalization?. Explain normalization types.
    18.What is the disadvantage of creating an index in every column of a database table.
    19.You have a query that runs slowly, how would you make it better.
    20.What is a bit datatype?.What is it used for.
    21.How would you go about securing IIS and MS-SQL Server.

    Answers:

    1. Using Option Explicit requires that all variables be declared before being used. (It is considered to be good programming practice)
    2. VBScript consists of only one data type (Variant)
    3. A Session Object holds information relevant to a particular users session.
    4. Connection, Command, Recordset (There are actually more than 3 (Primary objects are (Connection, Command, Field and Recordset) Secondary objects are (Parameters, Properties and Errors)))
    5.
    adLockReadOnly (1) - Indicates read-only records. You cannot alter the data.
    adLockPessimistic (2) - Indicates pessimistic locking, record by record. The provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately after editing.
    adLockOptimistic (3) - Indicates optimistic locking, record by record. The provider uses optimistic locking, locking records only when you call the Update method.
    adLockBatchOptimistic (4) - Indicates optimistic batch updates. Required for batch update mode.
    adLockUnspecified (-1) - Does not specify a type of lock. For clones, the clone is created with the same lock type as the original.

    Example:

    Code:

    Set Rs = Server.CreateObject(”ADODB.Recordset”)
    Rs.LockType = adLockReadOnly
    6.
    adOpenForwardOnly (0) - Default. Uses a forward-only cursor. Identical to a static cursor, except that you can only scroll forward through records. This improves performance when you need to make only one pass through a Recordset.
    adOpenKeyset (1) - Uses a keyset cursor. Like a dynamic cursor, except that you can’t see records that other users add, although records that other users delete are inaccessible from your Recordset. Data changes by other users are still visible.
    adOpenDynamic (2) - Uses a dynamic cursor. Additions, changes, and deletions by other users are visible, and all types of movement through the Recordset are allowed, except for bookmarks, if the provider doesn’t support them.
    adOpenStatic (3) - Uses a static cursor. A static copy of a set of records that you can use to find data or generate reports. Additions, changes, or deletions by other users are not visible.
    adOpenUnspecified (-1) - Does not specify the type of cursor.

    Example:

    Code:

    Set Rs = Server.CreateObject(”ADODB.Recordset”)
    Rs.CursorType = adOpenDynamic
    7. A COM component can be any type of external or internal object that is called to perform an operation (uploading, error handling, etc…)

    Example:

    Code:

    ‘Call a COM component to create a mailing object
    Set objMail = Server.CreateObject(”CDONTS.MailSender”)
    8. regsvr32 path\componentname

    Example: To register a component call Help.dll, located in C:\COMObjects folder

    Code:

    Regsvr32 “C:\COMObjects\Help.dll”

    To unregister

    Regsvr32 “C:\COMObjects\Help.dll” /u
    9. Better known as Virtual Directory. Allows you to create multiple website under 1 ip address. Allows you reference another location (folder) to include additional functionality.

    To create one
    1) Open IIS Manager
    2) Right click the default site and “New”>”Virtual Directory”.
    3) Type the name of the virtual directory and then browse to the location you would like to reference.

    10. Indexes in SQL Server are similar to the indexes in books. They help SQL Server retrieve the data quicker. Indexes are of two types. Clustered indexes and non-clustered indexes. When you create a clustered index on a table, all the rows in the table are stored in the order of the clustered index key. So, there can be only one clustered index per table. Non-clustered indexes have their own storage separate from the table data storage. Non-clustered indexes are stored as B-tree structures (so do clustered indexes), with the leaf level nodes having the index key and it’s row locater. The row located could be the RID or the Clustered index key, depending up on the absence or presence of clustered index on the table. If you create an index on each column of a table, it improves the query performance, as the query optimizer can choose from all the existing indexes to come up with an efficient execution plan. At the same t ime, data modification operations (such as INSERT, UPDATE, DELETE) will become slow, as every time data changes in the table, all the indexes need to be updated. Another disadvantage is that, indexes need disk space, the more indexes you have, more disk space is used.

    11. VBScript
    12. Using rs.NextRecordset (http://www.15seconds.com/howto/pg000089.htm)
    13. Check to make sure records were returned…if so, then manipulate them.
    14. A transaction is a process where either something completes or it fails depending on its requirements

    ACID properties of a transaction
    A - Atomicity = The entire sequence of actions must be either completed or aborted. The transaction cannot be partially successful.
    C - Consistency = The transaction takes the resources from one consistent state to another.
    I - Isolation = A transaction’s effect is not visible to other transactions until the transaction is committed.
    D - Durability = Changes made by the committed transaction are permanent and must survive system failure.

    15. Administer through the web browser or through the IIS Snap-in (Microsoft Suggestions [http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q308/1/69.ASP&NoWebContent=1])

    16. RAID (Redundant Array of Inexpensive Disks) is used to provide fault tolerance to database servers. (Basically for data protection just in case a hard drive or system fails)

    17. There are 4 normal forms to database normalization.
    You can view the details here (http://databases.about.com/library/weekly/aa080501a.htm)
    18. Disadvantage is it slows down the modification of data into those columns because every time data changes in the table, all the indexes need to be updated.
    19. This is a very open ended question and there could be a lot of reasons behind the poor performance of a query. But some general issues that you could talk about would be: No indexes, table scans, missing or out of date statistics, blocking, excess recompilations of stored procedures, procedures and triggers without SET NOCOUNT ON, poorly written query with unnecessarily complicated joins, too much normalization, excess usage of cursors and temporary tables. Some of the tools/ways that help you troubleshooting performance problems are: SET SHOWPLAN_ALL ON, SET SHOWPLAN_TEXT ON, SET STATISTICS IO ON, SQL Server Profiler, Windows NT /2000 Performance monitor, Graphical execution plan in Query Analyzer. Download the white paper on performance tuning SQL Server from Microsoft web site. Don’t forget to check out SQL Server Performance (http://sql-server-performance.com/)
    20. Bit data type consists of either 1 or 0 (on or off) is generally used as a boolean type where the answer is either true/false, on/off, yes/no, etc…
    21. Details (http://www-2.cs.cmu.edu/~help/security/windows_services.html)

  24. Posted 12/13/2005 at 2:25 am | Permalink

    How many controls can be placed in the vb form?

  25. thiru
    Posted 4/21/2006 at 9:29 am | Permalink

    how to count the number words in the Ms-word document form vb?

  26. Arun
    Posted 12/9/2006 at 12:09 am | Permalink

    How can we disable short cut keys ( Alt+tab/minimize/maximize) in web page through ASP.net

  27. Mujeeb
    Posted 12/19/2006 at 10:46 pm | Permalink

    GREAT QUESTINS LIKE TO SEE MORE

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*