Vs Net Interview Question Answer

download Vs Net Interview Question Answer

of 41

  • date post

    13-Jul-2015
  • Category

    Documents

  • view

    48
  • download

    1

Embed Size (px)

Transcript of Vs Net Interview Question Answer

.NET basics IL code JIT(just in time) Why is ithalf compiled ? CLR CTS CLS 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 are strongly typed and weakly typed references ? What is DLL Hell ? what is ref and out ? Strong names

Delay signgin sn.exe

Value and Reference types Stack , heap boxing , unboxing Does unboxing and boxing bring down performance ? How can we avoid Boxing and unboxing ?

Garbage collector How does the GC run Does garbage collector clean unmanaged code ? Do I need to write clean up code for managed objects ? So what do I do for unmanaged ? What kind of problems do we have with destructors from GC pewrspecticve ?

What are gen0 ,1 and 2?

Finalize a.k.a destructor how to ensure that lot of objects are not created in Gen 1 with class having destructor ? What is Dispose function ?

Finalize and Dispose

can we force garbage collector 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 first What is multiple interfaces are implemented How to prevent inheriting futher What is Static classes ? How to prevent object creation Where do we use the same ? Inheritance(:) Polymprphism

Method overloading What are the different ways of overloading

What is virtual and override keyword ?

Whats the difference between overloading and overriding ?

Dynamic polymorphism Static Ploymorphism What is a interface

What is the use of interface ?

Point to be remembered for interfaces

can we define public , private acess modifiers in interface ? Do child classes need to implement all the methods of a interface ? Can we create a object of interface or abstract class Abstract and virtual Multiple constructor with parameters

what is a abstract class ?

What are abstract method and non-abstract method ?

Point to be remembered for Abstract classes

Abstract classes and interfaces Can we have static methods in Abstract class ? 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 ? Multiple code level inheritance versioning

operator overloading Delegates create and invoke a delegate

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 overriding Shadowing practice Property indexer 1.1 collection differences

Difference between Array and Arraylist

What is a generic list Generic confined the type Hashtable Stacks and Queues Are there any performance problems with normal .NET collection ?

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

satellite assembly Delay signing Generics What are generic collections / Where have you used generics Does generic improve performance Threading How do we use threading can we set thread priority threading can we stop and suspend Background and foreground thread readonly and constant

What is reflection ? In what scenarios we would use reflection ?

hod o you do reflection What is Serialization ? ASP.NET and Webservices Objects in ASP.NET Autoeventwireup Autoeventwireup IIS , PORTS and Website Application pool concept HttpHandler and httpModules HttpHandler

.ASHX HttpModule

Create a HttpModule

Create a HttpHandler

ASP.NET application and page life cycle

What logic should be written in what events ? What is the difference between render and pre-render ? 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 ? how do we implement Inproc session management in Asp.Net ? Are session variables are local to a user ?

What is a viewstate ? What is difference between viewstate and session variables ? 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 What are server side session management and client side management ? Whats the life of session ? state server

How can we cache a ASP.NET page ? 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 ? Cache whole opage Whole page dynamic and sections of the page is cached Whole page achced and sections of the page is dynamic How can we cache as per location What is a Application and Cache object ? What is the difference between cache and application object ?

What is cache dependency ? If cache dependencies changes does it reload the depedency ? Absolute and sliding what is scavenging ? Postback

Autopostback Ispostback Configuration setting in web.config

Server.transfer and response.redirect Authentication Authorization How do you know the user logged in to ASP.NET system ?

What are different ways of authentication and authorization What is Forms Authentication ?

What does actually a ticket mean ? What is windows authentication ?

What is passport authentication ?

how can we implement Windows authentication ? How can we do Forms Authentication ? 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.NET how 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 ?

Ajax

What is updatpanel

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 datagrid Paging in datagrid SQL Server Database and Tables SQL

self/equi joins Referentrial integrity Normalization

Normalization

Denormalization When should we use normaliztion and denorm Indexes

Balance tree Clustered indexes Non-Clustered indexes When will use a clustered index and not clustered index ? Self join inner join left jon right join cartesian case statements

Select all rows from both tables in group by if we put a column which is not in group what wuill happen cross join / cartesian Stored procedures What is advantage of SP over inline SQL What are triggers ?

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

Functions

Difference between function and stored procedure How to handle errors in Stored procedures Paramters in Stored procedure

profiler

optimzation sql plan sql server locking

SQl injection How can you avoid SQL injection

SSIS SSRS SSAS Difference between delete and truncate ? ADO.NET What are ADO.NET components ? Whats the difference between Dataset and datareader ?

In what scenarios we will use a dataset and datareader ? How do you connect to ADO.NET how do you load a dataset Dataview 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

How do you pass parameters t stored procedures how can you automatically fill command object Datarelation nerge Reporting Where do you get Crystal reports ? How did you create report using crystal reports how 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 remoting Comparison of DCOM and remoting remoting objects life time what is a webservice ? How can we do webservice security UDDI and DISCO What is WSDL ? What is SOAP ? What is difference between Webservice and Remoting

What is Service Oriented Archotecture ? Why WCF ? What is WCF ? What is Address binding Contract ?

What is Service contract , Operation contract and Data contract ? namespace of WCF what's the difference between WCF and Webservices ? What are the different hosting mechanisms of WCf services ? how do host in IIS ? How do you do self hosting ? When should we go for Self hosting and when to go for IIS

What are the important bindings/ BasichttpBinding and WshttpBinding How to secure basichtppbinding

Ho can we do debugging and tracing in WCF

How can we do transaction in WCF ? WCF Security WCF Transport

WCF overloading is it allowed Dynamic polymorphism WCF Duplex WCF message WCF Instancing WCF concurrency WCF REST WCF 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 relation LINQ to SQL Optimization using data load options CRUD example using LINQ Call Stored procedures using LINQ LINQ locking PLINQ LINQ transactions DBML WPF and Silverlight GDI , GDI + and Directx Simple WPF application Rendering in WPF application Architecture of WPF What is silverlight ? Architecture of Silverlight Animation fundamentals in Silverlight

What are different way of silverligjt layoutin.. What are the different ways of binding the silverlight UI with .Net classes and objects ? 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 Silverlight Prism MVVM WWF WWF architecture Composite and leaf activities Sequential and State machine work flow Simple example of WWF State machine work flow Design patterns Which design pattern have yu used ?

Design patterns What are the categories of Design patterns

Factory pattern Abstract Factory Pattern Builder Pattern Prototype Pattern Where is prototype used ? Singleton Pattern How did you implement singleton pattern ? We can achieve the same by cache and application we can achieve the same by using static object Adapter Pattern Bridge Pattern Composite Pattern Decorator Pattern Facade Patetrn Flyweight Pattern Proxy Pattern Mediator Pattern Memento Pattern Interpreter Pattern Iterator Pattern COR Pattern Command Pattren State Pattern Strategy Pattern Observer Pattern Template Pattern Visitor Pattern DIIOCConcept Pattern

What is MVC,MVP and MVVM

How is MVP

Model view controlle

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

How did you translate your requirement to design ? Class Digrams

How do you denote a class diagram in UML ? How to demote public , private and protected in class diagram How do we define relationships in UML

What is composition and aggregation How can denote inheritance ? How can we denote abstract classes and interfaces Object Diagrams Sequence Digrams how did you draw a sequence diagram ? How do you show synchronous and asynch messages Recursive message Conditcion 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 Factor How did you reconcile How did you accommodate SDLC RUP What is Agile How did you do Agile What are the principles in Agile What is Agile SCRUM ?

How does SCRUM process work

When Agile and Waterfall ? How did you code review?

Role of your current project(SDlC)

simplicity your projects

Can you explain the architecture of your current project ? What software process did you follow for your project ? How did you test your project ? How did you do requirement for your project ? technical Design Acceptance How did you do unit testing in .NET ? Summary Speak abt yourself OOPs .net basic asp.net Why Gap ? Differences ( .NET , ASP.NET and SQL Server) HLD and LLD

Key words Partially compiled IL code to machine language So that at run time we can detect the machine configuration , operating system give out optimized 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 Sepcification of the IL code It helps assign the .NET code permission of what they are capable of doing. 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 x` Its a unit deployment ( EXE , DLL) EXE - Self starting , DLL - You have to link it describes more about the assembly ( Meta data):Versioning, References , dependent objects , Security , 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 versioning done here They ensure that the class name is unique to avoid 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 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. You can not avoid it just minimize it Managed Unused objects will be cleaned by this mechanism. As a best practice you do not write any clean up code for managed unused objects. Its run in background No No, GC is smart to figure out unused objects and clean them up You need to write the cleanup in destructor lot of objects created in gen1 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 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.

Yes , GC.Collect They help us to logically group 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. Encapsulation is implemented by using access yes , namespace are logical grouping of classes they Show only what is necessary and its more a thought process and abstraction is implemented by Abstraction is OOPs concept and Abstract classes is half defined classes Abtsraction complement Encapsulation , Encapsulation implements abstraction 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. Parent Constructor fires first and then child. It will qualify with interface name use the sealed keyword Static object has ony instance of the object created through out your application. Create the constructor as private In Singleton pattern Depicts parent child relationship between classes objects will act different in differently under different situation number / types of parameters and depending on different parameters and types the appropriate functions will be invoked. types , order , ref m out do it 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 , to Establish a standard contract/standardization , to decouple classes, dynamic polymorphism( runtime bhevior) ,version , multiple inheritance 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.

No , by default everything is public. Yes No Abstract no implementation and virtual has 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 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. Yes 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.

where you can redefine operators like + , - , * etc with additional functionalitiues. For instance we can redefine the + functionalities to add obejcts like obj1 + obj2. It s a abstract strong typed pointer to a function Declare , Create , point and invoke. Delegate refers via pointers so in case new methods are added or methods name changed we do not need to change at lot of places , dynamic calling of methods on run time. Its also strongly typed. Second - asynch calling and call back of methods 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. For boardcasting to multiple classes When one delegate point to one function its called as 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. This helps to point delegates in a very generic fashion 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. Should avoid Shadowing as far as possible.

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 public class cls where T : String Stores the value as hashed key , good for comparison , but bad in terms inserting valies First in first out and last in first out yes boxing unboxing happens 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 Use Bindingredirect , Oldversion and newversion 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 Yes , type casting is avoided Threading is used to do pararellel execution. Create the thread object , pass the method name using thread start and call the start function. ThreadPriority yes by using thread.start , suspend , stop

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 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 request , response , context , session and application When the request is send to the server from a UI element like button , drop down etc the postback

They are means by which you can inject pre/postprocessing logic before the request reaches the page HttpHandler is extension based processor. Its nothing but Httphandler below , they helps us to display data which does need asp.net pages and thus they improve performance HttpModule is a event based processor 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 http module event ( begin request etc) - httphandlers ( page extensions) - page event (S/ILVER)-http module (end request) 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 by using session object of ASP.NET Yes 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 Securuity 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. 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. Outproc sessions are needed in web farm environment Step 2 : Set