Escolar Documentos
Profissional Documentos
Cultura Documentos
---
Answer # Misconception: It’s Closed. Microsoft makes the source code for the .NET Framework
available for free. Microsoft is a company that sells software, and they are naturally very protective
of their products’ source code. So, one might think that ASP.NET (and .NET in general) is closed
source, but that is not the case.
Answer # It was first released in January 2002 with version 1.0 of the .NET Framework, and is the
successor to Microsoft’s. Active Server Pages (ASP) technology. ASP.NET is built on the Common
Language Runtime (CLR), allowing programmers to writeASP.NET code using any supported .NET
language.
Answer # ASP.NET is an open-source server-side web application framework designed for web
development to produce dynamic web pages. It was developed by Microsoft to allow programmers to
build dynamic web sites, web applications and web services.
Answer # ASP is also an abbreviation for Active Server Page. An application service provider (ASP)
is a company that offers individuals or enterprises access over the Internet to applications and related
services that would otherwise have to be located in their own personal or enterprise computers.
Answer # C# is a language, .NET is an application framework. The .NET libraries can run on the
CLR and thus any language which can run on the CLR can also use the .NET libraries. This common
.net format is what allows libraries to be shared between .net languages (C#, VB.Net, F# and others)
easily.
Answer # ASP.NET is a framework generally written in one of two languages – VB script or C#.
ASP .NET is a server-side scripting language. Your .aspx pages are just scripts that tell IIS how to
render a page.
Asp.NET Interview Questions For
Freshers
Question # 11 Can you use C# without .net?
Answer # Some key advantages of ASP.NET framework for Web development are as follows:
* Built-in Windows authentication and per-application configuration keep your applications secured.
* ASP.NET reduces the line of code needed to develop large applications.
* The ASP code and HTML smoothly mix with each other to generate dynamic web pages.
* It is an ideal server-side scripting technology that is why code runs on the windows server before
displaying on the web browser.
* Dot NET framework is language independent, so choose any programming language that best
suited to develop your application.
* ASP.NET is easy to deploy because of built-in configuration information.
* The Windows Web server precisely monitors the web pages, various components and application
running over it.
* It immediately gives an alert for any memory leaks, unbounded loops and other illegal behaviors. It
instantly kills those behaviors and restarts automatically.
* ASP.Net features such as early binding, JIT compilation, caching services and native optimization
supports to get high level of performance.
* All the applications are minutely monitored and managed to help application continuously
available to handle requests.
* WYSIWYG is an editor tool available in Visual studio.ASP.NET, with its advantages, is the next-
generation platform of Microsoft’s ASP. It is a widely used development framework for developing
an enterprise level web application. Either for building a small website or a large corporate web
application, ASP.NET is the best development application that today’s developers love to use.
Answer # ASP.NET Web Forms is another framework specifically for building web applications, and
the new ASP.NET Web API is a platform for building web services.
Question # 15 ASP.NET MVC2 web application is based on MVC pattern in order to facilitate unit
test, without mocking pipeline asp.net, because it’s very difficult. you don’t have code on Code
Behind in order to separate your code graphic and your code functional. With MVC your application
becomes independent of view. you can replace easily technology of creating view.
Question # 16 What is the difference between Visual Basic and ASP Net?
Answer # VB.NET is a language that is used in writing programs that are utilizing the ASP.NET
framework. ASP.NET is a server side technology that is language independent. Any .NET languages
such as C#, VB.NET can be used to develop web applications through ASP.NET. VB.NET is a .NET
programming language.
Answer # The Common Language Runtime (CLR), the virtual machine component of Microsoft’s
.NET framework, manages the execution of .NET programs. A process known as just-in-time
compilation converts compiled code into machine instructions which the computer’s CPU then
executes.
Answer # CSS is the language for describing the presentation of Web pages, including colors, layout,
and fonts. It allows one to adapt the presentation to different types of devices, such as large screens,
small screens, or printers. CSS is independent of HTML and can be used with any XML-based
markup language.
Answer # ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a
broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal
platform for building RESTful applications on the .NET Framework.
Answer # MTA stands for Multi Threaded Apartment. In MTA, only one apartment will be there and
all threads will execute within that single apartment.
Answer # ASP used STA threading model and ASP.NET uses MTA threading model.
Answer # A web farm is a group of two or more servers used to host the same site. Web farms
increase the capacity of a web site, and improve availability by providing fail-over. Web farms are
universally used for high-traffic and mission critical web sites.
Answer # Application pool is used to separate sets of IIS worker processes and enables a better
security, reliability, and availability for any web application. Now, by default, each and every
Application pool contains a single worker process. Application which contains the multiple worker
process is called “Web Garden”.
Answer # 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.
Answer # Application Pool. Worker Process: Worker Process (w3wp.exe) runs the ASP.Net
application in IIS. This process is responsible for managing all the request and response that are
coming from the client system. All the ASP.Net functionality runs under the scope of the worker
process.
Question # 30 What is a server farm in IIS?
Answer # The first step in installing and configuring an IIS 8 web farm is to install IIS on the web
servers and load balancing server. Then install Application Request Routing (ARR) on the load
balancing server. Finally, set up your website on one of the web servers.
Answer # IIS (Internet Information Server) is one of the most powerful web servers from Microsoft
that is used to host your Web application. IIS has it’s own Process Engine to handle the request. So,
when a request comes from client to server, IIS takes that request and process it and send response
back to clients.
Answer # The Debug and Trace classes have very similar methods. The primary difference is that
calls to the Debug class are typically only included in Debug build and Trace are included in all
builds (Debug and Release). You can control this through the compiler flags DEBUG and TRACE.
Answer #
Question # 35 How many types of session state management options available in ASP.NET?
Answer # In ASP.Net, there are two session state managemtn options are available, they are:
In-Process
Out-of-Process.
1) Page_PreInit
2) Page_Init
3) Page_InitComplete
4) Page_PreLoad
5) Page_Load
6) Page_LoadComplete
7) Page_PreRender
8) Render
Answer # The difference between Union and Union all is that Union all will not eliminate duplicate
rows, instead it just pulls all rows from all tables fitting your query specifics and combines them into
a table. A UNION statement effectively does a SELECT DISTINCT on the results set.
Answer # Just like JOINS, UNION combines data into a single record-set but vertically by adding
rows from another table. JOINS combine data horizontally by adding columns from another table.
UNION insures you get DISTINCT records from both the tables.
Answer # By using JOINs, you can retrieve data from two or more tables based on logical
relationships between the tables. Joins indicate how SQL should use data from one table to select the
rows in another table. The UNION operation is different from using JOINs that combine columns
from two tables.
Answer # The difference between structure and union is, The amount of memory required to store a
structure variable is the sum of the size of all the members. On the other hand, in case of unions, the
amount of memory required is always equal to that required by its largest member.
Answer # UNION ALL command is equal to UNION command, except that UNION ALL selects all
the values. The difference between Union and Union all is that Union all will not eliminate duplicate
rows, instead it just pulls all the rows from all the tables fitting your query specifics and combines
them into a table.
Answer # SQL Joins clause is used to combine records from two or more tables in a database. A
JOIN is a means for combining fields from two tables by using values common to each.
Inner join
Outer join
Left outer join
Right outer join
Full outer join
Question # 44 What is a session in asp net?
Answer # ASP.NET session state enables you to store and retrieve values for a user as the user
navigates ASP.NET pages in a Web application. HTTP is a stateless protocol. This means that a Web
server treats each HTTP request for a page as an independent request.
Answer # Application and Session Variables. The Application and Session objects can be used to
store values that are global either to a particular user (the Session ) or to all users (the Application )
Answer # Following are the different types of session modes available in ASP.NET:
Off.
InProc.
StateServer.
SQLServer.
Custom.
Question # 47 What is the difference between session and viewstate in asp net?
Answer # SessionState persist the data of particular user in the server. This data available till user
close the browser or session time completes. View State are valid mainly during postbacks and
information is stored in client only. Viewstate are valid for serializable data only.
Answer # When a web app is requested by the user for the first time, the server creates a sessionID
and stores it in the cookie of the client browser. This sessionID is sent to the server in all the
subsequent requests.
Answer # ASP.NET MVC provides HtmlHelper class which contains different methods that help you
create HTML controls programmatically.
Answer # Clear – Removes all keys and values from the session-state collection. Abandon –
removes all the objects stored in a Session. If you do not call the Abandon method explicitly, the
server removes these objects and destroys the session when the session times out.
Advanced ASP.NET Interview Questions
And Answers
Question # 51 What is the difference between Stored Procedure vs Function?
Answer # Function must return a value but in Stored Procedure it is optional( Procedure can return
zero or n values). Functions can have only input parameters for it whereas Procedures can have
input/output parameters . Functions can be called from Procedure whereas Procedures cannot be
called from Function.
Question # 52 What are the various ways to send content from one page to another?
Answer # There are different ways are there to send content from one page another page.
Response. Redirect()
Server.Transfer()
WebClient.DownloadFile()
Question # 53 What is the difference between sealed vs static class?
Answer # When a class defined as sealed its not possible to inherit. A static class can have only static
member (e.g static method, property, and variables). A static class restrict the user to call default
constructor of the class. Static classes can only have static constructor to initialize static members.
Answer # Interviewers ask these type of questions to know if you are a genuine candidate or not.
Explain these type of questions with confidence.
Question # 59 What is the difference between abstract class vs interface? Can give me the real time
examples?
Answer # A class that implements an interface must provide an implementation of all the methods of
that interface. abstract classes may contain state (data members) and/or implementation (methods)
abstract classes can be inherited without implementing the abstract methods (though such a derived
class is abstract itself)
Answer #
Answer # In IIS7, ASP.NET is integrated into the request pipeline, and the composite effect is that
there is only one authentication mechanism to maintain. Passport authentication uses Microsoft’s
Windows Live ID Authentication (formally .NET Passport), which you have to be licensed to use.
Answer # When you log on to a PC with a user name and password you are authenticating.
Authorization is the process of verifying that you have access to something. Gaining access to a
resource (e.g. directory on a hard disk) because the permissions configured on it allow you access is
authorization.
Answer # Active Directory authentication offers users a faster, more secure, and more scalable
authentication mechanism than LDAP authentication. By using the Kerberos authentication protocol,
SGD can securely authenticate any user against any domain in a forest. Active Directory
authentication is disabled by default.
Answer # Anonymous authentication allows any user to access any public content without providing
a user name and password challenge to the client browser. By default, Anonymous authentication is
enabled in IIS 7.
Answer # LDAP (Lightweight Directory Access Protocol) is an application protocol for querying and
modifying items in directory service providers like Active Directory, which supports a form of
LDAP. Short answer: AD is a directory services database, and LDAP is one of the protocols you can
use to talk to it.
Question # 69 Why we use DBMS for projects ? Why don’t we save any application data in separate
files instead of DBMS?
Answer # Normalization of the data is the main advantage of using DBMS instead of saving data in
seperate files.
Question # 70 What is the differences between a Primary key and a Unique key in SQL server?
Answer # Primary Key is used to identify a row (record) in a table, whereas Unique-key is to prevent
duplicate values in a column (with the exception of a null entry). By default SQL-engine creates
Clustered Index on primary-key if not exists and Non-Clustered Index on Unique-key.
Answer # A primary key is a column or a set of columns that uniquely identify a row in a table. A
primary key should be short, stable and simple.
A foreign key is a field (or collection of fields) in a table whose value is required to match the value
of the primary key for a second table. A table can have multiple foreign keys.
Question # 72 What is the difference between a candidate key and primary key?
Answer # Candidate Key – A Candidate Key can be any column or a combination of columns that
can qualify as unique key in database. There can be multiple Candidate Keys in one table. Each
Candidate Key can qualify as Primary Key.
Primary Key – A Primary Key is a column or a combination of columns that uniquely identify a
record.
Answer # One row in the database is allowed to have null for the value of the unique key constraint.
Answer # Generally we can create only one clustered index in a table, but if required there is a way
to create more clustered index in a table.
Answer # A clustered index actually describes the order in which records are physically stored on
the disk, hence the reason you can only have one. A Non-Clustered Index defines a logical order
that does not match the physical order on disk.
Answer # A distributed system is a network that consists of autonomous computers that are
connected using a distribution middleware. They help in sharing different resources and capabilities
to provide users with a single and integrated coherent network.
Question # 78 What is Web API and why to use it?
Answer # Asp.Net Web API is a framework for building HTTP services that can be consumed by a
broad range of clients including browsers, mobiles, iphone and tablets. … It is a part of the core
ASP.NET platform and can be used with MVC and other types of Web applications like Asp.Net
WebForms.
Answer # Web Services are based on the SOAP protocol. Web API is a newer Microsoft framework
which helps you to build REST based interfaces. The response can be either JSON or XML, but there
is no way to generate clients automatically because Web Api does not offer a service description like
the WSDL from Web Services.
Answer # While WCF is a unified framework for building service oriented applications, Web API is
a light weight alternative to build RESTful services that can be consumed by many different clients.
RESTful services use basic HTTP and are simple with much less payload compared to SOAP
services.
Answer # Web services are of two kinds: Simple Object Access Protocol (SOAP) and
Representational State Transfer (REST). SOAP defines a standard communication protocol (set of
rules) specification for XML-based message exchange. SOAP uses different transport protocols, such
as HTTP and SMTP.
Answer # Threads are used for small tasks, whereas processesare used for more ‘heavyweight’ tasks
– basically the execution of applications. Another difference betweena thread and a process is
that threads within the same process share the same address space, whereas different processes do
not.
1.EXE is an extension used for executable files while DLL is the extension for a dynamic link
library.
2.An EXE file can be run independently while a DLL is used by other applications.
3.An EXE file defines an entry point while a DLL does not.
Answer # EXE file is a executable file which runs in a separate process which is managed by OS.
DLLs are not directly executable . They are separate files containing functions that can be called by
programs and other DLLs to perform computations and functions. DLL: They can be reused for some
other application.
Answer # The Global Assembly Cache (GAC) is a folder in Windows directory to store the .NET
assemblies that are specifically designated to be shared by all applications executed on a system.
Answer #
Strong typing: It checks the type of variables as soon as possible, usually at compile time. It
prevents mixing operations between mismatched types.
Weak Typing: While weak typing is delaying checking the types of the system as late as possible,
usually to run-time. In this you can mix types without an explicit conversion.
A “weak-typed” programming language is simply one which is not strong-typed.
which is preferred depeneds on what you want. for scripts and good stuff you will usually want
weak typing, because you want to write as much less code as possible. in big programs, strong typing
can reduce errors at compile time.
Answer # The only difference between Equal and == is on object type comparison. in other cases,
such as reference types and value types, they are almost the same(either both are bit-wise equality or
both are reference equality). The == operator can be used to compare two variables of any kind, and
it simply compares the bits.
Answer # Boxing is the process of converting a value type to the type object or to any interface type
implemented by this value type. When the CLR boxes a value type, it wraps the value inside a
System.Object and stores it on the managed heap. Unboxing extracts the value type from the object.
Answer # With reflection we can dynamically create an instance of a type, bind the type to an
existing object, or get the type from an existing object and invoke its methods or access its fields and
properties. We can also access attribute information using reflection.
Answer # Full trust is the default, allows ASP.NET applications to execute native code, to read from
the Registry and Windows Event Log, and to read and write to files outside of the application’s
virtual directory. In short, with full trust one web application could delete the entire contents of
another web application.
Answer # The biggest difference between these is that: In a debug build the complete
symbolic debug information is emitted to help while debugging applications and also the code
optimization is not taken into account. While in release build the symbolic debug info is not emitted
and the code execution is optimized.
ASP.NET Interview Questions And
Answers For 5+ Years Experience
Question # 94 What is the purpose of XML Namespaces?
Answers # XML namespace. XML namespaces are used for providing uniquely named elements
and attributes in an XML document. They are defined in a W3C recommendation. An XML instance
may contain element or attribute names from more than one XML vocabulary.
Answers # typeOf is a C# keyword that is used when you have the name of the class. It is calculated
at compile time and thus cannot be used on an instance, which is created at runtime. GetType is a
method of the object class that can be used on an instance.
Question # 96 Why would anyone need to implement their own hashtable or linked list?
Answers # I’m not implying that the Dictionary class is inferior or that people should roll their own
hashtable. This is a basic question which tests whether a person has a minimal understanding of
datastructures. Thats what these questions test for: bare minimum understanding.
Question # 97 what is XSS?
Answer # Cross-site Scripting (XSS) refers to client-side code injection attack wherein an attacker
can execute malicious scripts (also commonly referred to as a malicious payload) into a legitimate
website or web application.
Question # 98 What is X XSS protection?