Interview Questions
Interview Questions
To remove themes from your page, use the EnableTheming attribute of the
Page directive.
Your client complains that he has a large form that collects user
input. He wants to break the form into sections, keeping the
information in the forms related. Which control will you use?
The ASP.NET Wizard Control.
Do WebServices support data reader?
No. However it does support a dataset.
What is use of the AutoEventWireup attribute in the Page directive?
The AutoEventWireUp is a boolean attribute that allows automatic wireup of
page events when this attribute is set to true on the page. It is set to True by
default for a C# web form whereas it is set as False for VB.NET forms. Pages
developed with Visual Studio .NET have this attribute set to false, and page
events are individually tied to handlers.
What happens when you change the web.config file at run time?
ASP.NET invalidates the existing cache and assembles a new cache. Then
ASP.NET automatically restarts the application to apply the changes.
Can you programmatically access IIS configuration settings?
Yes. You can use ADSI, WMI, or COM interfaces to configure IIS
programmatically.
How does Application Pools work in IIS 6.0?
As explained under the IIS documentation, when you run IIS 6.0 in worker
process isolation mode, you can separate different Web applications and Web
sites into groups known as application pools. An application pool is a group of
one or more URLs that are served by a worker process or set of worker
processes. Any Web directory or virtual directory can be assigned to an
application pool.
Every application within an application pool shares the same worker
process. Because each worker process operates as a separate instance of the
worker process executable, W3wp.exe, the worker process that services one
application pool is separated from the worker process that services another.
Each separate worker process provides a process boundary so that when an
application is assigned to one application pool, problems in other application
pools do not affect the application. This ensures that if a worker process fails,
it does not affect the applications running in other application pools.
Use multiple application pools when you want to help ensure that
applications and Web sites are confidential and secure. For example, an
enterprise organization might place its human resources Web site and its
finance Web site on the same server, but in different application pools.
Likewise, an ISP that hosts Web sites and applications for competing
companies might run each company Web services on the same server, but in
different application pools. Using different application pools to isolate
applications helps prevent one customer from accessing, changing, or using
confidential information from another customer site.
In HTTP.sys, an application pool is represented by a request queue, from
which the user-mode worker processes that service an application pool
collect the requests. Each pool can manage requests for one or more unique
Web applications, which you assign to the application pool based on their
URLs. Application pools, then, are essentially worker process configurations
that service groups of namespaces.
Multiple application pools can operate at the same time. An application, as
defined by its URL, can only be served by one application pool at any time.
While one application pool is servicing a request, you cannot route the
request to another application pool. However, you can assign applications to
another application pool while the server is running.
What is an application server?
As defined in Wikipedia, an application server is a software engine that
delivers applications to client computers or devices. The application server
runs your server code. Some well known application servers are IIS
(Microsoft), WebLogic Server (BEA), JBoss (Red Hat), WebSphere (IBM).
Compare C# and VB.NET
What is a base class and derived class?
A class is a template for creating an object. The class from which other
classes derive fundamental functionality is called a base class. For e.g. If
Class Y derives from Class X, then Class X is a base class.
The class which derives functionality from a base class is called a derived
class. If Class Y derives from Class X, then Class Y is a derived class.
What is an extender class?
RIGHT JOIN or RIGHT OUTER JOIN - A right outer join is the reverse
of a left outer join. All rows from the right table are returned. Null
values are returned for the left table any time a right table row has
no matching row in the left table.
FULL JOIN or FULL OUTER JOIN - A full outer join returns all rows in
both the left and right tables. Any time a row has no match in the
other table, the select list columns from the other table contain null
values. When there is a match between the tables, the entire result
set row contains data values from the base tables.
Cross joins - Cross joins return all rows from the left table, each
row from the left table is combined with all rows from the right
table. Cross joins are also called Cartesian products. (A Cartesian
join will get you a Cartesian product. A Cartesian join is when you
join every row of one table to every row of another table. You can
also get one by joining every row of a table to every row of itself.)
46. What are the differences between UNION and JOINS?
A join selects columns from 2 or more tables. A union selects rows.
47. Can I improve performance by using the ANSI-style joins instead
of
the old-style joins?
Code Example 1:
select o.name, i.name
from sysobjects o, sysindexes i
where o.id = i.id
Code Example 2:
select o.name,
i.name
from sysobjects o inner join sysindexes i
on o.id = i.id
You will not get any performance gain by switching to the ANSI-style
JOIN syntax.
Using the ANSI-JOIN syntax gives you an important advantage: Because
the join logic is cleanly separated from the filtering criteria, you
can understand the query logic more quickly.
The SQL Server old-style JOIN executes the filtering conditions before
executing the joins, whereas the ANSI-style JOIN reverses this
procedure (join logic precedes filtering).
Perhaps the most compelling argument for switching to the ANSI-style
JOIN is that Microsoft has explicitly stated that SQL Server will not
support the old-style OUTER JOIN syntax indefinitely. Another
important consideration is that the ANSI-style JOIN supports query
constructions that the old-style JOIN syntax does not support.
48. What is derived table?
Derived tables are SELECT statements in the FROM clause referred to by
an alias or a user-specified name. The result set of the SELECT in the
FROM clause forms a table used by the outer SELECT statement. For
example, this SELECT uses a derived table to find if any store carries
all book titles in the pubs database:
SELECT ST.stor_id, ST.stor_name
FROM stores AS ST,
(SELECT stor_id, COUNT(DISTINCT title_id) AS title_count
FROM sales
GROUP BY stor_id
) AS SA
WHERE ST.stor_id = SA.stor_id
AND SA.title_count = (SELECT COUNT(*) FROM titles)
What are locks?
Microsoft SQL Server 2000 uses locking to ensure transactional
integrity and database consistency. Locking prevents users from
reading data being changed by other users, and prevents multiple users
from changing the same data at the same time. If locking is not used,
data within the database may become logically incorrect, and queries
executed against that data may produce unexpected results.