1. It can't be done in place due to immutable type, and if you give it as 
array of chars then Array.Reverse(...);
5.
MatchCollection matches = Regex.Matches(samplestring,@"((.)\2*)");
string longestrun = string.Empty;
foreach (Match match in matches) {
  if (match.Length > longestrun.Length) {
    longestrun = match.Value;
  }
}

Yet this won't tell you anything about the developer, because the pattern 
"((.)\2*)" is what does all the work and that's obtained by 30 seconds on 
google.

In my opinion do something like brainbench to test their syntax knowledge.
Get them to write the FizzBuzz program (or equivalent) to weed out those who 
can't even read requirement specs.
Then spend some time with a real world problem.

The problem with low level questions in C# is that the framework solves 
pretty much every low level problem. For example the correct answer to a 
question on how would you create a linked list would be "new 
LinkedList<object>".

What's left to test is their ability to deconstruct problems into manageable 
chunks and their thought process in doing this, and in my opinion the best 
way is to take a problem the company itself has had to solve and give it to 
the applicant.

If you can't give them real world problems, second best may be something 
like:
Given a list of words/sentences write a program to identify those that are 
anagrams of a specified word/sentence.
Given a list of words, write a program to identify those that are 
palindromic.


----- Original Message ----- 
From: "Mark Nicholls" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, September 21, 2007 12:47 PM
Subject: [ADVANCED-DOTNET] interview test.....


> OK...I know this isn't really a problem with dotnet....but I couldn't
> think of a better place to ask...
>
> I've got to interview some people for the position of a junior
> programmer....'Joel' test for C programmers would be one of
>
> 1. Reverse a string in place
> 2. Reverse a linked list
> 3. Count all the bits that are on in a byte
> 4. Binary search
> 5. Find the longest run in a string
> 6. atoi
> 7. itoa
>
> does anyone have some reasonable ones in C#?
>
> 3 seems a bit irrelevant.
> 2,4,6 and 7 seem a bit pointless in something like C#....they're 1 line
> methods.
>
> that leaves me with 1 and 5...
>
> Is there a simple way to short cut these tests in C#?...it would be
> pointless me setting a test only to find it was trivial...or required a
> trick....rather than demonstrating ability.
>
> ===================================
> This list is hosted by DevelopMentorĀ®  http://www.develop.com
>
> View archives and manage your subscription(s) at 
> http://discuss.develop.com
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.487 / Virus Database: 269.13.27/1020 - Release Date: 
> 20/09/2007 12:07
>
> 

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to