Dot Net Interview Questions: 1. Creational Design Pattern
Dot Net Interview Questions: 1. Creational Design Pattern
We make use of Get and Set keywords while working with properties. We prefix the
variables used within this code block with an underscore. Value is a keyword that holds
the value which is being retrieved or set.
> Can you have two files with the same file name in GAC?
> How can you tell the application to look for assemblies at the locations
other than its own install?
> How do you specify a custom attribute for the entire assembly rather than
for a class?
> Which method do you invoke on the DataAdapter control to load your
generated dataset with data?
> How can you provide an alternating color scheme in a Repeater control?
> What are good ADO.NET objects to replace the ADO Recordset object?
> Can you explain the difference between an ADO.NET dataset and an ADO
Recordset?
> What are the differences between Datalist DataGrid and DataRepeater?
1. Predefined attributes such as Assembly Version, which already exist and are
accessed through the Runtime Classes
2. Custom attributes which need to write by the coder himself by extending the
System.Attribute class.
> What are the three test cases in unit testing?
1. Positive test cases (correct data, correct output)
2. Negative test cases (broken or missing data, proper handling)
3. Exception test cases (exceptions are thrown and caught properly).
> Why it is better to throw our own exceptions in try catch bock?
If we know the point where an error has occurred, then why not write the proper code
to handle that error instead of passing a new Exception object to the catch block?
Throwing your own exceptions signifies some design flaws in the project.
> What is the difference between a Site Definition and a Site Template in
SharePoint Portal?
> Why the SessionID remain the same after the Session times out?
When session state expires after the timeout period, the session ID lasts as long as the
browser session. It implies that the same session ID can represent multiple sessions
over time where the instance of the browser remain the same.
> How can we make .NET programs work in Linux?
One of the Mono open source provides the necessary software to develop which helps
to run .NET client, server applications on Linux, Solaris, Mac OS X, Windows, and Unix.
Which is by Novell, the Mono open source project has an active and enthusiastic
contributing community and is positioned to become the leading choice for
development of Linux applications.
> Which one is trusted and which one is not Windows Authentication and
SQLServer authentication?
> Can we post and access view state in another application in ASP.NET 2.0?
We can post back to any page and pages in another application, too. But if we are
posting pages to another application, the PreviousPage property will return null. This is
a significant restriction, as it means that if we want to use the view state, we are
confined, for example, posting to pages in the same virtual directory. Even so, this is a
highly acceptable addition to the functionality of ASP.NET.
1. ThreadPriority.
2. Highest ThreadPriority.AboveNormal
3. ThreadPriority.Normal
4. ThreadPriority.BelowNormal
5. ThreadPriority.Lowest
> What changes are done in IIS 6.0 over IIS 5.0?
IIS makes easy to get information.IIS 6.0 is the next latest of web server available in
Windows Server 2003 platform. IIS 6.0 contains several enhancements over IIS 5.0 that
are mainly to increase reliability, manageability, scalability, and security. IIS 6.0 is a key
component of the Windows Server 2003 application platform, using which you can
develop and deploy high performance ASP.NET Web applications, and XML Web
Services.
> How to start Outlook and NotePad file in AsP.NET with code?
> Can you define what is SharePoint, and some overview about this?
Web custom controls: Web Custom Control is typical to create and good for dynamic
layout and another thing is it have full tool support for user and a single copy of control
is required because it
> What is Sandbox in SQL server and explain permission level in Sql Server?
b) Multivalued cookies. These are used in the way collections are used example
request.cookies (CookiName)(UserName) = dotnetquestionMahesh
request.cookies (CookiName)(UserID ) = interview
The three-tier architecture was comes into existence to improve management of code
and contents and to improve the performance of the web based applications. There are
mainly three layers in three-tier architecture. They are define as follows
1. Presentation
2. Business Logic
3. Database
1. First layer Presentation contains mainly the interface code, and this is shown to user.
This code could contain any technology that can be used on the client side like HTML,
JavaScript or VBScript etc.
2. Second layer is Business Logic which contains all the code of the server-side .This
layer have code to interact with database and to query, manipulate, pass data to user
interface and handle any input from the UI as well.
3. Third layer Data represents the data store like MS Access, SQL Server, an XML file, an
Excel file or even a text file containing data also some additional database is also added
to those layers
Properties:
Host: The name or IP address of email server.
Port: Port that is use when sending mail.
Methods:
Send: Enables us to send email synchronously.
SendAsynchronous: Enables us to send an email asynchronously.
Event:
SendCompleted: This event is raised when an asynchronous send operation
completes.
> Does .NET CLR and SQL SERVER run in different process?
Dot Net CLR and all .net relates application and SQLServer run in same process or we
can say that that on the same address because there is no issue of speed because if
these two process are run in different process then there may be a speed issue created
one process goes fast and other slow may create the problem.
Use the View State property to save data in a hidden field on a page. Because
ViewState stores data on the page, it is limited to items that can be serialized. If you
want to store more complex items in View State, you must convert the items to and
from a string. ASP.NET provides the following ways to retain variables between
requests:
Context.Handler object Use this object to retrieve public members of one Web forms
class from a subsequently displayed Web form.
Query strings Use these strings to pass information between requests and responses as
part of the Web address. Query strings are visible to the user, so they should not
contain secure information such as passwords.
Query strings Use these strings to pass information between requests and responses as
part of the Web address. Query strings are visible to the user, so they should not
contain secure information such as passwords.
View state ASP.NET stores items added to pages ViewState property as hidden fields on
the page.
Session state Use Session state variables to store items that you want keep local to the
current session (single user).
Application state Use Application state variables to store items that you want are
available to all users of the application.
dotnetquestion.xml#xpointer(/descendant::QuestionNo[@id=9])
> Why SharePoint is not a viable solution for enterprise wide deployments?
> ASP.NET Web Forms and How is this technology different than what is
available though ASP?
4. In the left pane, right-click Default Web Site, point to New, and then click Virtual
Directory.
5. In the first screen of the New Virtual Directory Wizard, type an alias, or name, for the
virtual directory (SiteName), and then click Next.
6. In the second screen, click Browse. Locate the content folder that you created to hold
the Web content. Click Next.
7. In the third screen, click to select Read and Run scripts (such as ASP). Make sure that
the other check boxes are cleared. Click Finish to complete the wizard.
We can find any control from the previous page and read its state:
Cross-page post back feature also solves the problem of posting a Form to multiple
pages, because each control, in theory, can point to different post back URL.
> Define three test cases you should go through in unit testing.
> Which file is taken by compiler when we have both file Application and
Server Configuration file?
Application Configuration File Values will over ride the values of server configuration
file. But only when we allow override set as True, if we do not allow override then
Application Configuration file variables cannot override the values of server
configuration file.
> What is serialization in .NET and what are the ways to control
serialization?
> Define what the function RANK function do and how it different from ROW
NUMBER.
RANK () OVER ([<partition_by_clause>] <order_by_clause>)
Returns the rank of each row within the partition of a result set.
Push model is used to insert the element only at the top position in table to database
with the help of object. But when we have to delete the top most record pull method is
used over push. Similar to stack operation
> What problem occurs when not implement proper locking strategy?
There are four major problems occur:
1. Dirty Reads
2. Unrepeatable reads
3. Phantom reads
4. Lost updates
> What is the difference between a primary key and a unique key?
They are used for: - Conditional compilation, Line control, Error and Warning reporting.
> Display the number of users sessions currently active your website?
Using the Session_Start and Session_End Events
Sub Session_Start (ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
Application ("UserCount") = Application ("UserCount") + 1
End Sub
Sub Session_End (ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
Application("UserCount") = Application("UserCount") - 1
End Sub
> Can you explain difference between .Net framework and .Net Compact
Framework?
> What do you think which is light weight control gridview, detailsview,
formview, datalist and repeater controls in ASP.NET 2.0?
> What is a jitter and how many types of jitters are there?
Medium (Pooled): In Medium pooled scenario, the IIS, and web application run in
different process. Therefore, in this case there are two processes process1 and
process2. In process1, the IIS process is running and in process2, we have all Web
application running.
High (Isolated): In high isolated scenario every process is running is their own
process. In below figure there are five processes and every one handling individual
application. This consumes heavy memory but has highest reliability.
Read Committed: SQL Server applied a share lock while reading a row into a cursor
but frees the lock immediately after reading the row. Because a shared lock request is
blocked by an exclusive lock, a cursor is prevented from reading a row that another
task has updated but not yet committed. Read committed is the default isolation level
setting for both SQL Server and ODBC.
Read Uncommitted: When no locks while reading a row into a cursor and honors no
exclusive locks. Cursors can be populated with values that have already been updated
but not yet committed. The user is bypassing all of SQL Servers locking transaction
control mechanisms.
Syntax:
IsNull (<column_name>,’SQL’)
If <column_name> is null then the function returns ‘SQL’ else function returns the
column data.
> What are the valid parameter types we can pass in an Indexer?
> What are the GLOBAL and LOCAL cursors in SQL SERVER 2005?
> What is Global Assembly Cache and what is the purpose of it?
> Does SQLClient and OLEdb class share the same function?
> What is the different between <%# %> and <%= %>?
Late binding: the type of an object is known only at runtime. It will need extra
instructions to find out where is the method to be called before calling it.
USE msdb
GO
DECLARE @DaysToKeepHistory DATETIME
SET @DaysToKeepHistory = CONVERT(VARCHAR(10), DATEADD(dd, -30, GETDATE()),
101)
EXEC sp_delete_backuphistory @DaysToKeepHistory
GO
DataAdapter is not only connect with the Database (through Command object) it
provide four types of command (Insert, Update, Delete, Select). It supports to the
disconnected Architecture of .NET show we can populate the records to the DataSet,
where as DataAdapter is best fit to work on data.
Data mining is process of finding the hidden trends is called the data mining.
> To set the culture and UI culture for an ASP.NET Web page declaratively?
> How to determine the service pack currently installed on SQL Server?
Namespace:
1. Namespace is logical grouping unit.
2. It is a Collection of names wherein each name is Unique.
3. They form the logical boundary for a Group of classes.
4. Namespace must be specified in Project-Properties.
Assembly:
1. Assembly is physical grouping unit.
2. It is an Output Unit. It is a unit of Deployment & a unit of versioning.
3. Assemblies contain MSIL code.
4. Assemblies are Self-Describing.
> Which methods are used which allow application object to do one process
access at a time?
> How to add new column in the existing table at our desired location?
Alter Table dotnet ADD Column (ASPNET Varchar2(28),SQL Number(6));
> Define Ajax with suitable Example.
1) Private
2) Protected
3) Internal
4) Protected Internal
5) Public
What is Silverlight
Silverlight helps in development of rich interactive applications for the Web. Silverlight is
delivered as a cross-platform and cross-browser plug-in that exposes a programming
framework and features that are a subset of the .NET Framework and WPF.