Sunteți pe pagina 1din 10

My current architecture is a simple 3 tier

architecture with UI in ASP.NET , middle layer are simple .NET classes and DAL
is using enterprise application blocks.

The UI is responsible to take user inputs , all my


business validations are centrally located in middle layer and the data access
layer is responsible to execute stored procedured and SQL queries to SQL Server.

Strongly typed business objects are used to pass data from one layer to
other layer. The database of the project is in a 3rd normal form."

So first start with the overall architecture , talk about each layer , how data
is passed between each layer and the database design structure.

One very important tip if you can draw a diagram and explain....I think you have
the job.

"ASP.NET is a web application development framework for building web sites and
web applications that follows object oriented programming approach".Following are
the top 10 commonly asked Interview Questions with Answers on ASP.NET:What is
the concept of Postback in ASP.NET?A postback is a request se

"ASP.NET is a web application development framework for building web sites and
web applications that follows object oriented programming approach".
Following are the top 10 commonly asked Interview Questions with Answers on
ASP.NET:
What is the concept of Postback in ASP.NET?
A postback is a request sent from a client to server from the same page user is
already working with.
ASP.NET was introduced with a mechanism to post an HTTP POST request back to the
same page. It's basically posting a complete page back to server (i.e. sending all of
its data) on same page. So, the whole page is refreshed.
Another concept related to this approach is "Callback" that is also asked sometimes
during a technical interview question. Click here to understand Postback Vs Callback
in ASP.NET.
Difference between ASP.NET WebForms and ASP.NET MVC?
ASP.NET Web Forms uses Page controller pattern approach for rendering layout. In
this approach, every page has it's own controller i.e. code-behind file that processes
the request. On the other hand, ASP.NET MVC uses Front Controller approach. In this
approach a common controller for all pages, processes the requests.
Please follow for detailed information on WebForms Vs MVC.
Please briefly explain ASP.NET Page life Cycle?
ASP.NET page passes through a series of steps during its life cycle. Following is the
high-level explanation of life cycle stages/steps.
Initialization: Controls raise their Init event in this stage.Objects and variables are
initializes for complete lifecyle of request.
LoadViewState: is a post back stage and loads the view state for the controls that
enabled its view state property.
LoadPostBackData: is also a post back stage and loads the data posted for the
controls and update them.
Load: In this stage page as well as all the controls raise their Load event. Till this
stage all the controls are initialized and loaded. In most of the cases, we are coding
this event handler.
RaisePostBackEvent: is again a postback stage. For example, it's raise against a
button click event. We can easily put our code here to perform certain actions.
SaveViewState: Finally, controls state is saved in this stage before Rendering
HTML.
Render: This is the stage where HTML is generated for the page.

Dispose: Lastly, all objects associated with the request are cleaned up.
For very detailed explanation of Page Life Cycle is explained here.
What is the difference between custom controls and user controls?
Custom controls are basically compiled code i.e. DLLs. These can be easily added to
toolbox, so it can be easily used across multiple projects using drag and drop
approach. These controls are comparatively hard to create.
But User Controls (.ascx) are just like pages (.aspx). These are comparatively easy to
create but tightly couple with respect to User Interface and code. In order to use
across multiple projects, we need to copy and paste to the other project as well.

What is the concept of view state in ASP.NET?


As in earlier question, we understood the concept of postback. So, in order to
maintain the state between postbacks, ASP.NET provides a mechanism called view
state. Hidden form fields are used to store the state of objects on client side and
returned back to server in subsequent request (as postback occurs).

Difference between Response.Redirect and Server.Transfer?


In case of Response.Redirect, a new request is generated from client-side for
redirected page. It's a kind of additional round trip. As new request is generated from
client, so the new URL is visible to user in browser after redirection.
While in case of Server.Transfer, a request is transferred from one page to another
without making a round trip from client. For the end user, URL remains the same in
browser even after transferring to another page.

Please briefly explain the usage of Global.asax?


Global.asax is basically ASP.NET Application file. Its a place to write code for
Application-level events such as Application start, Application end, Session start and
end, Application error etc. raised by ASP.NET or by HTTP Modules.
There is a good list of events that are fired but following are few of the important
events in Global.asax:

Application_Init occurs in case of application initialization for the very first


time.

Application_Start fires on application start.


Session_Start fires when a new user session starts
Application_Error occurs in case of an unhandled exception generated from
application.
Session_End fires when user session ends.
Application_End fires when application ends or time out.

What are the different types of Validation controls in


ASP.NET?

