Samuel’s HQ

A french/american blog with some hungarian spices…
  • rss
  • Home
  • Resume
  • photoblog
  • Contact Me

alphabet version 3

May 19, 2007 | 6:32 pm

Third answer to my alphabet question:

#include <stdio.h>
 
void main ()
{
    char Array[26] = { 'a', 'b', ... 'z'};
 
    int i;
 
    for (i = 0; i <= 26; i++)
    {
        printf(%c\\n, *Array[i]);
    }
    exit;
}
 

Download this code: alphabet_3.c (140 hits)

There is no typo in the transcript. What do you think? Is my question ‘too hard’? Is it not ‘appropriate’ for a ‘C’ developer position?

Comments
1 Comment »
Categories
Alphabet Interview, English

Comments rss Comments rss
Trackback Trackback

alphabet version 2

May 18, 2007 | 4:34 pm

Second answer… again, there is no typo, this is the pure transcript of the candidate’s answer.

main(argc, argv[])
{
    int i = 0;
    char a[26] = { 'a', 'b', 'c', ...'z'}
 
    for (i = 0; i <=26; i++)
    {
        printf("%d/n", a[i]%);
    }
    return;
}
 

Download this code: alphabet_2.c (121 hits)

With this question, I’m realizing that array usage in C, is clearly not clear for everyone.

Comments
1 Comment »
Categories
Alphabet Interview, English

Comments rss Comments rss
Trackback Trackback

alphabet version 1

May 17, 2007 | 5:32 pm

First answer to my alphabet question (154 hits):

void printAlphabet(void)
{
    char a[21];
 
    for (i = 0; i <26; i++)
    {
        if (i == 0)
        {
            a[i] = 'a';
        }
        else
        {
            a[i] = a[i - 1]++;
        }
    }
    a[26] = '\\0';
    printf("alphabet %s\\n", a);
}
 

Download this code: alphabet_1.c (113 hits)

This might print the alphabet… but it will crash… I recopy the program as is… there is no typo from my side.

After this question, I asked more questions on how to use array in C. This person was terribly confused on how to use array in C.

Comments
4 Comments »
Categories
Alphabet Interview, English

Comments rss Comments rss
Trackback Trackback

My Alphabet question for interview

April 18, 2007 | 12:01 am

Part of my job is to sometimes give interviews for people we want to hire. One of my favorite question is to ask the person to write a problem that will print the alphabet on the console. So let’s say I have a c file my_program.c, I want to be able to compile it, execute, and get the alphabet on the console. Something like: $./my_program
a
b
c
...
z

I really like this question as I think it’s easy enough to know if the person is able to write a simple program in C. I will post here the several code I got… and sometimes it’s really surprising.

What do you think about the question? Do you think it’s a dumb question? Is it too hard/easy?

Comments
2 Comments »
Categories
Alphabet Interview, English, geeky

Comments rss Comments rss
Trackback Trackback

Navigation

  • English (75)
    • Alphabet Interview (4)
    • fun (5)
    • geeky (15)
    • general (28)
    • perso (1)
    • read on the web (9)
    • Skydiving (8)
    • vim (1)
  • Francais (18)
    • Geeky Linux fr (1)
    • general (15)
  • music (1)
  • photos (3)
  • video (3)

Tags

datacenter food hacking info health makerfaire office photoblog photo productivity quote san francisco security software spam ted tip tip of the day word

My Bookmarks

  • Chojin’s Quarter
  • Happycoders
  • Kamih’s Blog

My websites

  • My Flickr gallery
  • My Gallery
  • My photoblog: Exposure for fun

Archives

  • November 2009 (1)
  • June 2009 (2)
  • May 2009 (1)
  • April 2009 (1)
  • March 2009 (3)
  • November 2008 (2)
  • August 2008 (1)
  • July 2008 (1)
  • June 2008 (1)
  • May 2008 (1)
  • April 2008 (2)
  • March 2008 (3)
  • February 2008 (1)
  • January 2008 (2)
  • December 2007 (3)
  • November 2007 (5)
  • October 2007 (9)
  • September 2007 (3)
  • August 2007 (5)
  • July 2007 (6)
  • June 2007 (3)
  • May 2007 (11)
  • April 2007 (9)
  • January 2007 (2)
  • May 2006 (1)
  • March 2006 (3)

From my Google Reader

Live Photos

www.flickr.com
Samuel's photos More of Samuel's photos

Tools


  Subscribe in a reader


View Samuel Pasquier's profile on LinkedIn

rss valid xhtml 1.1 design by jide powered by Wordpress