Sie sind auf Seite 1von 17

Mutable and Immutable classes

Immutable type are types in which instance data fields and properties does not change
after the creation of instance in another way we can say that value is changed in same
memory and also helps in performance boosting. On the other hand mutable type are A
type whose instance data fields and properties can be changed when the instance is
created or we can also say when we change the value of Mutable objects the new memory
is created and new value is stored in new memory Most Reference Types are mutable.

What do you mean by HashMapping


Hash map is same as hash table but it will allows null values as keys and objects one
more feature is Hashmap is not synchronized one but hashtable is synchronized. We can
use hash map when data is in form of key pair values.

Difference between strong type and weak type


Strong types are type checked which is done at the time of compiling and on the other
hand Weak types is done at run time. If we have a big programs then we will use strong
type. And at the time of we are doing Scripting we uses the weak type.

How many design patterns are there in asp.net


There are three types of Design Pattern

1 Creational

2 Structural

3 Behavioral

Creational Design Pattern :


Abstract Factory Creates an instance of several families of classes .
Builder Separates object construction from its representation .
Factory Method Creates an instance of several derived classes .
Prototype A fully initialized instance to be copied or cloned .
Singleton A class of which only single instance can exist .
Structural Design Pattern :
Adapter Match interfaces of different classes
Bridge Separates an objects interface from its implementation .
Composite A tree structure of simple and composite objects .
Decorator Add responsibilities to objects dynamically .
Facade A single class that represents an entire subsystem .
Flyweight A fine grained instance used for efficient sharing .
Proxy An object representing another object .
Behavioral Design Pattern :
Chain of Resp. A way of passing a request between a chain of objects .
Command Encapsulate a command request as an object .
Interpreter A way to include language elements in a program .
Iterator Sequentially access the elements of a collection .
Mediator Defines simplified communication between classes.
Memento Capture and restore an objects internal state .
Observer A way of notifying change to a number of classes .
State Alter an objects behavior when its state changes .
Strategy Encapsulates an algorithm inside a class
Template Method Defer the exact steps of an algorithm to a subclass.
Visitor Defines a new operation to a class without change

what is the default port for Http and Https


80 and 443

What do you mean by WCF and WPF and WWF


WPF is also known as AVALON its basically a presentation platform provided by
Microsoft. Its a rich client applications which have full graphical capabilities . Its provide
powerful, flexible programming model also integrates support for flexible layout, high-
quality resolution-independent graphics, animation, video and 3D. Basically it is
designed to provide the full capabilities of the high-performance graphics cards, it offers
high-level abstractions that offer great power to the developer for less development effort
than ever before.

WCF is also knowon as Indigo . Its a set of .NET technologies for building and running
connected systems comes with asp.net 3.0 and 3.5 and for asp.net 2.0 user have to install
the MS add in component for WCF. . WCF comes up as a replacement for Remoting and
Web service in dotnet. It can use the protocols like Http and TCP comes with default
windows based security feature. The componets WCF are data contract, Service Contract
and the Service programme. WCF can be extended to use protocols other than SOAP to
communicate with Web services

WWF is also known as WORKFLOW .We can automate all the process there may be
some points in a process will require interaction from a human, device or perhaps even
another system. A workflow is the steps in a path a of process that takes into account
points where interactions take place. Initally WWF engine will work in just Visual Studio
2005 for the moment but will soon be included in Biztalk and Sharepoint services.

Is it possible to add object in ViewState in .NET


Only that object can be stored in ViewState which have Serializable feature or have
TypeConverter option is available.

How ASP.NET page can be run in Apache Web Server


