views:

196

answers:

8

I just got offered a job interview with short notice. Tomorrow morning I'm interviewing for a positions which has C# as a required proficiency. The position is a co-op position and I'm fairly certain the company understands that incomming students will probably have very limited, if any, experience in C# especially because the local college does not offer a class in it (that's not to say people can't learn it on the side, but something to keep in mind).

I will make sure it is known that I have not used C# before, but my question is this: Given what I know (listed below) what topics specific to C# should I learn that are unique to the language or perhaps drastically different from many other languages?

Languages that I feel at least comfortable with are:

  • Ada
  • C
  • C++
  • Java
  • Objective-C
  • Python
+2  A: 

C# is very close to Java, so you mostly need to learn in in terms of the differences.

Try this article.

Steven Sudit
That goes up as far as C# 2. C# has changed a lot since then. It now feels - to me, anyway - like a *very* different language to Java.
Jon Skeet
@Jon: I freely admit that the article is not comprehensive, but I think it's good enough to leverage their existing Java knowledge. The stuff since 2.0 is, I hope, considered advanced enough that it won't be a deal-breaker for a work co-op position.
Steven Sudit
C# and Java programs are written in extremely different styles, due to the differences between the two languages. Iterators, reference parameters, lambda forms, LINQ and related concepts lead to C# programs that look very different to (and are much smaller than) equivalent Java programs. In short, it doesn't matter how many similarities you can point to; it's the differences that count.
Marcelo Cantos
@Marcelo: I'm sorry, but I can't agree with that. The most notable thing about C# from the POV of a Java programmer is how incredibly similar the two languages are. It would be fair to say that C# is simply MS's idea of Java-done-right.
Steven Sudit
@Steven: Most C# programmers have a very different perspective on this, and find Java programming to be a frustrating experience. This is a common issue for Java programmers coming to C#, because they don't understand why C#'s additional features make such a difference and consequently they tend to stick to Java coding style.
Marcelo Cantos
@Marcelo: Yes, it's very easy to tell when C# code has been written by someone who mostly knows Java. It's not just that they stick to C# 2.0 features, but that their C# fails to be idiomatic.
Steven Sudit
A: 

Java is your closest, and a lot of the stuff you know there will be directly applicable to C#.

The syntax is similar, and the concepts behind it are similar, such as automatic memory management, intermediate language etc.

There are obviously a few subtle differences, but if you read up on something like 'C# for Java Programmers' you should be pretty primed.

Michael Shimmins
A: 

Learn why C# is different - namely the CLR.

Preet Sangha
Well, the CLR is not that different from the JVM. I think the biggest change, outside of syntax, is the common library.
Steven Sudit
Yes that's right - the difference is really c#/Java and the rest
Preet Sangha
+1  A: 

In under 24 hours, there is very little you can learn about C# that would convince an interviewer that has even a slight clue that you know the language. Focus on brushing up on your own strengths (e.g.: solve some interesting algorithm problem in some language you know).

If you really want to cram, read an overview.

I understand the desire to impress with at least some smidgeon of knowledge, and it certainly can't hurt to be able to say that you've started looking into it. But as an interviewer, one of the first questions I ask is what languages the candidate is familiar with, and then proceed on that basis. I don't question them on what they know of languages they haven't used, because I know that anything they've picked up online will be superficial and largely useless in the day-to-day process of writing code. Instead, I focus entirely on a demonstration of the skills they possess in whatever language they are comfortable with. Of course, that's just my style and I can't guarantee tomorrow's interviewers will have same viewpoint. But I still think that, as a basic guiding principle, you should always play to your strengths.

With regard to language similarities, don't pay any attention to the advice that Java and C# are similar, and most certainly do not make such a claim in an interview for a C# job. While the languages may be superficially similar, with many features in common, C# has numerous modern language features that Java lacks (iterators, lambda forms, LINQ, struct, properties, expression objects, reference parameters, indexers, etc.). This leads to wildly different programming styles.

Marcelo Cantos
I'm not looking to be able to tell them I know C#, it would be a lie. What I would like to tell them is that I've begun to look at the language and I believe I can pick it up quickly if needed.
Shynthriir
As a C# programmer, I have no trouble reading Java code and understanding what it does. The reverse is true, so long as the code does not make too much use of advanced features. Simply knowing what the direct C# equivalents of Java keywords and types are is enough to get you a long way.
Steven Sudit
+1  A: 

The most important thing is not C# itself, which you should have no trouble with, but the .Net framework itself.

MikeAinOz
A: 

They will probably ask you about all the keywords, like what does sealed mean? When do you override? Tell me what static is... What's the app.config used for...

But they really want you to say you have experience with SQL server, ASP, winforms, and WPF... since you're a student you probably don't have that kind of experience, but that's what they want.

iterationx
+4  A: 

Since its a coop position, and you know java, they most likely won't ask many questions that are specific to C#. Most likely they will ask two types introductory type of questions - 1) programming concepts, and 2) algorithm questions

1) for programming concepts, questions like:
- object oriented programming concepts (polymorphism, abstraction, interfaces etc)
- what is the difference between public/private methods
- how to write accessor methods in C#
- what does immutable mean
- when to use regular strings vs StringBuilder

2) for algorithm question, almost all tech coop employers ask some variation of:
- how do design an algorithm to reverse a string, using a buffer and/or no buffer (eg: in place)?

This is generally good advice.
Steven Sudit
+1  A: 

Here's what I'd focus on for a job interview.

Many companies picking up C# developers are taking them from a market where a large number have programmed in VB. A lot of companies - particularly those funding Agile or Lean projects, where the cost of change needs to be kept low - prefer to hire Java developers. The Java community has a larger open-source base, a tendency to program with smaller classes and better adherence to the SOLID principles, and know how to write unit tests, acceptance tests and use design patterns appropriately and effectively.

Things you already know:

  • JUnit -> NUnit
  • Generics -> Compile-time Generics
  • Java library -> NLibrary.NET (Spring.NET, Selenium.NET, NHibernate, etc.)

New things worth picking up:

  • Delegates*
  • Lambdas*
  • Linq*
  • WPF or Silverlight (almost the same thing) - basic Xaml is interesting, fast to code, creates a lovely dynamic MVC pattern and fails almost silently (you get output warnings)

(*) These are why I prefer C# to Java these days... Microsoft platforms aside...

Things which you know about because of Java / wide language exposure and they might** not:

  • Resharper (IntelliJ's refactoring shortcuts in Visual Studio)
  • REST
  • MVC (Winforms doesn't lend itself to this; WPF does)
  • Git / Mercurial
  • How to write clean, maintainable code.

(**) I said might not already!

Good luck with the interview!

Lunivore