Thread: I helped create this < 2 minute multiple choice C Test and would love some feedback!

  1. #1
    Registered User
    Join Date
    Jan 2014
    Location
    Boston
    Posts
    2

    Red face I helped create this < 2 minute multiple choice C Test and would love some feedback!

    Hi everyone!

    So here at my job we create and distribute multiple choice quizzes that assess various user skills in < 2 minutes, and we really want to make our tests as balln' as humanly possible.


    We start off writing our tests with a few experts or professionals in a skill and then build them up with questions submitted by our users themselves. This gives our tests awesome agility, range, and flexibility, but also opens the doors to a little misinformation.


    With that in mind I'd be beyond appreciative if some folks 'in the know' here would take a few minutes to quickly run through our C test and answer a few questions to make sure the quality is up to snuff.


    Even just taking the test will help us figure out what questions are too hard or too easy, but if you'd like to go above & beyond you can leave a comment explaining exactly what you feel about a specific question.

    If you're interested you can find the test here: C Test - Smarterer


    DISCLAIMER: You DO have to sign up for the website with an email or social media account, but I promise we don't send off any spam. Honestly, if you see any sort of email you don't want I'd be happy to take care of it myself ([email protected]) I know can often be a deal breaker, so I won't be offended if you're not into signing up.

    Again I'd be super appreciative of any help, but only if you'd like to give it.


    Thanks!

    -- Joe

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well the first couple of questions are OK, then you get this one badly wrong.
    Code:
    What is the output of the following program: 
    #include<stdio.h> 
    int main(){ 
      for(int a=0; a<=3;a++); 
      printf("%d",a); 
      return 0;
    }
    
        Wrong method for loop.
        Wrong place for semicolon so compile error.
        4
        Program will not execute.
    The correct answer is that it won't compile.
    Code:
    $ gcc -Wall -std=c99 bar.c
    bar.c: In function ‘main’:
    bar.c:4:15: error: ‘a’ undeclared (first use in this function)
    bar.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
    The reason being that the scope of a ends with the stray ; at the end of the loop, so there is no a in scope to printf.


    The question on rounding floats makes no account of negative numbers, or the possibility of numeric overflow.


    The question on "what does malloc do" is wrong on so many levels.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    Is anyone else as shocked as I am that Salem took the time to fill in an, probably fake, email address or social media account?

    Scary stuff...

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  4. #4
    Registered User
    Join Date
    Jan 2014
    Location
    Boston
    Posts
    2
    Quote Originally Posted by Salem View Post
    Well the first couple of questions are OK, then you get this one badly wrong.
    Code:
    What is the output of the following program: 
    #include<stdio.h> 
    int main(){ 
      for(int a=0; a<=3;a++); 
      printf("%d",a); 
      return 0;
    }
    
        Wrong method for loop.
        Wrong place for semicolon so compile error.
        4
        Program will not execute.
    The correct answer is that it won't compile.
    Code:
    $ gcc -Wall -std=c99 bar.c
    bar.c: In function ‘main’:
    bar.c:4:15: error: ‘a’ undeclared (first use in this function)
    bar.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
    The reason being that the scope of a ends with the stray ; at the end of the loop, so there is no a in scope to printf.


    The question on rounding floats makes no account of negative numbers, or the possibility of numeric overflow.


    The question on "what does malloc do" is wrong on so many levels.
    Cool, thanks so much!

    I think the malloc question was submitted by one of the Smarterer users and then somehow slipped past the quality checks. I'm probably just going to trash it completely.

    I really (really, really) appreciate the help, Salem!

  5. #5
    Registered User
    Join Date
    Mar 2012
    Location
    the c - side
    Posts
    373
    I guess that makes Salem smarterer - er.

  6. #6
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,791
    Are you able to just paste the questions here? I really don't feel like signing up to a website just to look at some C questions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 10-03-2013, 03:27 PM
  2. Replies: 8
    Last Post: 04-11-2013, 09:19 PM
  3. Minute to hour/minute conversion program
    By Remius in forum C Programming
    Replies: 7
    Last Post: 12-29-2007, 08:39 AM
  4. New feedback/help chat test
    By Betazep in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 12-09-2001, 11:27 PM

Tags for this Thread