The mod_mono Apache module is used to run ASP.NET applications within the Apache
(http://httpd.apache.org) web server. Mod_mono is available from (http://www.mono-
project.com/Downloads).XSP is a standalone web server written in C# that can be used to
run your ASP.NET applications.XSP works under both the Mono and Microsoft runtimes
and the code is available from(http://www.mono-project.com/Downloads).

Is it possible to turn off cookies for one page


By setting Cookie.Discard property false.

Is it possible to consume Java Web Service in .NET


application
Yes it is possible because webservices are independent to language because its depends
on WSDL and Soap. Because WSDL and Soap both supports XML and language are
XML parsing capability and also access to HTTP protocol.

What is Attributes in .NET


We can say Attributes are declarative tags in .NET code that will insert additional
metadata into assembly .In .NET two types of attributes

(1)Predefined attributes such as Assembly Version, which already exist and are accessed
through the Runtime Classes

(2)Custom attributes, which neet 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 bed 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 CAML in Sharepoint


CAML stands for Collaborative Application Markup Language. It is an XML-based
language that is used in Microsoft Windows SharePoint Services to define sites and lists
including fields, views, or forms. CAML is also used to define tables in the Windows
SharePoint Services database during site provisioning.

Why to use SiteMap and what is its purpose


SiteMap describe the structure of the site and so that site navigation API and the site
navigation controls can expose the site structure properly.By default its contains a XML
file but we can use alternative data sources for this.

How many types of Navigation controls are there in


asp.net
There are 4 types Navigation controls in asp.net
1.Pointer
2.SiteMapPath
3.Menu
4.TreeView.

Why to use caching in asp.net


When we use Caching for frequent used data it will increases the scalability.When we use
caching for objects it will get lot faster.

How we get the page scroll position


With the help of MaintainScrollPositionOnPostback in Page directive.

Is it possible to use Events with threading


Yes, we can use events with thread because this is one of the techniques to synchronize
one thread with other.
What do you mean by NUnit
Its a unit-testing framework for all the .Net language and its ported from JUnit its version
2.2 it is xUnit based unit testing tool for Microsoft .NET. It is written entirely in C# and
has been completely redesigned to take advantage of many .NET language features.

How to encode a string


string ss="pervej";

string encode=Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(ss));

Response.Write(encode);

Some silent features of Visual Studio 2008


Here are some most important features of VS 2008.

(1)Expression blend support is available in Visual 2008. Its a XAML generator tool for
silverlight application.We can install expression blend as an embedded plug-in in Visual
Studio 2008.

(2)WPF (Windows Presentation Foundation) provides more graphic functionality in


Visual studio we can create 2D and 3D graphic application in it.

(3)In Visual Studio 2008 we can build game there is a library kits

for games developers. currently this game development kits are available for C++ and
also 2D/3D Dark Matter one image and sounds sets. (4)One of most useful feature of
.net3.5 is we can able to create,run,debug .NET 2.0, .NET 3.0, .NET 3.5 application. We
can also deploy .NET 2.0 application in machine where .NET 2.0 is not installed.

(5)In previous version we have to make a seprate setup of AJAx Control library but in
Visual 2008 there is a built-in AJAX Contrl library.

(6)One of most good feature is that now we can debug Javascript we can set a break point
in javascript.

(7)In VS 2008 you can even edit the nested master pages.

(8)Visual Studio 2008 contains intellisense support for javascript.

(9)VS 205 has a feature show both design and source code in single window. but both the
windows tiles horizontally.
(10)In VS 2008 we can create, debug and deploy the silverlight applications.

(11)In VS 2008 there is Inbuilt C++ SDK.

What is a WebBrowser Control and its advantage


a WebBrowser control is used in a Windows Forms application to browse web pages and
other browser-enabled documents. WebBrowser provides many events to track data
processes, and many properties and methods to access and create new contents on the
HTML element level.

Handles cookies automatically without related coding.

Accesses HTML elements and script variables programmatically

We can change html content while scripts running .

ASP.NET 2008 Features


(1)By the LINQ Support we can Compile time checking C# language queries, and the
ability to debug step by step through queries

(2)In Visual Studio 2008 we can get extensive web designer and JavaScript tool.

(3)VS 2008 provides game development library kits for games developers

(4)We can easily develop the 2D and 3D graphic applications

(5)No need to install AJAX control library separately there is a built-in AJAX control
library in this library we can use Menu, TreeView, webparts .

(6)Visual Studio 2008 makes it is simpler with javascript debugging and also use break
point in javascript

(7)Nested Master page on eof good feature included in VS2008

(8)Visual Studio 2008 contains intellisense support for javascript

(9)When we use HTML or ASP markup text in source window automatically


corresponding item will be selected in design window

(10)Silverlight in VS 2008 is inbuilt

(11)C++ SDK Libraries and tools which helps in developing windows based applications
are now inbuilt with VS 2008 and easily configurable
(12)Visual Studio is now in English, Spanish, French, German, Italian, Chinese
Simplified, Chinese Traditional, Japanese, and Korean. Over the next couple of months.
Microsoft is reengineering the MUI which supports nine local languages then you can
even view Visual studio in other 9

(13)Popfly explorer is an add-on to VS 2008.

In what conditions SessionId is changed and not