In order to validate user input, ASP.NET provides validation server controls. All
validation controls inherits from BaseValidator class which contains the common
validation properties and methods
like ControlToValidate,Enabled, IsValid, EnableClientScript, ValidationGroup,Validat
e() etc.
ASP.NET provides a range of validation controls:

RequiredFieldValidator validates compulsory/required input.


RangeValidator validates the range. Validates that input falls between the
given range values.
CompareValidator validates or compares the input of a control with another
control value or with a fixed value.
RegularExpressionValidator validates input value against a defined regular
expression pattern.
CustomValidator allows to customize the validation logic with respect to our
application logic.
ValidationSummary displays all errors on page collectively.

What are the types of Authentication in ASP.NET?


There are three types of authentication available in ASP.NET:

Windows Authentication: This authentication method uses built-in windows


security features to authenticate user.
Forms Authentication: authenticate against a customized list of users or users
in a database.
Passport Authentication: validates against Microsoft Passport service which is
basically a centralized authentication service.

What are Session state modes in ASP.NET?


ASP.NET supports different session state storage options:

In-Process is the default approach. It stores session state locally on same


web server memory where the application is running.
StateServer mode stores session state in a process other than the one
where application is running. Naturally, it has added advantages that session state is
accessible from multiple web servers in a Web Farm and also session state will
remain preserved even web application is restarted.
SQLServer mode stores session state in SQL Server database. It has the
same advantages as that of StateServer.
Custom modes allows to define our custom storage provider.
Off mode disables session storage.
Hopefully, this list of Interview Questions for ASP.NET will be helpful for beginners as
well as Professional developers. Please follow here for a Comprehensive list of
ASP.NET Interview Questions.
Planning for the exact questions you will be asked during a .NET Developer interview is
impossible. The experience will depend on the interviewers style of questioning and what he or

she feels is the most important information to learn about you. Questions will also depend on if
you are an entry-level, mid-level, senior developer, etc. Some will stick to technical queries; trying
to glean a sense of your knowledge level. Others will want to know about your personality, how
you will contribute to their team, and how you handle problems when they arise. Most likely you
can expect a little bit of everything!
The following are some interview questions you may want to consider before walking into an
interview. Most you probably know the answers to, but it is always wise to brush up before an
interview so you can feel confident. If you do find yourself faced with a question youre not sure
of, dont be afraid to admit it. Let them know that it is something you would have to look up. The
interviewer will appreciate knowing that you are honest about your abilities and know when you
need to turn to your resources. Making up a completely wrong answer could lead them to think
you are misinformed about other details as well.
Getting-to-know-you questions:
1.

What .NET frameworks do you have experience working with? (They are really asking how

up to date you are!)


2.

Tell me about a time you encountered a problem with a project and how you overcame it.

3.

What role did you play in your last project?

4.

Describe your strengths and weaknesses as a .NET developer.

5.

What is one positive thing your current/past employer would say about you?

Questions for all developers who write code:


1.

What is the difference between a thread and a process?

2.

Describe the difference between strong-typing and weak-typing? Which is preferred and

why?
3.

What is GAC?

4.

How does Windows Services lifecycle differ from EXE?

5.

How is PID useful when troubleshooting a system?

Mid-level .NET developer questions:


1.

What is reflection?

2.

How is an interface different from a class?

3.

Can DateTimes be null?

4.

What is the difference between out-of-proc and in-proc?

5.

Describe interface-orientated, object-orientated, and aspect-orientated programming.

Senior developer questions:


1.

Where must PDBs be located for debugging to work?

2.

Describe the difference between Trace.Write and Debug.Write?

3.

What is boxing?

4.

What permissions does a process using XmlSerializer require?

5.

What is the purpose of Port 135?

You can use these sample interview questions or discussion topics to get a
better idea of a candidate's grasp of ASP.NET. While you still have to
determine if the person's personality fits within your organization, you can
at least get an idea of their technical skills.
Note: This content is also available as a downloadable PDF.

What are page directives?


The first line of an ASP.NET page is the page directive; you will find it on all
ASP.NET pages. These directives are instructions for the page. It begins
with the @Page directive and continues with the various attributes available
to this directive.
It's unreasonable to expect a candidate to know all of these attributes, but a
few popular ones include the following.

AutoEventWireup: Indicates whether page events are autowired.

CodeBehind: The name of the compiled class associated with the


page.

Debug: Indicates whether the page is compiled in debug mode


(includes debug symbols).

EnableTheming: Indicates whether themes are used on the page.

EnableViewState: Indicates whether view state is maintained across


pages.

ErrorPage: Specifies a target URL to be used when unhandled


exceptions occur.

Language: Indicates the language used when compiling inline code


on the page.

Trace: Signals whether tracing is enabled on the page.

What is a master page?


