.NET Technical Check & Tuneup Senthil Kandasamy [email_address]
Today's Topics <ul><li>Standard Technical vetting </li></ul><ul><li>Uncommon Problems & common answers </li></ul><ul><li>'...
Warm Up Questions <ul><li>Is “string” value or reference type? </li></ul><ul><li>It is a reference type. string is an alia...
Rapid Fire Round <ul><li>Why Generics? </li></ul><ul><li>Allows to design class or method that defer the specification of ...
The very Basics (Not Visual Basic) <ul><li>Can delegates added to invocation list be changed? </li></ul><ul><li>NO </li></...
Dot Net Framework <ul><ul><li>What is the difference between private and shared assembly </li></ul></ul><ul><ul><li>Access...
I PC <ul><li>Which one of the following correctly initializes the ThreadStart object myStart? </li></ul><ul><li>    1    T...
<ul><li>Whyhow to do multithreading? </li></ul><ul><ul><ul><li>To compute operations in parellel. </li></ul></ul></ul><ul>...
<ul><li>What happens when an Object is serialized? </li></ul><ul><ul><ul><li>Name of class, assembly and data members </li...
<ul><li>What are different formatter that can be used in Serialization? </li></ul><ul><ul><li>BinaryFormatter, XmlFormatte...
<ul><li>  </li></ul><ul><ul><li>How Do I Serialize Generic Types? </li></ul></ul><ul><ul><ul><li>Presently, .NET  does not...
<ul><li>Where forwarding event happens in ASP.NET? </li></ul><ul><ul><ul><li>A GridView control can contain one or more bu...
It Depends <ul><ul><li>What happens when we add an assembly to a client? </li></ul></ul><ul><ul><ul><li>It depends, privat...
<ul><li>Do static constructor need in a class? </li></ul><ul><ul><ul><li>It depends, Performing the constraint verificatio...
<ul><li>Which parser is best for reading XML Document </li></ul><ul><ul><li>It depends, XMLReader, XMLTextReader, XMLValid...
<ul><li>Cross-Page versus Server.Transfer </li></ul><ul><li>Cross-Page posting </li></ul><ul><ul><li>Posts current page in...
<ul><li>How to: Determine How ASP.NET Web Pages Were Invoked </li></ul><ul><li>Examine the values of the following  Page  ...
<ul><li>OleDbParameter param = new OleDbParameter(); param.SourceVersion = DataRowVersion.Proposed; </li></ul><ul><li>Unde...
Things to Avoid When Throwing Exceptions <ul><ul><ul><li>Should not change the flow of the process </li></ul></ul></ul><ul...
Threading  <ul><ul><ul><li>Static state must be thread safe. Avoid syncronization for instance variables. </li></ul></ul><...
Version behavior in Serialization <ul><ul><ul><li>Never remove a serialized field. </li></ul></ul></ul><ul><ul><ul><li>Nev...
Software Design Principles
Open - Closed Principle <ul><ul><ul><li>Object should be  open for extension  but  closed for modifications </li></ul></ul...
Single Responsibility Principle <ul><ul><ul><li>Object should have only  one  reason to change </li></ul></ul></ul>
Dependancy Inversion Principle <ul><ul><ul><li>Both high and low level modules should  depend on abstractions , not on eac...
Liskov's Substitution Principle <ul><ul><ul><li>Derived types must be  completely substitutable  for their base types </li...
Interface Segregate Principle <ul><ul><ul><li>Clients should not be  forced to depend  upon interfaces that they don't use...
Books I Read <ul><li>  </li></ul>
Boston User Groups <ul><li>(...I Attend) </li></ul><ul><li>Boston .NET Certification Group  http://tech.groups.yahoo.com/g...
10 Commandments - Summary <ul><ul><li>Join LinkedIn </li></ul></ul><ul><ul><li>Participate in community activities </li></...
Questions for me?
Upcoming SlideShare
Loading in …5
×

How to ace your .NET technical interview :: .Net Technical Check Tuneup

5,183
-1

Published on

