One Liners dot net

59
.NET basics IL code JIT(just in time) Why is ithalf compiled ? CLR CTS CLS CAS where do we use CAS What has happed for CAS .NET 4.0 ? How does the .NET code compile ? Managed code Assembly DLL and EXE Manifest how do you do versioning What is DLL Hell ? what is ref and out ? Strong names Delay signgin sn.exe What are strongly typed and weakly typed references ?

description

asp.net question and answers

Transcript of One Liners dot net

Page 1: One Liners dot net

.NET basicsIL codeJIT(just in time)

Why is ithalf compiled ?

CLR

CTSCLS

CAS

where do we use CASWhat has happed for CAS .NET 4.0 ?

How does the .NET code compile ?Managed codeAssemblyDLL and EXE

Manifest

how do you do versioning

What is DLL Hell ?what is ref and out ?

Strong names

Delay signginsn.exe

What are strongly typed and weakly typed references ?

Page 2: One Liners dot net

Value and Reference types

Stack , heap

boxing , unboxing

How can we avoid Boxing and unboxing ?

Garbage collectorHow does the GC run

Does garbage collector clean unmanaged code ?

So what do I do for unmanaged ?

What are gen0 ,1 and 2?

Finalize a.k.a destructor

What is Dispose function ?

Finalize and Disposecan we force garbage collector

Does unboxing and boxing bring down performance ?

Do I need to write clean up code for managed objects ?

What kind of problems do we have with destructors from GC pewrspecticve ?

how to ensure that lot of objects are not created in Gen 1 with class having destructor ?

Page 3: One Liners dot net

What are namespaces ?

OOP

Why do we need object oriented programming ?

Important principles

How is the reusability problem solved in OOPs ?

What is a class and what is aobject

Encapsulation

How do we implement encapsulation

Can namespace span across DLL

Abstraction

Abstraction and Abstract classes

difference between Abstraction and Encapsulation

Private , public , protected etc

What are constructor and desctructor ?

Inheritance parent child which constructor fires firstWhat is multiple interfaces are implemented How to prevent inheriting futher

What is Static classes ?How to prevent object creationWhere do we use the same ?Inheritance(:)

Page 4: One Liners dot net

Polymprphism

Method overloadingWhat are the different ways of overloading

What is virtual and override keyword ?

Dynamic polymorphism

Static Ploymorphism

What is a interface

What is the use of interface ?

Point to be remembered for interfaces

Can we create a object of interface or abstract class

Whats the difference between overloading and overriding ?

can we define public , private acess modifiers in interface ?

Do implemented classes need to implement all the methods of a interface ?

Page 5: One Liners dot net

partial classesuse of partial class

Abstract and virtualMultiple constructor with parameters

what is a abstract class ?

Point to be remembered for Abstract classes

Abstract classes and interfacesCan we have static methods in Abstract class ?

Multiple code level inheritanceversioning

operator overloadingDelegatescreate and invoke a delegate

What are abstract method and non-abstract method ?

I have a interface IMyInterface which is implemented by class1 and class2 , I want to add some more functions and methods to the interface , what should I do ?

Page 6: One Liners dot net

Use of delegate

Delegate and interfaces

Multicast delegate(+= , -=)Use of Multicast delegate

What is Unicast ?

Events

Difference between delegates and events

Asynchronous delegates

covariance and contravariance(.net 4.0)

Shadowing

Shadowing and overridingShadowing practiceProperty indexer1.1 collection differences

Difference between Array and Arraylist

What is a generic listGeneric confined the type

HashtableStacks and Queues

Are there any performance problems with normal .NET collection ?

Page 7: One Liners dot net

Regex and validation

GAC

how do we register in GAC ?If you have different versions ?

satellite assemblyDelay signing

Generics

Does generic improve performanceThreading

How do we use threadingcan we set thread prioritythreading can we stop and suspendBackground and foreground threadreadonly and constant

What is reflection ?

In what scenarios we would use reflection ?

hod o you do reflection

What is Serialization ?what is indexer ASP.NET and Webservices

Objects in ASP.NETAutoeventwireup

What are generic collections / Where have you used generics

Page 8: One Liners dot net

AutoeventwireupIIS , PORTS and Website

Application pool concept

HttpHandler and httpModulesHttpHandler

.ASHXHttpModule

Create a HttpModule

Create a HttpHandler

ASP.NET application and page life cycle

What logic should be written in what events ?

