Here’s what I was asked in a second-stage interview for a C#.NET Intermediate-level contract position for a major software company:
1) What is an Anonymous Method and when would you use it ?
[I didn’t know, but mentioned in-line delegates and got points for knowing about those. I said we used it for very simple routines that did not justify a whole method for itself, so can save a few lines of code. They said ‘that’s fair enough’.
2) What is a nullable type ? Are they useful in method signatures ?
[I said not to use them in method sigs as the consumer will be confused as to whether or not to pass a value or not. Better to have an overloaded method for the null case. Interviewer said this was a good answer.
3) What is the difference between String and StringBuilder ?
4) Since strings are immutable, what is the implication for security e.g Passwords ?
5) A user does not have permissions to access a file? How can you give them those permissions
through .NET ?
[I speculated that CASPOL might do it, then said to use anonymous authetication and set permissions on the folder to the anonymous user. They said no, has to be an authenticated user. I said I would just use Windows and give them permission, then said I don’t know how .NET would do it. They said ‘Trick Question. It actually can’t be done in .NET.]
6) What is Reflection and what’s a use for it ?
7) What does this block of code in LINQ do ?
[It was a simple block that grouped an array of numbers according to the Modulus of 5 (i.e. n % 5) then printed out each group and the numbers in that group.
8) In LINQ what does var signify ?
[My answer: an anonymous type]
9) What is an AsyncCallbackDelegate and when do you use it ?
10) Explain protected, internal, public, private.
11) SQL: What is a clustered index ?
12) SQL: What is a primary key ?
13) SQL: What kind of collection does ADO.NET return from a SELECT statement?
14) NUNIT: What class- and method-decoration attributes are available to you and what do they do ?
[I talked about TextFixture, Test, TearDown and SetUp and local Teardown and SetUp]
15) Given this block of code find all the errors and comment on coding style.
[It was a fairly simple FileStream example – unfortunately FileStreams are not my strongest point.]
16) POWERSHELL: What differentiates Powershell from other scripting shells e.g JScript ?
[It returns and processes .NET objects, not text]
17) POWERSHELL: Why is it an advanatge that it doesn’t process text ?
[Text is tedious to Pipe because you have to extract the pieces of information you require by position and length. .NET objects can be processed directly by each chain in the Pipe.]
18) POWERSHELL: What is get-member ? Which .NET technique is it analagous to ?
19) POWERSHELL: What is where-object ?
20) POWERSHELL: What is format-table ?
21) POWERSHELL: What is get-wmiobject ?
22) What is a WebService? How does it work ?
[Exposure of services to heterogenous systems. SOAP over HTTP]
23) What is WSDL ?
24) What is UDDI ?
25) What is the method GetHashCode in relation to object equivalence? What is it used for ?
[Didn’t know this one]
26) What’s the difference beween a.Equals(b) and a == b ?
And So ?
I got most of them and for my reward was required to sit an IKM Knowledge Test. Which I did at Moderate level and got 83 which is 87th percentile all thanks to Google.
So now its up to the reference checks…wish me luck.