changed
If our application has never stored anything in the session state. In this case, a new
session state is created in every request, but cannot saved because it contains nothing.

On the other hand session remain same in two condiitons

(1)- If user used same browser instance to request another page that uses the session state,
you will get the same session ID every time

(2)If Session_OnStart event is used .NET will save the session state even when it is
empty.

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. Its 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.

How .net differs from other programming languages


Other programming languages get compiled and run in their own specific run time
environments and are not inter-operable.Where Dot Net supports programming languages
run in a common runtime environment called CLR and get compiled into MSIL code
which is interoperable with other programming languages supported by CLR.JIT is then
used to convert MSIL to native code based on the operating system.CLR supports many
utilities like Garbage Collection MemoryManagem ent and so on that make it a more
efficient run time environment.

Diffrence between MasterPage and WebUserControl


A master page is a template for other pages, with shared layout and functionality. The
master page defines placeholders for content pages. On the other hand the content pages
contains the content you want to display.

Please write something about Windows DNA


architecture
The Windows Distributed interNet Applications Architecture is a Microsoft blueprint for
robust, scalable, distributed business software. Windows DNA has evolved over time and
was not preplanned. It gives all combined advantages of Centralized mainframe,
application servers, internet technologies and Personal computers. Windows DNA is an
evolution which started from mainframes in which all logic was centralized.

What is three tier architecture


There are three layers when we talk about three tier architecture:-

User Interface (Client) :- This is mostly the windows user interface or the Web interface
but this has only the UI part.

Mid layer: - Middle tier provides process management where business logic and rules are
executed and can accommodate hundreds of users (as compared to only 100 users with
the two tier architecture) by providing functions such as queuing, application execu tion,
and database staging.

Data Access Layer: - This is also called by the famous acronym "DAL" component. It
has mainly the SQL statement which do the database operation part of the job.

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.

Why we use AddressOf operator in background


When we are asking about BackgroundProcess method we use AddressOf operator which
creates a delegate object to the BackgroundProcess method. A delegate within VB.NET
is a type-safe, object-oriented function pointer. After the thread has been instantiated, you
begin the execution of the code by calling the Start() method of the thread.

Why finalize not to be used for clean up


Only the problem with finalize is that garbage collector have to do two rounds to remove
object from the memory in first round it put the object into finalize and after this in
second round trip it have to clear that object from the finalize method .On the other side
the object that have not call in finalize should be clear from memory only in one round
trip.

Why we do methods to be static for Post Cache


substitution
ASP.NET able to call this method even when there no instance of page class available.
Whenever page is served from the cache, the page object is not created. ASP.NET skips
the page life cycle when the page is coming from cache, which means it would not create
any control objects or raise any control events. If your dynamic content depends on the
values of other controls, you all need to use a different technique, because these control
objects won't b e available to your callback.

What do you mean SQL Cache Dependency in


ASP.NET
SQL Cache Dependencies is a new feature that comes in ASP.NET 2.0 which can
automatically invalidate a cached data object example:- Dataset when the related data is
modified in the database. So for instance if you have a dataset which is tied up to a
database tables any changes in the database table will invalidate the cached data object
which can be a dataset or a data source.

What are Daemon threads


This is a automatic thread which is stop when nothing is happening means when CPU is
idle thread is also idle when CPU is doing something it will start doing for example
Garbage Collector is best example for this.

syntax to make a thread Daemon

Thread.IsBackground=true.

MultiTasking and MultiThreading


Multi tasking realtes to more then one program at a same time and can switch between
that program for example:- doing work on doc file and a song is running on winamp. On
the other hand multi threading is a subset of multi tasking here we can switch between
different part of same program example:- doing work and .doc file and PCase is checking
in background.In threading we can also set the prority of thread. some of these are as
follows

ThreadPriority.

Highest ThreadPriority.AboveNormal

ThreadPriority.Normal

ThreadPriority.BelowNormal

ThreadPriority.Lowest.

How to delete zip files from a folder


DirectoryInfo dir = new DirectoryInfo(@"z:\foldernam");

FileInfo[] zipfiles = dir.GetFiles("*.zip");

foreach( FileInfo f in zipfiles)

f.Delete();

How to turn off cookie in asp.net page


Use the Cookie.Discard Property which Gets or sets the discard flag set by the server.
When true, thisproperty instructs the client application not to save the Cookie on the
user?s hard disk when a session ends.

How to get distinct element in array