What is a ISAPI ?UI controls ( buttong , text box , drop down ..

why do you need Session ?

how do we do Session management in ASP.NET ?

Are session variables are local to a user ?

What is the difference between render and pre-render ?

how do we implement Inproc session management in Asp.Net ?

Page 9: One Liners dot net

What is a viewstate ?

What are the problems with viewstate

What is web farm ?

What is a loadbalancer?

What is web garden ?

How to implement web garden ?

Why do we need a outproc session ?

How can we do out proc session

Whats the life of session ?state server

How can we cache a ASP.NET page ?

Cache whole opage

What is difference between viewstate and session variables ?

What are server side session management and client side management ?

What are the various ways by which you can cache your page ?

How can we cache the whole page and sections of the page should be dynamic ?

Whole page dynamic and sections of the page is cached

Page 10: One Liners dot net

How can we cache as per location

What is a Application and Cache object ?

What is cache dependency ?

Absolute and slidingwhat is scavenging ?

Postback

Autopostback

IspostbackConfiguration setting in web.config

Server.transfer and response.redirect

Authentication Authorization

What is Forms Authentication ?

What does actually a ticket mean ?

What is windows authentication ?

Whole page achced and sections of the page is dynamic

What is the difference between cache and application object ?

If cache dependencies changes does it reload the depedency ?

How do you know the user logged in to ASP.NET system ?

What are different ways of authentication and authorization

Page 11: One Liners dot net

What is passport authentication ?

how can we implement Windows authentication ?

How can we do Forms Authentication ?

What are cookies

what if cookies are diabled in forms authentication ?

Single sign on

How can we implement Single sign on ?

aspnet membership and roles

how does ASP.Net membership roles work ?.

Debugging and Tracing in ASP.NEThow can we do tracing in ASP.NET pages

whats the problem with trace=true

How can we configure tracelisteners and source ?What is the namespace ?

Page 12: One Liners dot net

Ajax

What is updatpanel

what is script manager?

What is Script manager proxy ?Enablepartial rendering

How can we consume webservices in Ajax ?

What is Jquery ?

Difference between datagrid , datalist and repeater

Gridview and datagridPaging in datagridSQL ServerDatabase and TablesSQLself/equi joinsReferentrial integrity

Normalization

Normalization

Denormalization

When should we use normaliztion and denorm

Page 13: One Liners dot net

Indexes

Balance treeClustered indexes

Non-Clustered indexes

Self joininner joinleft jonright joincartesiancase statements

Select all rows from both tables

cross join / cartesian

Stored procedures

What is advantage of SP over inline SQL

What are triggers ?

When will use a clustered index and not clustered index ?

in group by if we put a column which is not in group what wuill happen

Page 14: One Liners dot net

What are types of triggers ?What are inserted and deleted ?

Functions

Difference between function and stored procedure

How to handle errors in Stored proceduresParamters in Stored procedure

profiler

optimzation sql plan

sql server locking

SQl injection

How can you avoid SQL injection

SSISSSRSSSASDifference between delete and truncate ?ADO.NET

What are ADO.NET components ?

Whats the difference between Dataset and datareader ?

Page 15: One Liners dot net

How do you connect to ADO.NET

how do you load a datasetDataview

Command object methods

how can we use stored procedure in ADO.Net Wht connection.close

How do you write and read using XML using ADO.Net

Problems of Locking

optimistic and pessimistic

how can we do optismistic locking in ADO.Net ?

Pessimistic locking

Scnearios of pessimistic and optimistic

What is a transaction ?

how can we implement trans

Connection pooling

In what scenarios we will use a dataset and datareader ?

Page 16: One Liners dot net

How do you pass parameters t stored procedureshow can you automatically fill command objectDatarelationnerge

ReportingWhere do you get Crystal reports ?

How did you create report using crystal reportshow to provide inputs to crystal report

Remoting , Webservices and WCF

What is Appdomain ?

What's the advantage of Appdomain ?

What is the use of remoting ?

How do you create a remoting object ?

Problems with remotingComparison of DCOM and remotingremoting objects life time

what is a webservice ?

How can we do webservice security

UDDI and DISCO

Page 17: One Liners dot net

What is WSDL ?

What is SOAP ?

What is Service Oriented Archotecture ?

Why WCF ?What is WCF ?

What is Address binding Contract ?

namespace of WCF

how do host in IIS ?

How do you do self hosting ?

What are the important bindings/BasichttpBinding and WshttpBindingHow to secure basichtppbinding

What is difference between Webservice and Remoting

What is Service contract , Operation contract and Data contract ?

what's the difference between WCF and Webservices ?

What are the different hosting mechanisms of WCf services ?

When should we go for Self hosting and when to go for IIS

Page 18: One Liners dot net

Ho can we do debugging and tracing in WCF

How can we do transaction in WCF ?WCF Security

WCF Transport

WCF overloading is it allowedDynamic polymorphismWCF DuplexWCF messageWCF InstancingWCF concurrency

WCF RESTWCF integration

LINQ and EF 4.0

What is LINQ

What is a Entity class

What is data context

How do we declare 1 to many and 1 to 1 relationLINQ to SQLOptimization using data load optionsCRUD example using LINQCall Stored procedures using LINQ

Page 19: One Liners dot net

LINQ lockingPLINQLINQ transactionsDBML

WPF and SilverlightGDI , GDI + and Directx

Simple WPF application Rendering in WPF applicationArchitecture of WPF

What is silverlight ?Architecture of SilverlightAnimation fundamentals in Silverlight

What are different way of silverligjt layoutin..

In what scenarios you will use what ?

How can we connect froom Silverlight to SQL Server

Why not directly ?

Consume WCF service in Silverlight

Database operations using SilverlightPrismMVVM

WWFWWF architectureComposite and leaf activitiesSequential and State machine work flowSimple example of WWFState machine work flow

Design patterns

What are the different ways of binding the silverlight UI with .Net classes and objects ?

Page 20: One Liners dot net

Which design pattern have yu used ?

Design patternsWhat are the categories of Design patterns

Factory pattern©

Abstract Factory PatternBuilder PatternPrototype Pattern

Where is prototype used ?Singleton Pattern

How did you implement singleton pattern ?

We can achieve the same by cache and applicationwe can achieve the same by using static object

Adapter Patterntypes of adapter patternBridge PatternComposite PatternDecorator Patternusages of decoratorFacade PatetrnFlyweight PatternProxy PatternMediator PatternMemento PatternInterpreter PatternIterator PatternCOR PatternCommand PattrenState PatternStrategy PatternObserver Pattern

Template PatternVisitor Pattern

DIIOCConcept Pattern

Page 21: One Liners dot net

What is MVC,MVP and MVVM

How is MVP

Model view controlleHow do you implementStrongly typesWhat is html helperBut how did the modelsHow to you write form action / hyperlinksAuthentication and Authorization

What are routesvalidation

MVP and MVC

When to use these patterns

UML

Use Case Diagrams

What does use case have normally ?

How did you document your requirement ?

What are primary actors and secondary actors ?In which format did you gather your uses cases How did you show relationship n uses cases

Page 22: One Liners dot net

How did you translate your requirement to design ?

Class Digrams

How do you denote a class diagram in UML ?

Structures VS classesHow do we define relationships in UML

What is composition and aggregationHow can denote inheritance ?

How can we denote abstract classes and interfaces Object Diagrams Sequence Digrams

how did you draw a sequence diagram ?

Recursive message

Conditcion

How to demote public , private and protected in class diagram

How do you show synchronous and asynch messages

Page 23: One Liners dot net

Message branching

Collaboration Diagrams Activity Diagram

Parallel processing , partionting and conditions State chart Diagrams Component Diagrams Deployment Diagrams Stereo Types Diagrams Package Diagram UML Project Flow

Functionpoints Introduction

EI Fundamentals EO Fundamentals EQ Fundamentals EIF Fundamentals ILF Fundamentals GSC Fundamentals Productivity FactorHow did you reconcileHow did you accommodate SDLC

RUPWhat is AgileHow did you do Agile

What are the principles in AgileWhat is Agile SCRUM ?

How does SCRUM process work

When Agile and Waterfall ?

Page 24: One Liners dot net

How did you code review?

Role of your current project(SDlC)

simplicity your projects

How did you test your project ?How did you do requirement for your project ?technical Design AcceptanceHow did you do unit testing in .NET ?Summary Speak abt yourselfOOPs.net basicasp.netWhy Gap ?Differences ( .NET , ASP.NET and SQL Server)

Can you explain the architecture of your current project ?

What software process did you follow for your project ?

Page 25: One Liners dot net

HLD and LLD

Page 26: One Liners dot net

Key wordsPartially compiled codeIL code to machine language

Sepcification / Guidliness of the source code

x`Its a unit deployment ( EXE , DLL)EXE - Self starting , DLL - You have to link

versioning done here

So that at run time we can detect the machine configuration , operating system give out optimized machine compiled code.

Heart of the engine , GC , compilation , CAS(Code access security) , CV ( Code verification)

Common data type for different .net languages so that integration is seamless

It helps assign the .NET code permission of what they are capable of doing.

When we consume third party components which are not safe

write the code (c#,vb.net,c++.net)-- compiles to a IL code -- CLR gives it to JIT -- JIT compiles to the machine specific language

it describes more about the assembly ( Meta data):-Versioning, References , dependent objects , Security , Scope

Assemblyinfo.cs / right click properties -- assembly information

They help you to identify the publisher. Strong typed means we identify the DLL with a public key token while weak references are just simple references and identified only by class names

They ensure that the class name is unique to avoid confusion

This is meant to protect DLL identity from your internal team developers , public key is give to the developer byextracting using SN.EXE -p , when you ready to go for production you will onject the private key in the DLL SN.EXE -R

Page 27: One Liners dot net

You can not avoid it just minimize it

Its run in background

No

You need to write the cleanup in destructor

lot of objects created in gen1

Yes , GC.Collect

Values types int , double , bool etc , Reference types objects and strings. Value types are allocated on stack and reference types are allocated on heap. Value types are stored on different memory locations while reference types point to the same memory location

They are memry types .Stack has value types , heap has reference types

Box - Convert from value to reference , unboxing - reference type to value

yes they do bring down performance because data has to jump between heap and stack memory types.

garbage collection is continous back ground thread which keep running and claims unused managed memmory.

No, GC is smart to figure out unused objects and clean them up

Age of the objects.Gen 0 has newly created objects , gen 1 has objects which are bit older , while gen 2 has objects which is more older than gen 1.This is for GC optimization , garbage collector checks Gen 0 frequently rather than Gen 1 and Gen 2.

It’s a desctructor for cleaning up unmanaged objects.Decreases performance because of objects move more to Generation 1. The time GC sees a destructor in a class it moves them to Gen 1

Implement Idisposable -- Expose a Dispose function -- Call GC.SuppressFinalize

Its method exposed for clean up for client,Idisposable , Dispose , GC.SuppressFinalize

Finalize is a destructor and dispose is function which is implemented via Idisposable.Finalize is nondeterministic since we dont call it. It is up to the GC to call it. However dispose gives more control to the developer to perform cleanup. Since we can call it explicitly.

Page 28: One Liners dot net

They help us to logically group classes.

Encapsulation is implemented by using access modifiers

Parent Constructor fires first and then child.It will qualify with interface nameuse the sealed keyword

Create the constructor as privateIn Singleton patternDepicts parent child relationship between classes

1.No thinking in terms of real world 2. Reusability 3. Extensibility 4 Simplicity and maintainability

APIE (OOPs ( Encapsulation , inheritance , Polymorohish and Abstraction))

Its solved by using classes and creating objects wherever necessary

Class -> Blue print , template , Objects -> Bring life in Class , they make them live

Hide the complexity and make your object simple for external world.

yes , namespace are logical grouping of classes they can span

Show only what is necessary and its more a thought process and abstraction is implemented by encapsulation

Abstraction is OOPs concept and Abstract classes is half defined classes

Abtsraction complement Encapsulation , Encapsulation implements abstraction

Private - Only with in Class , Public - Seen everywhere , Protected - With in same class and inherited classes , Internal - Within same class and same project and Protected internal is combination of protected + internal i.e. with in same class , iherited class and same project file.

Constructor(same name as class name with no return type) - initialization purpose , while destructor(~) is for cleaning purpose.

Static object has ony instance of the object created through out your application.

Page 29: One Liners dot net

types , order , ref m out … do it

No , by default everything is public.

Yes

No

objects will act different in differently under different situation

You can have same method name with different number / types of parameters and depending on different parameters and types the appropriate functions will be invoked.

Virtual keyword gives permission to its child classes to override the function / method. The child classes will then use the override keyword to override the same.

Overloading we have same method / function names with different signatures ( input types) while overriding is a child parent concept where we override functionalities of the parent class.

Method overriding and Virtual. You point your parent class object to child class objects to fire the necessary implementation on runtime. Even interfaces can be used to implement dynamic polymorphism

Method Overloading , we call same method with different input parameters

Its looks like a class but has no implementation. It has only empty definition of methods , functions, events , indexer.

to Establish a standard contract/standardization , to decouple classes, dynamic polymorphism( runtime bhevior) ,version , multiple inheritance

Interface keyword is used to define interfaces.Interface can not have field variables.Interfaces can not have implemented functions and methods.All methods in a interface in child class needs to be implemented.Interface can be used to implement run time polymorphism.You can implement multiple interfaces.All interface methods are public

Page 30: One Liners dot net

designer based code.

Yes

It’s a abstract strong typed pointer to a functionDeclare , Create , point and invoke.

splits a class in to 2 plhysical files. But when the compiler runs he compiles them in to one class.

Abstract no implementation and virtual has implementation

Half defined parent class / base class and child classes provide concrete implementation, like a generalization and specialization

Abstract method will not have any implementation while non-abstract methd will have implementation they are normal .NET methods

An abstract class cannot be a sealed class.An abstract method cannot be private. You can have protected and internal if you want to.The access modifier of the abstract method should be same in both the abstract class and its derived class. If you declare an abstract method as protected, it should be protected in its derived class. Otherwise, the compiler will raise an error.An abstract method cannot have the modifier virtual. Because an abstract method is implicitly virtual.An abstract member cannot be static.

Interface is a contract / standardization while abstract class is a half defined class for increasing reusability. Interface is forced implementation while abstract class is reusability via inheritance.

Create a new interface with additional methods or inherits from the interface and create a interface with methods and apply them. This ensure that the current contracts do not get disrupted.

Operator overloading is a concept of plymorphism where you can redefine operators like + , - , * etc with additional functionalitiues. For instance we can redefine the + functionalities to add numbers like 1+1,

Page 31: One Liners dot net

For boardcasting to multiple classes

This helps to point delegates in a very generic fashion

Should avoid Shadowing as far as possible.

public class cls<T> where T : String

First in first out and last in first out

yes boxing unboxing happens

Delegates helps for call backs. So if you have huge task running in multithreaded manner and you would like to get messages from that task you will use delegates.

Delegate is at method level while interfaces are at class and object level.

It helps them to point to multiple functions and execute them sequentially.

When one delegate point to one function its called as unicast.

Events encapsulates(hides) delegates. They are useful for boradcasting , publisher and subscriber

Events use delegates internally. Delegates are pointer to function while events encapsulates ( hiudes) delegate function. In event clients can only subscribe while in delegates the client can subscribe as well as call all the functions of the delegates.

Begininvoke and endinvoke , calls the methods of delegates asynch , for parallel execution.

It replaces the complete element of the parent class. Like method becomes a variable

in shadowing the complete elements is replaced and in overriding you only replace the implementaton while the type remains same.

Array - Fixed , ArrayList - resizable , Array has performance improve ment as no boxing and unboxing takes place while in array list it does , Arraylist can not store mutiple data types while array has fixed data types

Strognyl typed list and improves performance by avoiding boxing and unboxing

Stores the value as hashed key , good for comparison , but bad in terms inserting valies

Page 32: One Liners dot net

Use Bindingredirect , Oldversion and newversion

Yes , type casting is avoidedThreading is used to do pararellel execution.

ThreadPriorityyes by using thread.start , suspend , stop

They are smart arrays

request , response , context , session and application

Regex is nothing pattern matching and then validating the data using the pattern

To share the assembly across multiple application in the same computer (C:\WINDOWS\assembly)

Give strong name to DLL by click on the signing tab -- second you use thr GACUTIL -I to register the assembly in GAC

It’s a compiled DLL which has images , text files any resource files. In other words no can tamper with your images , text files , icons etc.

Its to increase reusability by seperating logic and data type and its strong typed.

Generic collections enable simple .NET collections to be generic enabled. So a normall List can be attached with any data type and we can avoid casting

Create the thread object , pass the method name using thread start and call the start function.

BY using System.reflection you can read meta data like properties , methods and also if needed you can invoked the methods and functions dynamically.

technological tools like VS IDE , code reviews tools like Fxcop , unit testing NUNIT etc

Import system.rflection , get the type of t he object using gettype and then you can browser through functio an dproperties , to invoke use the invokemember

Helps to store in memory object in file and dessrialization means read the value from file and bring it in memory back.

Page 33: One Liners dot net

HttpHandler is extension based processor.

HttpModule is a event based processor

by using session object of ASP.NETYes

When the request is send to the server from a UI element like button , drop down etc the postback happens

Application pool helps you to isolate one website from the other website. So if that website the other websites affected. It acts a logical boundayr.

They are means by which you can inject pre/post-processing logic before the request reaches the page /gif/html

Its nothing but Httphandler below , they helps us to display data which does need asp.net pages and thus they improve performance

Create a class ,implement IhttpModule, attach events with your methods and register the class in web.config in httpmodule tag

Create a class implement IhttpHandler , define implementation for processrequest, register the class in web.config with file extensions in httphandler tag

environment created(request , response , context) - http module event ( begin request etc) - httphandlers ( page extensions) - page event (S/ILVER)-http module (end request)

init (add controls dynamically), load(write logic),validate(fire your valdation),event(ui element events),pre-render(changes before HTML is generated) , render ( changes before HTML is sent to the browser) and Unload ( clean up)

Pre-render event happens just before the HTML is generated while render event happens when the HTML is sent to the browser.

HTTP is a statless protocol and in order to remember states during postback we need session variables

inproc (session object), outproc ( sql server and state server)

Page 34: One Liners dot net

Securuity

Outproc sessions are needed in web farm environment

Session time out or when the user closes the browseraware used for outproc session

Param , Headers , Custom and UserControl.

By using ASP:Substituion ( post cache substituion)outputcache directive at page level

Outputcache directive at usercontrol levele.

Its meant for session management and it uses hidden fields internally.Viewstate is a way to manage session using client browser , it uses hidden fields internally.

Viewstate value is accessed only in the current page while session variables can be accessed in different pages also.

Many times our current load demand increases. We can then create Web farm which has two or more servers to meet the load.On the front end there is load balancer who routes the load to the appropriate server on load basis.

Loadbalancer helps to decide which server the request should be routed. There are many load balancers one of the is Windows NLB ( network load balancer) in windows server

You would like your IIS processes to run on different processors of the machine rather than loading only one processor.

In the process model tag ( web.config or machine.config) provide the CPU mask value in decimal quivalent of the binary.

step 1 - create session tables using ASPNET_REGSQL , Step 2 : Set <sessionState mode="SQLServer" with connectionstring point to the database where session tables where created.

By using the <%@ OutputCache Duration="20" Location="Client" VaryByParam="*" %>

Page 35: One Liners dot net

Substituion control.location = server , downstream , client

They help to create global objects in Asp.Net application.

in the appsettings

Who the user is?What rights does the user has ?

Windows , Forms and Passport

In cache we can define dependency while application objects we can not define depedency.

you can define 3 kins of dependency file , time and key. If these dependencies change then the cache object becomes null.

No Cachdepedency does not have automation , we need to write t he code of refresh and reload.

When your user control sends data to the server postback event happens

When you want to send data to server as soon as the value changes in the control. It’s a simple property which we need set on the control.

It’s a page property tpo check if the postback has happened or not

response.redirect has a double trip while server transfer transfers control from the server itself. Using response.redirect you can redirect cross domains while server transfer you can redirect only between pages of the same domain.

using principal and identity objects which belongs to System.Security namespace.

It’s a ticket based authentication . Tickets are passed via URL or stored in cookie file at the user browser.

Ticket is a identification saying that you are a valid user. By using ticket you do not need to send userid and password again and again. Userid and password are sent first time , ticket is generated and later this ticket identifies your security role and rights.

In this the users are validated from windows local users and groups.

Page 36: One Liners dot net

Its passed via browser URL.

Trace=true

It logically groups calsses together

In this the users are validated from microsoft sites like hotmail , devhood , MSN etc , ticket is generated and that ticket can be used to do authentication . Autho in your web application.

Create users in yours windows user group -- in web.config file define <authentication mode="Windows"/> -- <deny users="?"/> Deny anonymous users - map page name and roles.Authentication mode = forms in web.config file ,FormsAuthentication.RedirectFromLoginPage/Authenticate

Cookies are files which are created in the end users computer to track behavior etc.

Single sign on is a concept where you login to one website and it automatically authorizes and authenticates other websites.

Create a machine valudation key using (using RNGCryptoServiceProvider) - define the same machine validation key in to the web.config file for all websites which will be coming in the single sign on -- use forms authentications

It helps to expedite your development for authentication and authorization by giving ready made user and roles tables , user interfaces and API to connect to those tables.

run aspnet_regsql -- do web.config configuration ( connectionstring , providers and roles) -- call the API from your ASP.NET behind code (Membership.CreateUser,Roles.CreateRole and Membership.ValidateUser)

Tracing is a way to monitor the execution of your ASP.NET application. You can record exception details and program flow in a way that doesn't affect the program's output.

our debugging is shown to the end users , so we need to use tracelisteners

In web.config file define your source and listeners , in your code create the trac object and start sending messages(trace.write)

Page 37: One Liners dot net

This enables asynchrounous processing

It’s a database design technique to avoid repetitive data.

Ajax is a technology by which you can do asynhcrounous processing and only the ncessary values are posted rather than posting the whole page. Performance and great user experience.

Updatepanel is a component which ensures that your server objects become Ajax enabled.It logicall groups them so that only that data is posted.

It injects the necessary javascript to ensure your ajax update panel runs.

In Ajax we can have only one script manager. But there are condition like master pages where we would need two script manager

In Script manager proxy give asp:servicereference and give ASMX path and use javascript to call the objects

Jquery is javascript library to make your javascript development simpler.

Datagrid displays everything as table , datalist has tables but gives flxibility like number of columns to displayed , while repeates is highly customizable, performance goes first repeater , then list and finally grid

Gridview is the sucessor of datagrid,Automatic handling of sorting, paging, updates, and deletes,Additional column types and design-time column operations, rich design capaibilities

3 normal form , 1st normal form Break is Smallest unit , 2nd all data should depend on the primary key fully , 3rd normal form Any non key field should not depend on other non key fields of the table

Its combining multiple table data in one table thus avoiding joins for performance imporvement ex - reporting applications

Normalization ( integrity , avoide redudant) and denorm ( faster treival , reporting etc)

Page 38: One Liners dot net

The leaf node points to actual data

Query will no fire

Indexes helps to make your search faster by using balance tree( B tree) concept

It’s a tree structure with leaf nodes having actual data , non leaf node and root node. So rather than browsing through records sequentially it zeroe's on range of records , this making your search faster

Leaf node points to a pointer and that pointer points to actual data

You will choose fields with unique values as clustered indexes while fileds which participate in search criterias you will select them as non-clustered indexes.

SELECT *FROM Customer INNER JOIN CustomerPaid ON Customer.Id = CustomerPaid.IdunionSELECT *FROM Customer left JOIN CustomerPaid ON Customer.Id = CustomerPaid.IdunionSELECT *FROM Customer right JOIN CustomerPaid ON Customer.Id = CustomerPaid.Id

Stored procedures are SQL Server objects which have one or many SQL statements

They are precompiled and thus increases perforance ( parsing , plan and then execution)

Trigers are logic which you want to execute insert , delete and update operation on a table

Page 39: One Liners dot net

using Raiserror function , give message severity and stateinput , ouput , return( only one)

Describes how your SQL statements will execute.

After trigger ( fires after the operation )and instead of trigger ( before the operation). Operation means insert , update delete

It returns a scalar value and is called from stored procedure

Function reduce redudant code in SP.Function - You can not change data while in stored procedures you can , can return only one value while SP returns multiple values, functions can be called inside a SP but not the vice veras

It’s a simple listerner tool which tracks what kind of SQL statements are fired on your SQL server and using it you can do debugging and improve performance using performance tuning wizard

Create indexes ( balance tree), SQL Plan ( Table scan or Index scan) , SQL profiler and Data tuning advisor for getting suggestion of indexes

set isolation level read committed etc etc in stored procedure

It is a Form of attack on a database-driven Web site in which the attacker executes unauthorized SQL commands by taking advantage of insecure code on a system.

Do proper validation,use stored procedures and avoid on the fly SQL concatenation.

SSIS helps us to do ETL ( Extraction - Transformation and Loading). We need to create a Business intelligence project define source , transformation and destination and run the DTS package.

Connection , Command , Dataset , dataadapter , datareader(2C and 3D)

Dataset(back and forth) - works disconnectly , CRUD , reader works connecteldy

Page 40: One Liners dot net

Helps to search, sort filter dataset

Executereader , executenonquery and executescalar

To ensure the SQL Server resources are released

readXML , WriteXML function of dataset object

Dataset :- When you want to take group of records , modify/browse in offline mode( move back and forth) and then send the whole changes online. Datareader :- You have huge number of records and you want browse in the forward onnly direction

connection , Command , ExecuteNonQuery/ExecuteQuery , use it and close it

connection , Command , Dataadapter , load dataset by Fill method , use it and close it

ObjCommand.Commandtype = CommandType.Storedprocedure , give the stored procedure name

Dirty Reads,Unrepeatable reads,Phantom reads and Lost updates

Pessimistic means locks are acquired when the record is fetched until the updation and optimisitic means locking is acquired when the data is updated

dataset and dataadapter by default supports optimistic locking , timestamp,checking old values and new values

Read committed( reads data which is committed) , Read uncommitted ( reads data which is yet not committed), repetable read ( No updates allowed)and Serializable (Exclusive lock no updates , insert and selects).

Transactional screens / data enty screen where large number of users,critical batch processes done at the end of the day or year( closing of accounts).

When you have group of statements . Process doing insert update and delete , you would want either all of them pass or either all of them fail.

call begintransaction in connection object , committransaction or rollback, in stored procedure begin tran tr1 and commit tr1

Reuse the connection object rather than reusing from scratch.In connection string specify pooling=true

Page 41: One Liners dot net

Paramater collection of command objectCommand builder.

It’s free available in VS

By parameter field

dataset is collection of tables with relationship and recordset has only tables

used RPT file -- Define my data sources -- Finally uses the reportviewer to display the RPT file on the UI.

Appdomains make logical boundary / isolation inside a process. Process -- Appdomains(task and application).

If one Appdomain crashes the other Appdomain or the whole process is not closed / terminated.

It helps to make remote method calls to objects which are residing in different appdomain. These Appdomain can be located in a different geographical location or different networks.

Create a interface -- Implement the object by creating MarshalbyRef -- Host your server object using Remoting"RegisterWellKnownServiceType" -- Create the client to call the service"Activator.GetObject".

Client and server can be only in .NET language , complicated, Faster than other remoting technologies, pick and choose Channel and formatter ( customization)

Webservice is a technology by which you can expose your business functionality on HTTP using SOAP XML format.

specify windows , passport , forms and pass credentials through the client proxy object

Helps to search and discover your webserbvice from the UDDI directory

Page 42: One Liners dot net

It was to satisfy SOA principles of WS-* specification.WCF = Webservices + remoting + COM plus + MSMQ

System.ServiceModel

IIS , Self hosting or WAS serverBy suing the SVC file we can host our service on IIS

basic is plain text while Wshtpp is encrypteduse SSL on webservices

It’s a meta data which shows what are the methods , properties , datatypes exposed by a service

It’s a XML protocol which is defined how your service and client communicate.

Webservice(Cross language , only Http) , Remoting ( only .NET platform , Any protocol)

SOA is nothing but desigining your system in self contained services which communicate via standard messages thus making your services loosely coupled. Services -- Self contained , Orchestrate , Industry Standard messages , Reliable , Aynshcrounous message , Cross plat form describe and discover

Address - where is it hosted , Binding - how is the protocol , Contract - what is the interfcae

Service contract - Service name , Operation contract - Your methods and functions , data contract - Custom data type , data member - property and functions of your data contract

Webservices = WCF - ( remoting( multiple protocols) + COM plus ( transactions) + MSMQ(queueing))

Create object of Service host , provide Address ( Uri) , Binding ( Wshttpbinding) , Contract ( Interface) and open the host.

Http go for IIS ( we getready made features like always running , process recycling,security,ssl etc), For other protocols go for self hosting

BasicHttp ( Like webservice plain text) , WsHttp ( Like basic with encryption) , TcpBinding ( To use TCP protocol for services ) , NetNamesPipe ( With in the same machine ) , MSMQ ( WCF integration with Queuing mechanism)

Page 43: One Liners dot net

Transport , message and transport + message

Per call , persesion and single instanceSingle , Multiple , Rentrant

Entity set for 1 to many and entity ref for 1 to 1

insertonsubit , deleteonsubmit , submitchangesUsing the function attribute

In Web.config <system.diagnostics> specify WCF trace source objects like System.ServiceModel , message logging etc. , then use the Svtraceviewer tool to see the mesagges

1 . Operation contract define TransactionFlow , 2. In Web.config file make your Binding as transaction flow as true 3. In client side call the services in one transaction scope with rollback and committ.

SSL , Specify in config file https in address tage , Specify security mode and install SSL in your WCF services

[ServiceContract]interface ICalculator{ [OperationContract(Name="AddIntegers")] int Add(int a,int b)

[OperationContract(Name="AddDouble")] double Add(double a,double b)}

Helps to expose your WCF service via simple HTTP get and post

It’s a OR mapper technology ,2 important use 1 - BO , DAL and Mapping , 2 - General Queries which can fired on any data store.

It’s a Business object which has mapping with the data store.

It’s the data connection layer to load the entity object with data

Page 44: One Liners dot net

PLINQ executes two linq queries parallelyBy using the transaction object of data context classDatabase markup language

By using WCF services.

WPF is for creating windows application , the user interfaces can be represented using XAML and it uses directx internally.

It’s a plugin which runs inside the browser. It can run on cross platform and cross browser.

Stack panel ( one above another ),Canvas ( we specify left and top), Grid ( If you want layouting using table structure , rows and columns)

One way ( UI to BO), two way( UI <-> BO) and one time( BO to UI).

One time binding - reports , Transaction screens two way , Pure input screen one way.

Because silverlight is a plugin which is a downsized version .NET framework and it does not have system.data

WCF service should have client access policy and cross domain , from silverlight you need to call the data asynchrounously

You can not call System.data directly from silverlight , so you need to call the WCF service and WCF service will do the necessary data operations

Page 45: One Liners dot net

Creational , Structural and Bheviorial

Factory centralized object creation of same heirarchy.

It does cloning of objects.

Audit trail , differences of objects , cancel and revertHelps to create one instance of the object.

Its technology specifc and not a generalized solution

Object adapter and class adapter.

Uniform interfacesAdding logic on existing logic kind of plug and play.Maintenace code addition , plug and play validation.Simplified interfaces

Browse the data in a encapsulated manner

So pick your best pattern corelate it with your project and speak about it. Share global fdata

Design patterns are tried and tested solutions for recurring design problems.

Abstract Factory sits on the top of factory patterns for generalized obejct creation.

Create a class with private constructor and define your object as static and expose it

if you want to adapt your current method names to new method names probably third parties.

Sequence process is same and you want to override the process

DI helps to inject depedent objects in to a class. DI injection can be implemented by Unity app block / Windsor castle

Page 46: One Liners dot net

MVC template ( 4.0)Model is binded viewIt helps to automate HTML code.Entity frameowrk / LINQBy poiting to the controller action.Windows authentication and Forms authenticaion

Data annotation ( attributes)

Company Template in word documentBy Extend and include

These are GUI architectural pattern with only one intention of seprating the UI Logic , state and synchronization in to a separate class.

Hit come to UI first , from there he calls presenter clas , presenter call the model and present then send updates via a interface to the UI. UI --> I --> P - M

Sepearetes Action , View and Data by using controller class. We have template MVC template which helps to automate the same. In odld asp.net we will httphandler which was tedious

This helps to customize the controller and action names to more user friendly name

First hit to the UI , First hit to the controller/MVP presenter takes care of logic , controller takes care of logic as well as statmanagement

If you have complicated UI code , MVC is mostly used for ASP.NET , MVVM is used for Silvetrlight and WPF becaiuse of rich command objects, MVP is not used currently because of less automation

UML is a modelling language which helps us to document and design our software application.

Its helps us to document "What" of the system from user point of view.

Use cases are task having scenarios and Actor executing those scenarios

Step 1 :- We identified the task which where nothing but our use cases , Step 2 :- For every use case we wrote down main scenario / alternate scenario and actors responsible

Primary actors are the users who are the active participants and they initiate the use case, while secondary actors are those who only passively participate in the use case.

Page 47: One Liners dot net

(+) Public , (-)Private , (#) protected , internal

by multiplicty (1-*)

Empty traingle arrow key.

{} - Abstract classes , <<>> - Interfaces

Object diagrams over a period of time.

Synch by dark arrow and asynch by thin arrow key

By small rectangle in a big rectangle

Inside Square bracket

We has already gathered the requirement using use cases and also relationships where between them using the include and extend, we use these use cases and identified nouns ( classes) and verbs ( they became our methods and functions) , relation ship between classes where identified by extend and include of use cases. Later for complex scenario we use Sequence diagram / Collobaration. We also had a over all architecture diagram which depicted hardware , components and logical grouping by using Component , Deployment and package.

Class diagrams shows the static structure of project. They help us visualize the classes and relationships between them

Its denoted with square divided in to 3 section , top section has class name , middle section has properties and last section has operation / function / methods

Struct complex data type , groups value types while classes represent real world objects. Its used where you are creating large number of objects and you do not want GC collector to stress. Structure are technical objects while classes represent real world.

Composition - life time of dependent objects are same , Aggregation :- Life time of dependent objects are not same and they can exist without each other. Composition is shown by filled diamond while aggregation is shown by empty diamond.

The objects in rectangle on the top side -- message by arrows and object life time vertical rectangles.

Page 48: One Liners dot net

Activity diagrams depicts complex flow of a system

Agile is a principle which means accept changesUsed SCRUM

Scrum is a methodology to implement agile

By two rectangles with condition and branching arrows from the same.

It shows the same information as sequence diagram but the emphsais is more on messages than life time of the objects

Shows by dark bar , Swimlanes for partitioning , Diamond is for conditions

Accept changes , Interaction with customer , people , working code

Customer Prepare Product back log -- priortizes them -- development team breaks them in to sprint -- every srpint has daily stand up meet( Today , yesterday,problems) -- Every week retrospective -- After sprint give chance of changing

Water fall - requirement is fixed , Agile -- If requirements will change or evolve.( Time to market)

Page 49: One Liners dot net

Mostly automation and the process

I was involved in all phases of SDLC cycle.Requirement( use cases , activity) - Design(Class , ER diagrams , Sequence / Collboaration) -coding / unit testing (NUNIT)- SIT - UAT - go live(junior ( coding) helped out ,poc( proof of concept) , pm / archotect) - end to end.

The applicaton was a integrator between indian chemical companies and EICA to provide certifications for Indian chemical companies as per EICA standards

It was a tiered architecture , UI / BO and DAL. With UI in ASPX pages , BO in normal .NET classes and data access layer helps to fire SQL queries on SQL Server. We had used singleton pattern and factory patterns in the project.

We followed normal SDLC model. In requirement we wrote the use cases , design we created classes and DB diagrams , finally we coded and unitested and went live.

Page 50: One Liners dot net

I do understand HLD but most of the times we have created a overall index of LLD and then expanded in to details. The use of HLD is mostly to verify before investing in LLD that are we in the right direction , to take approval from stake holders.

HLD has 5 section

Overall all architecture diagram ( Deployment , Component diagram , package diagram)Overall Road map ( 3 tier , MVC , MVP MVVM)technology Unit testingLoad test startergy

POC :- Proof of concept

LLDOverall detail architecture diagramClass diagrams , Object diagrams , Sequence / Collaboration , DB designIn depth test stratergyPsedu-code

Page 51: One Liners dot net

Your answer

Page 52: One Liners dot net

Create a simple windows screen , which has supplier name , supplier code , supplier date , button calculate payment date , supplier date + 1 month

Page 53: One Liners dot net

Create a simple project with page1.aspx and page2.aspx , create a simple buttong and in the button click redirect from page1.aspx to page2.aspx in the button click event

Page 54: One Liners dot net

devdev

dev

dev

Page 55: One Liners dot net

declare @count1 intset @count1= dbo.getfunctioncount()print(@count1)

Page 56: One Liners dot net

xxxx

xxxxxx

xxxxxx

xxxxxxxxxxxxxxx

xxx

Page 57: One Liners dot net

It’s a internal ATM management system in ASP.NET which has various functionalities creating Contracts , Customer report , hand bills , Scheduling etc.

Architecture patter ( 3 tiuer MVC MVVM) Describer each layer database normalization Each layer DI , FA 3 more layers Caching and global component validation External integaration -

Page 58: One Liners dot net

JSP and servletsStruts 1.x/2 (MVC)Spring (MVC)Java Server Faces (rich faces)Hibernate (ORM)JPA (ORM)EJB (persistance)JAXB ( parsing XML)JDOM (parsing xml)Java FxSCM toolsApache antMaven Svn repositoryCVS repositoryDatabaseOracleSybasePostgreSQLMySQLMs sqlApplication servers:IBM Web sphereJbossWeb logicUnit testing:JUNITtest ngSproing unitCache solutions:JBoss cacheEHCacheOS cachePDF library:itextReporting:JasperBIRTActuateProfilers:JMeterInfra red

Page 59: One Liners dot net

using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;namespace WebApplication19{ public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {

}

private void loadDataset() { string strCon = "Data Source=QUESTPON-SRIZE2;Initial Catalog=Sales1;Integrated Security=True"; // Step 1 - Create connection and Open SqlConnection obj = new SqlConnection(strCon); obj.Open(); // Step 2 :- Create the command object with SQL query SqlCommand objCommand = new SqlCommand("Select * from Customer", obj); // Step 3 :- Create dataadapter with command object passed to it SqlDataAdapter objDataadapter = new SqlDataAdapter(objCommand); // Step 4 :- Create dataset object and load it from Dataadapter