This session is just not a brain dump of a technical interview on Microsoft technologies. It will be refresher on various pieces of the .NET, Database, OO, Process world. It will serve as a caution for interviewers to red flag their questions which are circulated on the webdom. For all the inquisitive and MCP certified brains, this will serve as a ‘whodunnit’ challenge. It will be a useful reference for the rest of us. The talk is divided into four sections. We will cover the typical BrainBench type questions to start with. Then we will attack the common problems encountered on the field and ideal solution paths to each of them. Third part will be about architectural trade-offs and ‘it depends’ scenarios. Finally, there will be discussion on best practices, books needed for interview preparation and open Q&A among the participants.

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,183
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
122
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • This session is just not a brain dump of a technical interview on Microsoft technologies. It will be refresher on various pieces of the .NET, Database, OO, Process world. It will serve as a caution for interviewers to red flag their questions which are circulated on the webdom. For all the inquisitive and MCP certified brains, this will serve as a ‘whodunnit’ challenge. It will be a useful reference for the rest of us. The talk is divided into four sections. We will cover the typical BrainBench type questions to start with. Then we will attack the common problems encountered on the field and ideal solution paths to each of them. Third part will be about architectural trade-offs and ‘it depends’ scenarios. Finally, there will be discussion on best practices, books needed for interview preparation and open Q&amp;A among the participants.
  • Equality operators == AND != confusing. 2The System.Array type offers several static and instance members. Since all arrays are implicitly derived from System.Array, these members can be used to manipulate arrays of value types or reference types. You&apos;ll also note that Array implements several interfaces: ICloneable, IEnumerable, ICollection, and IList. These interfaces allow arrays to be conveniently used in many different scenarios. Figure 2 summarizes the methods offered by System.Array and the interfaces that it implements. Casting Arrays Passing and Returning Arrays Fast Array Access 3. Nullable types are of struct which is a value type stored in stack. 4. Nullable types allow underlying value types.
  • 2. IsGenericTypeDefintion method is used. Calling GetType on a Nullable type causes a boxing operation to be performed when the type is implicitly converted to  Object . Therefore  GetType  always returns a  Type  object that represents the underlying type, not the Nullable type.
  • 1 Delegates are immutable; once created, the invocation list of a delegate does not change. 2. once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block 3. Finally block that follows a try block will get executed
  • 3. Used to check the run-time type of an object is compatible with a given type.
  • Tasks in the back ground. Requests are processed asynchronously Returns to queue of waiting threads.
  • 1. are stored in the file. 3. Object that implements ISerializable interface or class decorated with [Serializable] can be serialized.
  • 1. The workaround is to perform a single run-time check before any use of the type, and abort the use immediately, before any damage could take place. You can place the run-time verification in the static constructor.
  • If the Cli
  • If a parent class has set “rules” on behavior, than the child must adhere to those “rules” for their behavior as well. Therefore, if the child is filling in for the parent, no behavior would be in violation of the “rules” defined by the parent. This is assuming the child is a good little boy or girl. Now with that picture in your head, let’s go back to our little “Animal Walking” business. Animal is the “parent” class in this example and has set behaviors: Eat(Food), Sleep(Hours) and Walk(Pace). This will mean that all “child” classes will need to implement these behaviors and have an appropriate post condition. As you can see in the example, the Dog is a little more lax in the food department. However, the Cat can only restrict its diet to the IFood interface. Restricting food any further would violate Liskov’s Substitution Principle because it would require the calling class to know about each animal’s behavioral differences. The Cat’s Sleep(Minutes) method is an example of this. The Cat class could not be substituted for the Animal class because it restricts the caller more than expected. Because the Cat class expects minutes (under the hood) instead of hours, the caller will not pass the proper parameters and the system will suffer accordingly. This principle also states that output cannot be restricted any further than the constraints made by the parent class. Therefore, if the output from the Eat() method is a percentage of how hungry the animal remains, then a child could not output the amount of time it took to finish the meal. This would confuse the user and in turn violate LSP. Output must not violate the constraints of the parent and user of the class must not be confused by the output as well.
  • How to ace your .NET technical interview :: .Net Technical Check Tuneup

    1. 1. .NET Technical Check & Tuneup Senthil Kandasamy [email_address]
    2. 2. Today's Topics <ul><li>Standard Technical vetting </li></ul><ul><li>Uncommon Problems & common answers </li></ul><ul><li>'it' Depends: Real Life Issues </li></ul><ul><li>What do you read is what you are! </li></ul>
    3. 3. Warm Up Questions <ul><li>Is “string” value or reference type? </li></ul><ul><li>It is a reference type. string is an alias of String </li></ul><ul><li>Is int[] counter is a value or reference type? </li></ul><ul><li>Arrays are intrincically derived from System.Array. </li></ul><ul><li>Is Nullable types are value or reference type? </li></ul><ul><li>All nullable types are of Type System.Nullable<T> struct </li></ul><ul><li>Is it possibe to define a variable of type </li></ul><ul><li>Nullable<Nullable<int>> number; </li></ul><ul><li>int ?? number; </li></ul>
    4. 4. Rapid Fire Round <ul><li>Why Generics? </li></ul><ul><li>Allows to design class or method that defer the specification of one or more types until used by client. </li></ul><ul><li>Avoids Boxing and Unboxing (Performance) </li></ul><ul><li>Avoids Runtime exceptions (type safety) </li></ul><ul><li>Better programming (Code reuse) </li></ul><ul><li>What type would return if “is” operator is used on </li></ul><ul><ul><ul><li>List< int > counterList = null; </li></ul></ul></ul><ul><li>Underlying type will be returned not the Nullable type. </li></ul>
    5. 5. The very Basics (Not Visual Basic) <ul><li>Can delegates added to invocation list be changed? </li></ul><ul><li>NO </li></ul><ul><li>Does delegates are invoked once for each time they appear in the invocation list? </li></ul><ul><li>Yes it does. </li></ul><ul><li>Can multiple catch blocks be executed?   </li></ul><ul><li>No. </li></ul><ul><li>Can return statement in try block make finally block called? </li></ul><ul><li>Yes. </li></ul>
    6. 6. Dot Net Framework <ul><ul><li>What is the difference between private and shared assembly </li></ul></ul><ul><ul><li>Accessibility by applications. </li></ul></ul><ul><ul><li>Shared assembly has to be Strong Named, have version and culture. </li></ul></ul><ul><ul><li>Installed in GAC.  </li></ul></ul><ul><ul><li>What does Reflection do? </li></ul></ul><ul><ul><li>Runtime type discovery </li></ul></ul><ul><ul><li>Load Assemblies </li></ul></ul><ul><ul><li>Dynamic Invocation </li></ul></ul><ul><ul><li>What is an &quot;IS&quot; operator? </li></ul></ul><ul><ul><li>Equiv of Type </li></ul></ul>
    7. 7. I PC <ul><li>Which one of the following correctly initializes the ThreadStart object myStart? </li></ul><ul><li>   1    ThreadStart myStart = new ThreadStart(); 2    ThreadStart myStart = new ThreadStart(myThread); </li></ul><ul><li>     3    ThreadStart myStart = new ThreadStart(DoSomething()); 4    ThreadStart myStart = new ThreadStart(DoSomething); </li></ul><ul><li>     5    ThreadStart myStart = new ThreadStart(this); </li></ul><ul><li>How to achive synchronization in .NET? </li></ul><ul><li>Using lock(object) statement for the critical section. </li></ul><ul><li>What is Thread Pool? </li></ul><ul><li>Collection of threads </li></ul>
    8. 8. <ul><li>Whyhow to do multithreading? </li></ul><ul><ul><ul><li>To compute operations in parellel. </li></ul></ul></ul><ul><ul><ul><li>  By acquiring threads from ThreadPool class .  </li></ul></ul></ul><ul><ul><li>When you call the Thread.Start method on a thread, will it start immediately? </li></ul></ul><ul><ul><ul><li>That thread does not start executing until the current thread yields or is preempted by the operating system. </li></ul></ul></ul>
    9. 9. <ul><li>What happens when an Object is serialized? </li></ul><ul><ul><ul><li>Name of class, assembly and data members </li></ul></ul></ul><ul><li>What are the two format types that XMLSerializer generates in Web Service? </li></ul><ul><ul><ul><li>Litteral (RPC style) and encoded (SOAP) </li></ul></ul></ul><ul><ul><ul><li>Both can be handled in by applying attributes like SoapElementAttribute and XMLElementAttribute </li></ul></ul></ul><ul><li>Can SqlConnection object be serialized? </li></ul><ul><ul><ul><li>NO. </li></ul></ul></ul>
    10. 10. <ul><li>What are different formatter that can be used in Serialization? </li></ul><ul><ul><li>BinaryFormatter, XmlFormatter, SoapFormatter </li></ul></ul><ul><li>What is the new tool that is introduced in .Net 2.0 for creating an XML serialization assembly? XML Schema Definition Tool (Xsd.exe)  </li></ul><ul><li>What is an Object Graph?  </li></ul><ul><li>An object model that is neither cyclic nor a tree. </li></ul><ul><ul><li>How to: Catch a non-CLS Exception? </li></ul></ul><ul><ul><li>Within a catch block type the exception as RuntimeWrapperException </li></ul></ul>
    11. 11. <ul><li>  </li></ul><ul><ul><li>How Do I Serialize Generic Types? </li></ul></ul><ul><ul><ul><li>Presently, .NET does not provide a mechanism for constraining a generic type parameter to be serializable. </li></ul></ul></ul><ul><ul><li>What happens when an invoked method throws exception in Multicast Delegate? </li></ul></ul><ul><ul><ul><li>If an invoked method throws an exception, the method stops executing, the exception is passed back to the caller of the delegate, and remaining methods in the invocation list are not invoked. Catching the exception in the caller does not alter this behavior. </li></ul></ul></ul>
    12. 12. <ul><li>Where forwarding event happens in ASP.NET? </li></ul><ul><ul><ul><li>A GridView control can contain one or more buttons created dynamically by templates . </li></ul></ul></ul><ul><li>How can an  ASP.NET  application deployed in server farm? </li></ul><ul><li>Externalize the Session State </li></ul><ul><li>We know ViewState what is ControlState? </li></ul><ul><ul><li>Property that allows you to persist property information that is specific to a control and cannot be turned off </li></ul></ul>
    13. 13. It Depends <ul><ul><li>What happens when we add an assembly to a client? </li></ul></ul><ul><ul><ul><li>It depends, private assembly local copy gets created. Shared assembly with public key do not. </li></ul></ul></ul>
    14. 14. <ul><li>Do static constructor need in a class? </li></ul><ul><ul><ul><li>It depends, Performing the constraint verification in the static constructor is a technique applicable to any constraint that you cannot enforce at compile time. </li></ul></ul></ul><ul><li>Can this custom object public class Employee{ private String _name;} stored in  ASP.NET Session? </li></ul><ul><ul><ul><li>It-depends, if in-process  yes. if out-of-Process the objects has to be serializble </li></ul></ul></ul>
    15. 15. <ul><li>Which parser is best for reading XML Document </li></ul><ul><ul><li>It depends, XMLReader, XMLTextReader, XMLValidatingReader, XPATH, XMLDocument   </li></ul></ul><ul><li>Will setting AutoPostBack property to true - do postback? </li></ul><ul><ul><ul><li>It depends, if client side script is turned on. </li></ul></ul></ul><ul><li>How to do cross-page posting in ASP.NET? </li></ul><ul><li>This can be done by configuring individual controls </li></ul>
    16. 16. <ul><li>Cross-Page versus Server.Transfer </li></ul><ul><li>Cross-Page posting </li></ul><ul><ul><li>Posts current page information to the target page. </li></ul></ul><ul><ul><li>Makes post information available in the target page. </li></ul></ul><ul><ul><li>Requires user initiation. </li></ul></ul><ul><ul><li>Redirects to any page, not just pages in the same Web application. </li></ul></ul><ul><ul><li>Enables the target page to read public properties of the source page if the pages are in the same Web application </li></ul></ul><ul><li>Server.Transfer </li></ul><ul><ul><li>Transfers control to a new page that renders in place of the source page. </li></ul></ul><ul><ul><li>Redirects only to target pages that are in the same Web application as the source page. </li></ul></ul><ul><ul><li>Enables you to read values and public properties from source page. </li></ul></ul><ul><ul><li>Does not update browser information with information about the target page. Pressing the refresh or back buttons in the browser can result in unexpected behavior. </li></ul></ul>
    17. 17. <ul><li>How to: Determine How ASP.NET Web Pages Were Invoked </li></ul><ul><li>Examine the values of the following Page class properties </li></ul><ul><ul><li>IsPostBack </li></ul></ul><ul><ul><li>PreviousPage </li></ul></ul><ul><ul><li>IsCrosssPagePostBack </li></ul></ul><ul><ul><li>IsCallBack </li></ul></ul><ul><ul><li>What is adaptive Rendering? </li></ul></ul>
    18. 18. <ul><li>OleDbParameter param = new OleDbParameter(); param.SourceVersion = DataRowVersion.Proposed; </li></ul><ul><li>Under what circumstances does specifying the SourceVersion affect the behavior of a parameter attached to a command? </li></ul><ul><li>1 Only when bound to a data adapter as an DeleteCommand </li></ul><ul><li>2 Only when bound to a data adapter as an InsertCommand </li></ul><ul><li>3 Only when bound to a data reader </li></ul><ul><li>4 Only when bound to a data adapter as an SelectCommand </li></ul><ul><li>5 Only when bound to a data adapter as an UpdateCommand </li></ul>
    19. 19. Things to Avoid When Throwing Exceptions <ul><ul><ul><li>Should not change the flow of the process </li></ul></ul></ul><ul><ul><ul><li>Should not be returned as return value or passed in as parameter instead of being thrown </li></ul></ul></ul><ul><ul><ul><li>Do not create exceptions that can be thrown in debug mode but not release mode. To idventify run-time errors during the development phase, use Debug Assert instead </li></ul></ul></ul><ul><ul><ul><li>Do not throw System.Exception, System.SystemException, System.NullReferenceException, System.IndexOutOfRangeException intentionally from your own source code. </li></ul></ul></ul>
    20. 20. Threading <ul><ul><ul><li>Static state must be thread safe. Avoid syncronization for instance variables. </li></ul></ul></ul><ul><ul><ul><li>Don't use Thread.Abort to terminate other threads.  </li></ul></ul></ul><ul><ul><ul><li>Use Mutex </li></ul></ul></ul><ul><ul><ul><li>Don't control the execution of worker threads from your main program  </li></ul></ul></ul><ul><ul><ul><li>Avoid Deadlock Race Condition </li></ul></ul></ul><ul><ul><ul><li>Performance consideration </li></ul></ul></ul>
    21. 21. Version behavior in Serialization <ul><ul><ul><li>Never remove a serialized field. </li></ul></ul></ul><ul><ul><ul><li>Never apply the  NonSerializedAttribute  attribute to a field if the attribute was not applied to the field in the previous version </li></ul></ul></ul><ul><ul><ul><li>Never change the name or the type of a serialized field. </li></ul></ul></ul><ul><ul><ul><li>When adding a new serialized field, apply the  OptionalFieldAttribute  attribute. </li></ul></ul></ul><ul><ul><ul><li>When removing a  NonSerializedAttribute  attribute from a field (that was not serializable in a previous version), apply the  OptionalFieldAttribute  attribute. </li></ul></ul></ul><ul><ul><ul><li>For all optional fields, set meaningful defaults using the serialization callbacks unless 0 or  null as defaults are acceptable </li></ul></ul></ul>
    22. 22. Software Design Principles
    23. 23. Open - Closed Principle <ul><ul><ul><li>Object should be open for extension but closed for modifications </li></ul></ul></ul>
    24. 24. Single Responsibility Principle <ul><ul><ul><li>Object should have only one reason to change </li></ul></ul></ul>
    25. 25. Dependancy Inversion Principle <ul><ul><ul><li>Both high and low level modules should depend on abstractions , not on each other </li></ul></ul></ul><ul><ul><ul><li>Details should depend on abstractions not the other way </li></ul></ul></ul>
    26. 26. Liskov's Substitution Principle <ul><ul><ul><li>Derived types must be completely substitutable for their base types </li></ul></ul></ul>
    27. 27. Interface Segregate Principle <ul><ul><ul><li>Clients should not be forced to depend upon interfaces that they don't use </li></ul></ul></ul>
    28. 28. Books I Read <ul><li>  </li></ul>
    29. 29. Boston User Groups <ul><li>(...I Attend) </li></ul><ul><li>Boston .NET Certification Group http://tech.groups.yahoo.com/group/bostondotnetcertification/   </li></ul><ul><li>Boston .NET Architecture Study Group http://tech.groups.yahoo.com/group/boston_dotnetarchitecture/ </li></ul><ul><li>New England ASP.NET Professionals User Group http://neasp.net/   </li></ul><ul><li>New England SQL Server User Group http://www.nesql.org/default.aspx   </li></ul><ul><li>Beantown.NET User Group http://beantowndotnet.org   </li></ul><ul><li>Boston .NET User Group http://www.bostondotnet.org/ </li></ul>
    30. 30. 10 Commandments - Summary <ul><ul><li>Join LinkedIn </li></ul></ul><ul><ul><li>Participate in community activities </li></ul></ul><ul><ul><li>Answer questions in user groups </li></ul></ul><ul><ul><li>Attend Monthly meetings </li></ul></ul><ul><ul><li>Get Certified - Brainbench; MCPD/MCTS; OCA/OCP </li></ul></ul><ul><ul><li>Blog - Book Reviews; Knowledge dumps; Obscure Bugs  </li></ul></ul><ul><ul><li>Twit Regularly on all of the above </li></ul></ul><ul><ul><li>Commit to a Passion </li></ul></ul><ul><ul><li>Play some games - Get an Avatar </li></ul></ul><ul><ul><li>Don't do any of the above - Just Relax & do a codeplex project! </li></ul></ul>
    31. 31. Questions for me?
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×