let suppose my array contains {3,8,8,8,15,15}

int[] arr = { 3, 8, 8, 15, 15 };

System.Collections.IEnumerable a = arr.Distinct();
SQL Server and ASP.NET performance tips
ALways use same connection string to get advantage of Connection pooling.Becuase
connection polling is not used for new connection.

Always close user-defined transactions before closing a connection.

Close your connection as soon as you are done using it.

Do leave a connection open if it is not used.

Always drop temporary objects before closing a connection.

Open connection when on need not before the need.

What is the fastest way to concat strings in ASP.NET


By Using Append method of the StringBuilder object we can concat string in ASP.NET

Difference between System exception and Application


exceptions
In asp.net all the exceptions comes from Exception Base class. We can also generate
custom exception.Application Exception are the syatem base which serves as the base
class for all applications realted exception.

It derives from Exception but we cannot extend its functionality.we should derive our
custom application exceptions from Application Exception.Application exception is used
when we want to define user defined exception, while syste

m exception is all which is defined by .NET.

Explain Gernic Class and its advantage


From the gernic class single class can be used by number of client which reduce the cost
and risk.There are number of features included in Gernic class it is reusable,type
safety,and performance.We can also create our own interface,class and delegates.We can
get the gernic datatype at runtime by the use of reflection.Gernicn class comes in
System.Collections.gernicn namepace.The main advantage of genercs is to create
collection classes.

What do you mean by Share Point Portal


Here I have taken information regarding Share Point Portal Server 2003 provides mainly
access to the crucial business information and applications.With the help of Share Point
Server we can server information between Public Folders, Data Bases, File Servers and
the websites that are based on Windows server 2003. This Share Point Portal is integrated
with MSAccess and Windows servers,So we can get a Wide range of document
management functionality. We can also create a full featured portal with readymade
navigation and structure.

What is cross page posting in ASP.NET2.0


When we have to post data from one page to another in application we used
server.transfer method but in this the URL remains the same but in cross page posting
there is little different there is normal post back is done but in target page we can access
values of server control in the source page.This is quite simple we have to only set the
PostBackUrl property of Button,LinkButton or imagebutton which specifies the target
page.In target page we can access the PreviousPage property.And we have to use the
@PreviousPageType directive.We can access control of PreviousPage by using the
findcontrol method.When we set the PostBackURL property ASP.NET framework bind
the HTML and Javascript function automatically.

How to call method that handles the Click event for


several buttons
Protected Sub AnyClicked(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click

Dim b As Button = CType(sender, Button)

Response.Write("You clicked the button labeled " & b.ID)

End Sub

What do you mean by CodeDom


In a simple language CodeDom is an object model which display or represent source
code.CodeDom is specially designed for language independent. And the method is quite
simple when we create CodeDom for a program we can generate the source code in
any .NET language.

What is the difference between Shadowing and


overriding
Overriding redefines only the implementation while shadowing redefines the whole
element.On the other side In overriding derived classes can refer the parent class element
by using �ME� keyword, but in shadowing you can access it by MYBASE.

What is diffrence between Debug and Trace class


Debug Class helps to set methods and properties that helps in debugging code. If we use
methods in Debug class for print debugging information and checking our logic with
cases, we can make our code more robust without impacting the performance and code
size. On the other side we use the properties and methods in the Trace class to release
builds and instrumentation allows us to monitor the condition of our application running
in real-life settings. Tracin g helps us to know problems and fix them without interact a
running system. Trace is enabled by default in visual 2005. So code is generated for all
trace methods in both release and debug builds.

What do you mean by Web Part Control in asp.net


ASP.NET Web Parts controls are the integrated controls which helps in creation of Web
sites that also help users to modify the content as well as appearance, and behavior of
pages of web sites that are open in browser.

Com Marshler function in .NET


Com Marshler is useful component of CLR.Main work of marshal data between
Managed and Unmanaged environment .It helps in representation of data accross
diffrenet execution enviroment.Its also convert data format between manage and
unmanaged code.By the helps of Com Marshlar CLR allows manage code to interoperate
with unmanaged code.

What is main difference between GridLayout and


FormLayout
GridLayout helps in providing absolute positioning of every control placed on the page.It
is easier to devlop page with absolute positioning because control can be placed any
where according to our requirement.But FormLayout is little different only experience
Web Devloper used this one reason is it is helpful for wider range browser.If there is
absolute positioning we can notice that there are number of DIV tags.But in FormLayout
whole work are done throu gh the tables.

What is the purpose of IIS


We can call IIS(Internet Information Services) a powerful Web server that helps us
creating highly reliable, scalable and manageable infrastructure for Web application
which runs on Windows Server 2003. IIS helps development center and increase Web
site and application availability while lowering system administration costs. It also runs
on Windows NT/2000 platforms and also for above versions. With IIS, Microsoft
includes a set of programs for building an d administering Web sites, a search engine, and
support for writing Web-based applications that access database. IIS also called http
server since it process the http request and gets http response.

How to start Outlook and NotePad file in AsP.NET with


code
Here is the syntax to open outlook or notepad file in ASP.NET VB.NET
Process.Start("Notepad.exe") Process.Start("msimn.exe"); C#.NET

System.Diagnostics.Process.Start("msimn.exe");

System.Diagnostics.Process.Start("Notepad.exe")

What you thing about the WebPortal


Web portal is nothing but a page that allows a user to customize his/her homepage. We
can use Widgets to create that portal we have only to drag and drop widgets on the page.
The user can set his Widgets on any where on the page where he has to get them.
Widgets are nothing but a page area that helps particular function to response. Widgets
example are address books, contact lists, RSS feeds, clocks, calendars, play lists, stock
tickers, weather reports, t raffic reports, dictionaries, games and another such beautiful
things that we can not imagine. We can also say Web Parts in Share Point Portal. These
are one of Ajax-Powered.

What is different between WebUserControl and in


WebCustomControl
Web user controls :- Web User Control is Easier to create and another thing is that its
support is limited for users who use a visual design tool one gud thing is that its contains
static layout one more thing a seprate copy is required for each application.

Web custom controls:-Web Custom Control is typical to create and gud for dynamic
layout and another thing is it have full tool support for user and a single copy of control is
required because it is placed in Global Assembly cache.

How many types of cookies are there in .NET


Two type of cookeies.
a) single valued eg request.cookies(�UserName�).value=�dotnetquestion�

b)Multivalued cookies. These are used in the way collections are used example

request.cookies(�CookiName�)(�UserName�)=�dotnetquestionMahesh�

request.cookies(�CookiName�)(�UserID�)=�interview″.

what is Viewstate
View state is used by the ASP.NET page framework to automatically save the values of
the page and of each control just prior to rendering to the page. When the page is posted,
one of the first tasks performed by page processing is to restore view state. State
management is the process by which you maintain state and page information over
multiple requests for the same or different pages.

Client-side options are:

* The ViewState property

* Query strings

* Hidden fields

* Cookies

Server-side options are:

* Application state

* Session state

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 form�s
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 a page�s 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 be available
to all users of the application.

Explain .NET PAGE LIFECYCLE


While excuting the page, it will go under the fallowing steps(or fires the events) which
collectivly known as Page Life cycle.

Page_Init -- Page Initialization

LoadViewState -- View State Loading

LoadPostData -- Postback data processing

Page_Load -- Page Loading

RaisePostDataChangedEvent -- PostBack Change Notification

RaisePostBackEvent -- PostBack Event Handling

Page_PreRender -- Page Pre Rendering Phase

SaveViewState -- View State Saving

Page_Render -- Page Rendering

Page_UnLoad -- Page Unloading.

What Language is familiar to CLR


Any language which can be compiled into Microsoft Intermediate Language (MSIL) is
considered a .NET compliant language. Following are some of the popular .NET-
compliant languages supported by CLR: APL, COBOL, Component, Pascal, Eiffel,
Fortran, Haskell, JScript, Mercury, beron, Pascal, Perl, Python, Smalltalk, Visual Basic,
Visual C#, Visual C++.
How many types of JIT compiler in Microsoft Dot NET
There are mainly three types of JIT Compilers. Pre-JIT:-Pre-JIT complies complete
source code into native code in a single compilation cycle.Its hapeen at the time of
deployment. Econo-JIT:-Econo-JIT compiles only those methods which is called at
runtime and these methods are removed when these are not required. Normal-JIT:-
Compiles method that are called on runtime.These methods are called first time they are
compiled and then stored in cache.

What is Asp Net Web Services


Web services are programmable business logic components that provide access to
functionality through the Internet. Standard protocols like HTTP can be used to access
them. Web services are based on the Simple Object Access Protocol (SOAP), which is an
application of XML. Web services are given the .asmx extension.

Das könnte Ihnen auch gefallen