A master page is a template for one or more Web Forms. The master page
defines how the page will be laid out when presented to the user, with
placeholders for content. The MasterPageFile Page Directive in a content
page's header is one way to assign a master page. The content pages rely
solely on content and leave layout to the master page. ASP.NET merges
the content with the master page layout when the content page is
requested by a user.

What is the code behind feature of ASP.NET?


The code behind feature divides ASP.NET page files into two files where
one defines the user interface (.aspx), while the other contains all of the
logic or code (.aspx.cs for C# and .aspx.vb for VB.NET). These two files
are glued together with page directives like the following line, which ties the
page to the specific code behind class.
<%@ Page language="c#" Codebehind="UICode.cs" Inherits="Library.UICode" %>

What are ASHX files?


ASP.NET Web handler files have an .ashx file extension. Web handlers
work just like .aspx files except you don't have to deal with the browser
interface, thus no worrying about presentation. Web handlers are generally
used to generate content dynamically like returning XML or an image. Web
handlers use the IHttpHandler interface with the ProcessRequest() method
invoked when the handler is requested. Web handlers are simpler than
pages (fewer events and wiring), so they are ideal for performance-critical
applications.

How does PostBack work?


PostBack is basically the ASP.NET submitting a form to it it posts back to
the current URL. The JavaScript __doPostBack function is placed on the

page (look at the source within the browser) to facilitate. PostBack uses
ViewState to remember controls and data. The IsPostBack property of the
ASP.NET page allows you to determine if the loading of the page is the
result of a postback event; this is done in the Page_Load event.

How can you pass values between ASP.NET pages?


There are numerous ways to accomplish this task; the option you choose
depends on the environment. The oldest way to approach it is via the
QueryString (i.e., passing values via URL); this is also one of the least
secure ways because users can easily see the data and could possibly
hack the site/page by changing parameter values. Next, you can use HTTP
POST to pass values; these are available via a collection within the
ASP.NET page. More specific to ASP.NET is the use of Session state,
which makes information available to all pages within the ASP.NET
application. Another approach is using public properties on the source page
and accessing these properties on the target page. Also, you can use the
PreviousPage property of the current page to access control information on
the referring page. The last two require the source, and target pages are
within the same ASP.NET application.

What are ASP.NET Server controls?


ASP.NET includes a number of built-in server controls that are the
foundation of its Web programming model. They have various properties to
control their behavior and appearance. These controls provide an event
model where events are handled on the server (whereas HTML controls
are handled in the client). Server controls have the ability to maintain state
(via ViewState) across requests, and they can automatically detect the
browser. With these controls, you will see the RunAt attribute
(RunAt="Server") that signals its processing will be done on the server. A
good example of these controls is the basic TextBox control (<ASP:TextBox
RunAt="Server" .... >.

What is View State?


Basically, View State is how ASP.NET Web pages persists data across
requests. It handles data that must be preserved between postbacks, and
you can use it to store page-specific data. By default, View State is enabled
on a page and its controls. This can be a problem as the amount of data
and controls on a page increases resulting in more data for ASP.NET to
maintain. This is accomplished via the hidden __VIEWSTATE field on a
form (look at the page source in a browser), so more data in this field
means a slower load time and slower overall processing, as it has to be
posted to the server each time. You can limit the size of the data in View
State by disabling controls that do not need to be persisted via the
EnableViewState property. View State can be encrypted to address security
concerns.

What is the global.asax file?


The global.asax file is an optional piece of an ASP.NET application. It is
located in the root of the application directory structure. It cannot be directly
loaded or requested by users. It provides a place to define application- and
session-wide events. You can define your own events, but it does contain
default Application events like when the application starts Application_Start
and ends with Application_End. The same is true for Session events
(Session_Start and Session_End).

How can you loop through all controls on an ASP.NET


Web form?
You can easily traverse all controls on a form via the Web Form's Controls
collection. The GetType method can be used on each control to determine
its type and how to work with it. Now, it gets tricky because the form
contains a tree of controls; that is, some controls are contained within
others (think of a Table). You would have to recursively loop through the
controls to make sure everything is processed.

What is a web.config file? Machine.config?


The web.config is the basic configuration file for ASP.NET applications. It
utilizes an XML format. It is used to define application settings, connection
strings, and much more. These files can appear in multiple directories, and
they are applied in a top-down approach; that is, configuration files apply to
their container directory as well as all directories below it, but the
configuration files in lower directories can override those in parent
directories. This provides a way to granularly apply settings. The
machine.config file contains ASP.NET settings for all of the applications on
the server it is at the top of the configuration file hierarchy, thus
web.configs can override it.

S-ar putea să vă placă și