Testing Times

3 Comments December 7, 2006

I'm sitting the 70-536 (Microsoft .NET Framework 2.0 – Application Development Foundation) exam tomorrow, and I sincerely hope that it's of a higher quality than the learning materials Microsoft provide for it. I've been testing myself using the official MCTS 70-536 Training Kit, and running the example tests provided.

What's disconcerting is that some of the questions are just plain wrong; here's an apposite example:

Which of the following code samples is the most efficient and compiles correctly?

  1. string s = null;
    s = "Hello";
    s += ", ";
    s += "World";
    s += "!";

  2. string s = null;
    StringBuilder sb = null;
    sb = "Hello";
    sb += ", ";
    sb += "World";
    sb += "!";
    s = sb.ToString();

  3. string s = null;
    StringBuilder sb = null;
    sb.Append("Hello");
    sb.Append(", ");
    sb.Append("World");
    sb.Append("!");
    s = sb.ToString();

  4. string s = null;
    s = "Hello";
    s += ", ";
    s += "World";
    s += "!";

So what's the correct answer? Not only do we have two identical options (1 and 4), but they also happen to be the only ones that will compile and execute. 2 is wrong because StringBuilder doesn't accept the "=" or "+=" operators, and 3 also shares the problem that the StringBuilder is never instantiated. Guess which option the test exam says is correct?

Can't say it fills me with much confidence for tomorrow...


3 Comments

  • Gravatar Image
    Ben Hall December 8, 2006 11:50 AM

    If I am right, the training kit uses PrepLogic which I have found to be a bit odd with some questions. Personally, I use www.measureup.com

  • Gravatar Image
    Ed December 8, 2006 11:54 AM

    Thanks for that Ben, I'll look that up the next time I've got to sit an MS exam.

  • Gravatar Image
    Mohamed Ramadan January 7, 2007 8:26 AM

    have you pass4sure for exam 70-536? Eng_MR@Hotmail.Com