🔒 Locked
Weird Programmer Test
Advertisement
Original Post
So, I'm taking a programmer's test for a job, and right now I'm on a part where they describe the specifications for a function that I need to write/extend.. the entire description of the function is made up of compiler-ready C++ syntax (i.e. the structures they want me to use are structs and they have pre-defined functions that I need to use in my main function), and it all seems simple enough, but when I get down to the bottom of the spec it says this: << Do NOT(!) use "C++" syntax. Use good programming practice, as much as these instructions allow. >> What the hell? Do they want me to write the function in pseudo-code? Perhaps in C? (I've never actually written anything in C, just C++, so if 'C++ Syntax' means something like, don't use STL, etc, I wouldn't know..) What do you guys think this wants me to do?
Quote:
Original post by ferr
So, I'm taking a programmer's test for a job, and right now ...
Did they allow you to ask questions about their test online? [grin]
Really, you need to ask them what they mean. It could be that they are only testing your willingness to ask questions about stupid, irrational, or incomplete questions.
Joel on Software, guerrilla Guide to Interviewing: Ask the candidate to design a house. Don't tell them that "this is a house for a family of 48-foot tall blind giraffes." If they don't ask for more details, they fail the test.
Quote:
...the entire description of the function is made up of compiler-ready C++ syntax (i.e. the structures they want me to use are structs and they have pre-defined functions that I need to use in my main function)
This may sound strange, but you did say you have not written any C. Is there a reason you think it uses "...C++ syntax...", why are the structures C++ and not C. ie is there inheritance etc?
I think they mean "don't use Java syntax". I.e. use object oriented programming where sane, not object obsessed programming.
Quote:
Original post by dmail Quote:
...the entire description of the function is made up of compiler-ready C++ syntax (i.e. the structures they want me to use are structs and they have pre-defined functions that I need to use in my main function)
This may sound strange, but you did say you have not written any C. Is there a reason you think it uses "...C++ syntax...", why are the structures C++ and not C. ie is there inheritance etc?
Yes, that was my point exactly when I noted I hadn't written in C before. I don't exactly know the differences between the two. I've been programming in C++ for about 7 years now, and I don't think I've ever seen the source of an actual C project (or maybe I did and didn't know it.)
I won't share the actual questions, but I will give an idea of what syntax they use in the spec:
Quote:
typedef struct {
int numberrrr;
int anotherNumberrrr;
} someNumberrrrs;
int getSomeNumberrrrs(void);
someNumberrrrs * getNextSomeNumberrrrs(void);
Quote:
Original post by ferr
I won't share the actual questions, but I will give an idea of what syntax they use in the spec... *snip*
Man that's eww. I take it back - they mean "pretend we're still in C". I usualy follow other's coding standards when working on their projects, but for something like that it makes me feel like I'm following a dodo. Better to jump ship!
Quote:
Original post by ferr
Yes, that was my point exactly when I noted I hadn't written in C before. I don't exactly know the differences between the two. I've been programming in C++ for about 7 years now, and I don't think I've ever seen the source of an actual C project (or maybe I did and didn't know it.)
Over-simplified. To get C from C++ remove:
Classes (i.e. you cannot have functions inside structs, no constructors, no destructors)
STL (i.e. you cannot use std::string, std::vector, etc)
*_cast (i.e. no static_cast, dynamic_cast, etc)
remove new/delete (i.e. use malloc/free)
-me
Quote:
Original post by Palidine
Over-simplified. To get C from C++ remove:
Classes (i.e. you cannot have functions inside structs, no constructors, no destructors)
STL (i.e. you cannot use std::string, std::vector, etc)
*_cast (i.e. no static_cast, dynamic_cast, etc)
remove new/delete (i.e. use malloc/free)
Also -
- Declare all function-scope variables at the entry of the function.
- NO TEMPLATES OMFG.
- struct keyword does not define a type.
- NO POLYMORPHISM OMFG.
- You can't reuse the bullet.
- NO BOOST OMFG.
Or something, that's just what people told me. C makes me want to cry ;_;
Quote:
NO POLYMORPHISM OMFG.
You can do polymorphism in C OMFG. You just can't do runtime polymorphism with inheritence and virtual functions OMFG, you have to use some other mechanism like type switching OMFG or function tables which is what your C++ compiler uses to implement virtual functions anyway OMFG. Also compile time polymorphism is pretty limited; the best you get are macros, and you can't specialize them, so it's not really polymorphic, it's just sorta generic.
I wrote something in C just the other day! It was the first time I ever wrote in C. It sucks!
Quote:
Original post by dmail
What C sucks or you code? before you answer just think what linux kernels ...etc are written in.
Knowing Deyja, "it sucks!" wasn't meant as an absolute declaration of truth but was more akin to the statement "Tomatos SUCK!". i.e. an expression of personally relative opinion.
don't start a C v. C++ flamewar bitches! =)
-me
Quote:
What C sucks or you code?
Both! Heck, not only did I use a horrible recursive-decent menuing system design, but I used naked defines and a GOTO! It was for the C++ Workshop project, and it made jwalsh mad. He said I was 'missing the point of the workshop'. Yeah, as if I was learning from it. Sheesh.
Oh, er, no. C does not suck. I think every programmer should be required to learn how to create their high level OOP stuff in a language like C. It can only make them better programmers. And, hell, it's not even all that hard. But given the choice, or if I wasn't just trying to be an ass, C++ wins.
[edit]
I'm LMAO off right now. Wish I could tell you why. :)
[/edit]
[Edited by - Deyja on August 23, 2006 4:47:06 PM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement