| .NET basics | Key words | |
| IL code | Partially compiled | |
| JIT(just in time) | IL code to machine language | |
| Why is ithalf compiled ? | So that at run time we can detect the machine configuration , operating system give out optimized machine compiled code. | |
| CLR | Heart of the engine , GC , compilation , CAS(Code access security) , CV ( Code verification) | |
| CTS | Common data type for different .net languages so that integration is seamless | |
| CLS | Sepcification of the IL code | |
| CAS | It helps assign the .NET code permission of what they are capable of doing. | |
| What has happed for CAS .NET 4.0 ? | ||
| How does the .NET code compile ? | 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 | |
| Managed code | x` | |
| Assembly | Its a unit deployment ( EXE , DLL) | |
| DLL and EXE | EXE - Self starting , DLL - You have to link | |
| Manifest | it describes more about the assembly ( Meta data):-Versioning, References , dependent objects , Security , Scope | |
| how do you do versioning | Assemblyinfo.cs / right click properties -- assembly information | |
| What are strongly typed and weakly typed references ? | 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 | |
| What is DLL Hell ? | versioning done here | |
| what is ref and out ? | ||
| Strong names | They ensure that the class name is unique to avoid confusion | |
| Delay signgin | 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 | |
| sn.exe | ||
| Value and Reference types | 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 | |
| Stack , heap | They are memry types .Stack has value types , heap has reference types | |
| boxing , unboxing | Box - Convert from value to reference , unboxing - reference type to value | |
| Does unboxing and boxing bring down performance ? | yes they do bring down performance because data has to jump between heap and stack memory types. | |
| How can we avoid Boxing and unboxing ? | You can not avoid it just minimize it | |
| Garbage collector | 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. | |
| How does the GC run | Its run in background | |
| Does garbage collector clean unmanaged code ? | No | |
| Do I need to write clean up code for managed objects ? | No, GC is smart to figure out unused objects and clean them up | |
| So what do I do for unmanaged ? | You need to write the cleanup in destructor | |
| What kind of problems do we have with destructors from GC pewrspecticve ? | lot of objects created in gen1 | |
| What are gen0 ,1 and 2? | 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. | |
| Finalize a.k.a destructor | 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 | |
| how to ensure that lot of objects are not created in Gen 1 with class having destructor ? | Implement Idisposable -- Expose a Dispose function -- Call GC.SuppressFinalize | |
| What is Dispose function ? | Its method exposed for clean up for client,Idisposable , Dispose , GC.SuppressFinalize | |
| Finalize and Dispose | 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. | |
| can we force garbage collector | Yes , GC.Collect | |
| What are namespaces ? | They help us to logically group classes. | |
| OOP | ||
| Why do we need object oriented programming ? | 1.No thinking in terms of real world 2. Reusability 3. Extensibility 4 Simplicity and maintainability | |
| Important principles | APIE (OOPs ( Encapsulation , inheritance , Polymorohish and Abstraction)) | |
| How is the reusability problem solved in OOPs ? | Its solved by using classes and creating objects wherever necessary | |
| What is a class and what is aobject | Class -> Blue print , template , Objects -> Bring life in Class , they make them live | Create a simple windows screen , which has supplier name , supplier code , supplier date , button calculate payment date , supplier date + 1 month |
| Encapsulation | Hide the complexity and make your object simple for external world. | |
| How do we implement encapsulation | Encapsulation is implemented by using access modifiers | |
| Can namespace span across DLL | yes , namespace are logical grouping of classes they can span | |
| Abstraction | Show only what is necessary and its more a thought process and abstraction is implemented by encapsulation | |
| Abstraction and Abstract classes | Abstraction is OOPs concept and Abstract classes is half defined classes | |
| difference between Abstraction and Encapsulation | Abtsraction complement Encapsulation , Encapsulation implements abstraction | |
| Private , public , protected etc | 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. | |
| What are constructor and desctructor ? | Constructor(same name as class name with no return type) - initialization purpose , while destructor(~) is for cleaning purpose. | |
| Inheritance parent child which constructor fires first | Parent Constructor fires first and then child. | |
| What is multiple interfaces are implemented | It will qualify with interface name | |
| How to prevent inheriting futher | use the sealed keyword | |
| What is Static classes ? | Static object has ony instance of the object created through out your application. | |
| How to prevent object creation | Create the constructor as private | |
| Where do we use the same ? | In Singleton pattern | |
| Inheritance(:) | Depicts parent child relationship between classes | |
| Polymprphism | objects will act different in differently under different situation | |
| Method overloading | 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. | |
| What are the different ways of overloading | types , order , ref m out … do it | |
| What is virtual and override keyword ? | 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. | |
| Whats the difference between overloading and overriding ? | 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. | |
| Dynamic polymorphism | 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 | |
| Static Ploymorphism | Method Overloading , we call same method with different input parameters | |
| What is a interface | Its looks like a class but has no implementation. It has only empty definition of methods , functions, events , indexer. | |
| What is the use of interface ? | to Establish a standard contract/standardization , to decouple classes, dynamic polymorphism( runtime bhevior) ,version , multiple inheritance | |
| Point to be remembered for interfaces | 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 | |
| can we define public , private acess modifiers in interface ? | No , by default everything is public. | |
| Do child classes need to implement all the methods of a interface ? | Yes | |
| Can we create a object of interface or abstract class | No | |
| Abstract and virtual | Abstract no implementation and virtual has implementation | |
| Multiple constructor with parameters | ||
| what is a abstract class ? | Half defined parent class / base class and child classes provide concrete implementation, like a generalization and specialization | |
| What are abstract method and non-abstract method ? | Abstract method will not have any implementation while non-abstract methd will have implementation they are normal .NET methods | |
| Point to be remembered for Abstract classes | 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. | |
| Abstract classes and interfaces | 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. | |
| Can we have static methods in Abstract class ? | Yes | |
| 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 ? | 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. | |
| Multiple code level inheritance | ||
| versioning | ||
| operator overloading | 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 obejcts like obj1 + obj2. | |
| Delegates | It’s a abstract strong typed pointer to a function | |
| create and invoke a delegate | Declare , Create , point and invoke. | |
| Use of delegate | 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 and interfaces | Delegate is at method level while interfaces are at class and object level. | |
| Multicast delegate(+= , -=) | It helps them to point to multiple functions and execute them sequentially. | |
| Use of Multicast delegate | For boardcasting to multiple classes | |
| What is Unicast ? | When one delegate point to one function its called as unicast. | |
| Events | Events encapsulates(hides) delegates. They are useful for boradcasting , publisher and subscriber | |
| Difference between delegates and events | 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. | |
| Asynchronous delegates | Begininvoke and endinvoke , calls the methods of delegates asynch , for parallel execution. | |
| covariance and contravariance(.net 4.0) | This helps to point delegates in a very generic fashion | |
| Shadowing | It replaces the complete element of the parent class. Like method becomes a variable | |
| Shadowing and overriding | in shadowing the complete elements is replaced and in overriding you only replace the implementaton while the type remains same. | |
| Shadowing practice | Should avoid Shadowing as far as possible. | |
| Property indexer | ||
| 1.1 collection differences | ||
| Difference between Array and Arraylist | 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 | |
| What is a generic list | Strognyl typed list and improves performance by avoiding boxing and unboxing | |
| Generic confined the type | public class cls<T> where T : String | |
| Hashtable | Stores the value as hashed key , good for comparison , but bad in terms inserting valies | |
| Stacks and Queues | First in first out and last in first out | |
| Are there any performance problems with normal .NET collection ? | yes boxing unboxing happens | |
| Regex and validation | Regex is nothing pattern matching and then validating the data using the pattern | |
| GAC | To share the assembly across multiple application in the same computer (C:\WINDOWS\assembly) | |
| how do we register in GAC ? | Give strong name to DLL by click on the signing tab -- second you use thr GACUTIL -I to register the assembly in GAC | |
| If you have different versions ? | Use Bindingredirect , Oldversion and newversion | |
| satellite assembly | 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. | |
| Delay signing | ||
| Generics | Its to increase reusability by seperating logic and data type and its strong typed. | |
| What are generic collections / Where have you used generics | 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 | |
| Does generic improve performance | Yes , type casting is avoided | |
| Threading | Threading is used to do pararellel execution. | |
| How do we use threading | Create the thread object , pass the method name using thread start and call the start function. | |
| can we set thread priority | ThreadPriority | |
| threading can we stop and suspend | yes by using thread.start , suspend , stop | |
| Background and foreground thread | ||
| readonly and constant | ||
| What is reflection ? | BY using System.reflection you can read meta data like properties , methods and also if needed you can invoked the methods and functions dynamically. | |
| In what scenarios we would use reflection ? | technological tools like VS IDE , code reviews tools like Fxcop , unit testing NUNIT etc | |
| hod o you do reflection | 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 | |
| What is Serialization ? | Helps to store in memory object in file and dessrialization means read the value from file and bring it in memory back. | |
| ASP.NET and Webservices | ||
| Objects in ASP.NET | request , response , context , session and application | |
| Autoeventwireup | ||
| Autoeventwireup | When the request is send to the server from a UI element like button , drop down etc the postback happens | |
| IIS , PORTS and Website | ||
| Application pool concept | ||
| HttpHandler and httpModules | They are means by which you can inject pre/post-processing logic before the request reaches the page /gif/html | |
| HttpHandler | HttpHandler is extension based processor. | |
| .ASHX | Its nothing but Httphandler below , they helps us to display data which does need asp.net pages and thus they improve performance | |
| HttpModule | HttpModule is a event based processor | |
| Create a HttpModule | Create a class ,implement IhttpModule, attach events with your methods and register the class in web.config in httpmodule tag | |
| Create a HttpHandler | Create a class implement IhttpHandler , define implementation for processrequest, register the class in web.config with file extensions in httphandler tag | |
| ASP.NET application and page life cycle | environment created(request , response , context) - http module event ( begin request etc) - httphandlers ( page extensions) - page event (S/ILVER)-http module (end request) | |
| What logic should be written in what events ? | 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) | |
| What is the difference between render and pre-render ? | Pre-render event happens just before the HTML is generated while render event happens when the HTML is sent to the browser. | |
| What is a ISAPI ? | ||
| UI controls ( buttong , text box , drop down .. | ||
| why do you need Session ? | HTTP is a statless protocol and in order to remember states during postback we need session variables | |
| how do we do Session management in ASP.NET ? | inproc (session object), outproc ( sql server and state server) | |
| how do we implement Inproc session management in Asp.Net ? | by using session object of ASP.NET | |
| Are session variables are local to a user ? | Yes | |
| What is a viewstate ? | 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. | |
| What is difference between viewstate and session variables ? | Viewstate value is accessed only in the current page while session variables can be accessed in different pages also. | |
| What are the problems with viewstate | Securuity | |
| What is web farm ? | 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. | |
| What is a loadbalancer? | 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 | |
| What is web garden ? | You would like your IIS processes to run on different processors of the machine rather than loading only one processor. | |
| How to implement web garden ? | In the process model tag ( web.config or machine.config) provide the CPU mask value in decimal quivalent of the binary. | |
| Why do we need a outproc session ? | Outproc sessions are needed in web farm environment | |
| How can we do out proc session | 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. | |
| What are server side session management and client side management ? | ||
| Whats the life of session ? | Session time out or when the user closes the browser | |
| state server | aware used for outproc session | |
| How can we cache a ASP.NET page ? | By using the <%@ OutputCache Duration="20" Location="Client" VaryByParam="*" %> | |
| What are the various ways by which you can cache your page ? | Param , Headers , Custom and UserControl. | |
| How can we cache the whole page and sections of the page should be dynamic ? | By using ASP:Substituion ( post cache substituion) | |
| Cache whole opage | outputcache directive at page level | |
| Whole page dynamic and sections of the page is cached | Outputcache directive at usercontrol levele. | |
| Whole page achced and sections of the page is dynamic | Substituion control. | |
| How can we cache as per location | location = server , downstream , client | |
| What is a Application and Cache object ? | They help to create global objects in Asp.Net application. | |
| What is the difference between cache and application object ? | In cache we can define dependency while application objects we can not define depedency. | |
| What is cache dependency ? | you can define 3 kins of dependency file , time and key. If these dependencies change then the cache object becomes null. | |
| If cache dependencies changes does it reload the depedency ? | No Cachdepedency does not have automation , we need to write t he code of refresh and reload. | |
| Absolute and sliding | ||
| what is scavenging ? | ||
| Postback | When your user control sends data to the server postback event happens | |
| Autopostback | 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. | |
| Ispostback | It’s a page property tpo check if the postback has happened or not | |
| Configuration setting in web.config | in the appsettings | |
| Server.transfer and response.redirect | 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. | 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 |
| Authentication | Who the user is? | |
| Authorization | What rights does the user has ? | |
| How do you know the user logged in to ASP.NET system ? | using principal and identity objects which belongs to System.Security namespace. | |
| What are different ways of authentication and authorization | Windows , Forms and Passport | |
| What is Forms Authentication ? | It’s a ticket based authentication . Tickets are passed via URL or stored in cookie file at the user browser. | |
| What does actually a ticket mean ? | 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. | |
| What is windows authentication ? | In this the users are validated from windows local users and groups. | |
| What is passport authentication ? | 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. | |
| how can we implement Windows authentication ? | 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. | |
| How can we do Forms Authentication ? | Authentication mode = forms in web.config file ,FormsAuthentication.RedirectFromLoginPage/Authenticate | |
| what if cookies are diabled in forms authentication ? | Its passed via browser URL. | |
| Single sign on | Single sign on is a concept where you login to one website and it automatically authorizes and authenticates other websites. | |
| How can we implement Single sign on ? | 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 | |
| aspnet membership and roles | 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. | |
| how does ASP.Net membership roles work ?. | 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) | |
| Debugging and Tracing in ASP.NET | 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. | dev |
| how can we do tracing in ASP.NET pages | Trace=true | dev |
| whats the problem with trace=true | our debugging is shown to the end users , so we need to use tracelisteners | dev |
| How can we configure tracelisteners and source ? | In web.config file define your source and listeners , in your code create the trac object and start sending messages(trace.write) | dev |
| What is the namespace ? | It logically groups calsses together | |
| Ajax | 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. | |
| What is updatpanel | Updatepanel is a component which ensures that your server objects become Ajax enabled.It logicall groups them so that only that data is posted. | |
| What is Script manager proxy ? | In Ajax we can have only one scropt manager. But there are condition like master pages where we would need two script manager | |
| Enablepartial rendering | This enables asynchrounous processing | |
| How can we consume webservices in Ajax ? | In Script manager proxy give asp:servicereference and give ASMX path and use javascript to call the objects | |
| What is Jquery ? | Jquery is javascript library to make your javascript development simpler. | |
| Difference between datagrid , datalist and repeater | 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 and datagrid | 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 | |
| Paging in datagrid | ||
| SQL Server | ||
| Database and Tables | ||
| SQL | ||
| self/equi joins | ||
| Referentrial integrity | ||
| Normalization | It’s a database design technique to avoid repetitive data. | |
| Normalization | 3 normal form , 1st normal form Break is Smallest unit , 2nd normal form any repetitive data should be moved to a separate table and forigen key , 3rd normal form Any non key field should not depend on other non key fields of the table | |
| Denormalization | Its combining multiple table data in one table thus avoiding joins for performance imporvement ex - reporting applications | |
| When should we use normaliztion and denorm | Normalization ( integrity , avoide redudant) and denorm ( faster treival , reporting etc) | |
| Indexes | Indexes helps to make your search faster by using balance tree( B tree) concept | |
| Balance tree | 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 | |
| Clustered indexes | The leaf node points to actual data | |
| Non-Clustered indexes | Leaf node points to a pointer and that pointer points to actual data | |
| When will use a clustered index and not clustered index ? | 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. | |
| Self join | ||
| inner join | ||
| left jon | ||
| right join | ||
| cartesian | ||
| case statements | ||
| Select all rows from both tables | SELECT * FROM Customer INNER JOIN CustomerPaid ON Customer.Id = CustomerPaid.Id union SELECT * FROM Customer left JOIN CustomerPaid ON Customer.Id = CustomerPaid.Id union SELECT * FROM Customer right JOIN CustomerPaid ON Customer.Id = CustomerPaid.Id | |
| in group by if we put a column which is not in group what wuill happen | Query will no fire | |
| cross join / cartesian | ||
| Stored procedures | Stored procedures are SQL Server objects which have one or many SQL statements | |
| What is advantage of SP over inline SQL | They are precompiled and thus increases perforance ( parsing , plan and then execution) | |
| What are triggers ? | Trigers are logic which you want to execute insert , delete and update operation on a table | |
| What are types of triggers ? | After trigger ( fires after the operation )and instead of trigger ( before the operation). Operation means insert , update delete | |
| What are inserted and deleted ? | ||
| Functions | It returns a scalar value and is called from stored procedure | declare @count1 int set @count1= dbo.getfunctioncount() print(@count1) |
| Difference between function and 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 | |
| How to handle errors in Stored procedures | using Raiserror function , give message severity and state | |
| Paramters in Stored procedure | input , ouput , return( only one) | |
| profiler | 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 depending on the trace file | |
| optimzation | Create indexes ( balance tree), SQL Plan ( Table scan or Index scan) , SQL profiler and Data tuning advisor for getting suggestion of indexes | |
| sql plan | Describes how your SQL statements will execute. | |
| sql server locking | set isolation level read committed etc etc in stored procedure | |
| SQl injection | 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. | |
| How can you avoid SQL injection | use stored procedures and avoid on the fly SQL concatenation. | |
| SSIS | 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. | |
| SSRS | ||
| SSAS | ||
| Difference between delete and truncate ? | ||
| ADO.NET | ||
| What are ADO.NET components ? | Connection , Command , Dataset , dataadapter , datareader(2C and 3D) | |
| Whats the difference between Dataset and datareader ? | Dataset(back and forth) - works disconnectly , CRUD , reader works connecteldy | |
| In what scenarios we will use a dataset and datareader ? | 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 | |
| How do you connect to ADO.NET | connection , Command , ExecuteNonQuery/ExecuteQuery , use it and close it | |
| how do you load a dataset | connection , Command , Dataadapter , load dataset by Fill method , use it and close it | |
| Dataview | Helps to search, sort filter dataset | |
| Command object methods | Executereader , executenonquery and executescalar | |
| how can we use stored procedure in ADO.Net | ObjCommand.Commandtype = CommandType.Storedprocedure , give the stored procedure name | |
| Wht connection.close | To ensure the SQL Server resources are released | |
| How do you write and read using XML using ADO.Net | readXML , WriteXML function of dataset object | |
| Problems of Locking | Dirty Reads,Unrepeatable reads,Phantom reads and Lost updates | |
| optimistic and pessimistic | Pessimistic means locks are acquired when the record is fetched until the updation and optimisitic means locking is acquired when the data is updated | |
| how can we do optismistic locking in ADO.Net ? | dataset and dataadapter by default supports optimistic locking , timestamp,checking old values and new values | |
| Pessimistic locking | 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). | |
| Scnearios of pessimistic and optimistic | 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). | |
| What is a transaction ? | 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. | |
| how can we implement trans | call begintransaction in connection object , committransaction or rollback, in stored procedure begin tran tr1 and commit tr1 | |
| Connection pooling | Reuse the connection object rather than reusing from scratch.In connection string specify pooling=true | |
| dataset is collection of tables with relationship and recordset has only tables | ||
| How do you pass parameters t stored procedures | Paramater collection of command object | |
| how can you automatically fill command object | Command builder. | |
| Datarelation | ||
| nerge | ||
| Reporting | ||
| Where do you get Crystal reports ? | It’s free available in VS | |
| How did you create report using crystal reports | used RPT file -- Define my data sources -- Finally uses the reportviewer to display the RPT file on the UI. | |
| how to provide inputs to crystal report | By parameter field | |
| Remoting , Webservices and WCF | ||
| What is Appdomain ? | Appdomains make logical boundary / isolation inside a process. Process -- Appdomains(task and application). | |
| What's the advantage of Appdomain ? | If one Appdomain crashes the other Appdomain or the whole process is not closed / terminated. | |
| What is the use of remoting ? | 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. | |
| How do you create a remoting object ? | 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". | |
| Problems with remoting | Client and server can be only in .NET language , complicated, Faster than other remoting technologies, pick and choose Channel and formatter ( customization) | |
| Comparison of DCOM and remoting | ||
| remoting objects life time | ||
| what is a webservice ? | Webservice is a technology by which you can expose your business functionality on HTTP using SOAP XML format. | |
| How can we do webservice security | specify windows , passport , forms and pass credentials through the client proxy object | |
| UDDI and DISCO | Helps to search and discover your webserbvice from the UDDI directory | |
| What is WSDL ? | It’s a meta data which shows what are the methods , properties , datatypes exposed by a service | |
| What is SOAP ? | It’s a XML protocol which is defined how your service and client communicate. | |
| What is difference between Webservice and Remoting | Webservice(Cross language , only Http) , Remoting ( only .NET platform , Any protocol) | |
| What is Service Oriented Archotecture ? | 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 | |
| Why WCF ? | It was to satisfy SOA principles of WS-* specification. | |
| What is WCF ? | WCF = Webservices + remoting + COM plus + MSMQ | |
| What is Address binding Contract ? | Address - where is it hosted , Binding - how is the protocol , Contract - what is the interfcae | |
| What is Service contract , Operation contract and Data contract ? | Service contract - Service name , Operation contract - Your methods and functions , data contract - Custom data type , data member - property and functions of your data contract | |
| namespace of WCF | System.ServiceModel | |
| what's the difference between WCF and Webservices ? | Webservices = WCF - ( remoting( multiple protocols) + COM plus ( transactions) + MSMQ(queueing)) | |
| What are the different hosting mechanisms of WCf services ? | IIS , Self hosting or WAS server | |
| how do host in IIS ? | By suing the SVC file we can host our service on IIS | |
| How do you do self hosting ? | Create object of Service host , provide Address ( Uri) , Binding ( Wshttpbinding) , Contract ( Interface) and open the host. | |
| When should we go for Self hosting and when to go for IIS | Http go for IIS ( we getready made features like always running , process recycling,security,ssl etc), For other protocols go for self hosting | |
| What are the important bindings/ | 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) | |
| BasichttpBinding and WshttpBinding | basic is plain text while Wshtpp is encrypted | |
| How to secure basichtppbinding | use SSL on webservices | |
| Ho can we do debugging and tracing in WCF | 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 | |
| How can we do transaction in WCF ? | 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. | |
| WCF Security | Transport , message and transport + message | |
| WCF Transport | SSL , Specify in config file https in address tage , Specify security mode and install SSL in your WCF services | |
| WCF overloading is it allowed | [ServiceContract] interface ICalculator { [OperationContract(Name="AddIntegers")] int Add(int a,int b) [OperationContract(Name="AddDouble")] double Add(double a,double b) } | |
| Dynamic polymorphism | ||
| WCF Duplex | ||
| WCF message | ||
| WCF Instancing | Per call , persesion and single instance | |
| WCF concurrency | Single , Multiple , Rentrant | |
| WCF REST | Helps to expose your WCF service via simple HTTP get and post | |
| WCF integration | ||
| LINQ and EF 4.0 | ||
| What is LINQ | It’s a OR mapper technology ,2 important use 1 - BO , DAL and Mapping , 2 - General Queries which can fired on any data store. | |
| What is a Entity class | It’s a Business object which has mapping with the data store. | |
| What is data context | It’s the data connection layer to load the entity object with data | |
| How do we declare 1 to many and 1 to 1 relation | Entity set for 1 to many and entity ref for 1 to 1 | |
| LINQ to SQL | ||
| Optimization using data load options | ||
| CRUD example using LINQ | insertonsubit , deleteonsubmit , submitchanges | |
| Call Stored procedures using LINQ | Using the function attribute | |
| LINQ locking | ||
| PLINQ | PLINQ executes two linq queries parallely | |
| LINQ transactions | By using the transaction object of data context class | |
| DBML | Database markup language | |
| WPF and Silverlight | ||
| GDI , GDI + and Directx | ||
| Simple WPF application | WPF is for creating windows application , the user interfaces can be represented using XAML and it uses directx internally. | |
| Rendering in WPF application | ||
| Architecture of WPF | ||
| What is silverlight ? | It’s a plugin which runs inside the browser. It can run on cross platform and cross browser. | |
| Architecture of Silverlight | ||
| Animation fundamentals in Silverlight | ||
| What are different way of silverligjt layoutin.. | Stack panel ( one above another ),Canvas ( we specify left and top), Grid ( If you want layouting using table structure , rows and columns) | |
| What are the different ways of binding the silverlight UI with .Net classes and objects ? | One way ( UI to BO), two way( UI <-> BO) and one time( BO to UI). | |
| In what scenarios you will use what ? | One time binding - reports , Transaction screens two way , Pure input screen one way. | |
| How can we connect froom Silverlight to SQL Server | By using WCF services. | |
| Why not directly ? | Because silverlight is a plugin which is a downsized version .NET framework and it does not have system.data | |
| Consume WCF service in Silverlight | WCF service should have client access policy and cross domain , from silverlight you need to call the data asynchrounously | |
| Database operations using Silverlight | 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 | |
| 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 ? | So pick your best pattern corelate it with your project and speak about it. Share global fdata | |
| Design patterns | Design patterns are tried and tested solutions for design problems in our project. | |
| What are the categories of Design patterns | Creational , Structural and Bheviorial | |
| Factory pattern© | Centralizes creation of object in a class and passing back a interface reference to the client. Main use is decoupling( UI - BO - DAL).(Creates an instance of several derived classes ) | |
| Abstract Factory Pattern | Abstract Factory groups Factory patterns. | |
| Builder Pattern | ||
| Prototype Pattern | ||
| Where is prototype used ? | Audit trail , differences of objects , cancel and revert | |
| Singleton Pattern | Helps to create one instance of the object. | |
| How did you implement singleton pattern ? | Create a class with private constructor and define your object as static and expose it | |
| We can achieve the same by cache and application | Its technology specifc and not a generalized solution | |
| 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 | DI helps to inject depedent objects in to a class. DI injection can be implemented by Unity app block / Windsor castle | |
| What is MVC,MVP and MVVM | These are GUI architectural pattern with only one intention of seprating the UI Logic , state and synchronization in to a separate class. | |
| How is MVP | 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 | |
| Model view controlle | 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 | |
| MVP and MVC | 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 | |
| When to use these patterns | 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 | UML is a modelling language which helps us to document and design our software application. | |
| Use Case Diagrams | Its helps us to document "What" of the system from user point of view. | |
| What does use case have normally ? | Use cases are task having scenarios and Actor executing those scenarios | |
| How did you document your requirement ? | 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 | |
| What are primary actors and secondary actors ? | 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. | |
| In which format did you gather your uses cases | Company Template in word document | |
| How did you show relationship n uses cases | By Extend and include | |
| How did you translate your requirement to design ? | 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 Digrams | Class diagrams shows the static structure of project. They help us visualize the classes and relationships between them | |
| How do you denote a class diagram in UML ? | 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 | |
| How to demote public , private and protected in class diagram | (+) Public , (-)Private , (#) protected , internal | |
| How do we define relationships in UML | by multiplicty (1-*) | |
| What is composition and aggregation | 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. | |
| How can denote inheritance ? | Empty traingle arrow key. | |
| How can we denote abstract classes and interfaces | {} - Abstract classes , <<>> - Interfaces | |
| Object Diagrams | ||
| Sequence Digrams | Object diagrams over a period of time. | |
| how did you draw a sequence diagram ? | The objects in rectangle on the top side -- message by arrows and object life time vertical rectangles. | |
| How do you show synchronous and asynch messages | Synch by dark arrow and asynch by thin arrow key | |
| Recursive message | By small rectangle in a big rectangle | |
| Conditcion | Inside Square bracket | |
| Message branching | By two rectangles with condition and branching arrows from the same. | |
| Collaboration Diagrams | It shows the same information as sequence diagram but the emphsais is more on messages than life time of the objects | |
| Activity Diagram | Activity diagrams depicts complex flow of a system | |
| Parallel processing , partionting and conditions | Shows by dark bar , Swimlanes for partitioning , Diamond is for 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 | Agile is a principle which means accept changes | |
| How did you do Agile | Used SCRUM | |
| What are the principles in Agile | Accept changes , Interaction with customer , people , working code | |
| What is Agile SCRUM ? | Scrum is a methodology to implement agile | |
| How does SCRUM process work | 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 | |
| When Agile and Waterfall ? | Water fall - requirement is fixed , Agile -- If requirements will change or evolve.( Time to market) | |
| How did you code review? | Mostly automation and the process | |
| Role of your current project(SDlC) | 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. | |
| simplicity your projects | The applicaton was a integrator between indian chemical companies and EICA to provide certifications for Indian chemical companies as per EICA standards | It’s a internal ATM management system in ASP.NET which has various functionalities creating Contracts , Customer report , hand bills , Scheduling etc. |
| Can you explain the architecture of your current project ? | 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. | |
| What software process did you follow for your 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. | |
| 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 | 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 testing Load test startergy POC :- Proof of concept LLD Overall detail architecture diagram Class diagrams , Object diagrams , Sequence / Collaboration , DB design In depth test stratergy Psedu-code |
24x7 Freelancer
Friday, February 24, 2012
.net Interview Questions and Answers
Subscribe to:
Posts (Atom)