10

I have been asked to go for a technical test/evaluation for a job as a junior developer, mainly using C++. This is my first test/evaluation, and it is 2 hours long.

My C++ is a bit rusty as I have been doing projects recently on PHP.

This is a UK company, however im guessing technical testing of candidates will be pretty much the same everywhere.

What should I expect in one of these tests?

1

8 Answers 8

5

It's C++, so you can expect anything, I mean REALLY anything.

Usually that involves trick questions, and some sort of polymorphism questions.

But could be something simple as well.

Be ready to answer a question on something like "why would you make a destructor virtual", what's "volatile", "design a class" for some unrealistic problem, "implement a linked list", "reverse a string", etc.

1
  • I woud add "What is the mutable keyword used for?" to the anything category.
    – Tom
    Oct 27, 2011 at 13:09
5

If this is a pure C++ test (i.e. not a Windows/MFC/Managed C++ test), then spend a few hours or a day with Scott Meyer's Effective C++ and you should do very well. It does not cover templates and the STL, but if they were interested in that, they probably wouldn't be giving you a two hour test. It's been some years, but I used to interview C++ developers frequently. Even though the ideas in Effective C++ are fundamental to C++ programming, only about ten percent of the candidates knew them.

2
  • 1
    +1 for book recommendation - and skip Scott Meyer's More Effective C++ Book. When I used to interview programmers, I'd also be looking at intellectual honesty (do you try and bluff or do you admit you don't know), do you know what you don't know, and do you know where to find an answer. (If interviewing somebody claiming to have been working in C++, the questions would be far harder). If there wasn't anything suggesting programming skills in other languages in your CV, I'd also be asking you to write a simple program, and look at whether you covered the corner cases correctly.
    – MZB
    Sep 4, 2011 at 3:35
  • I am a computing graduate, I was taught how to do programs in the console in C++ , I was taught up to implementing Binary Sort Trees, and doubly linked lists etc. Then we were also taught there on Abstract Classes, Inheritence and Polymorphism but not how to implement them. The job role is for a graduate, so I dont know what they expect from me, because I have no real working life experience of C++.
    – bearbread
    Sep 4, 2011 at 10:22
4

Well it depends on wether or not they'll let you use google. :P

I usually do pretty good in technical tests, so long as I can use the tools around me. When they want me to code blind its when I get in trouble. So the best advice I can give you is code blind at home... Make sure you remember trivial stuff we take for granted because we can check them easily if we don't remember.

Also, usually the check for especific skills they need, so if you know what you'll be working on, concentrate on that.

(This is in my general experience, I am not from the UK)

4
  • What about theory , polymorphism, inheritence. I only know the theory for that from just graduating but i do not know how to implement it in C++
    – bearbread
    Sep 2, 2011 at 14:15
  • Their implementation is not that hard, you can probably review them very quickly. The important part is knowing when it is apropiate to use them, when you are going to need it. They are more a functional pattern than an actual prerequisite. What I mean is that you can get away without using them, but would be expected of you to know them if need be.
    – AJC
    Sep 2, 2011 at 14:25
  • @bearbread: theory itself doesn't worth much. read about design patterns and try to implement them. Sep 2, 2011 at 14:28
  • I know design patterns like MVC for PHP, is that what you mean?
    – bearbread
    Sep 2, 2011 at 14:31
1

Practice code kata Pick a simple algorithm (ring buffer, Hanoi tower, binary search, whatever) and code it from scratch. Then do it again the next time, and the next time, and the next time, and the next time, and so on. Look at how you can improve them at each iteration.

1
  • 1
    +1. Also do it with a friend who is a bit more experienced. Take turns to program, you'll both learn something new.
    – Tom
    Oct 27, 2011 at 13:11
0

It's true you can expect anything.

They told you the test was C++ but maybe it is really the C subset of C++ they use in their tests (you'll use char arrays instead of standard library strings). This will be hard to know.

If it's really C++, I would advise you to see the basics:

  • Classes, variables, arrays
  • references, pointers (and why you should not use them by default)
  • the usage of the const keyword
  • Oriented Object concepts ( inheritance, polymorphism ... )
  • Templates

then:

  • Standard library usages ( std::string, std::vector, containers, ... )
0

What has been posted has been great so far, but I'll add something and a story! I would say practice applying what you know in C++ to problems in the domain of the software company. It's great if you know all the ins and out of C++ but if you can't apply to a problem, you're useless to the company. Seeing as this is a junior dev position, I wouldn't think they would expect you to know everything about C++.

I took my first technical test for my first developer job last week and was surprised at what I found. I was expecting something like FizzBuzz or something more nitty gritty (this was for Java, btw) but what I found was they gave me a file and had me parse it to a new format, which is what part of the job was. On top of that, they let me use Google and their own libraries. Bottom line, you need to know C++ but if you want to know what the test may be like, take a look at the domain of the position you're applying for and work on implementing C++ towards something in that domain.

1
  • I would guess that < 1% of the C++ programmers know everything of the language :) Just take all the cases of undefined/unspecified/implementation-defined behavior as one example.
    – user29079
    Oct 27, 2011 at 13:39
0

Are you:

  1. Writing code
  2. taking multiple choice
  3. In person interview

When writting code

They will expect you to know (and use):

  • RAII
  • The Rule of three
  • Understand smart pointers

They will probably test you on:

  • Inheritance
  • Virtual functions
  • Serialization to/from a stream
  • overload the arithmetic operators (not often used in real life but easy to write a test around).

If you are unlucky they may think

  • Multiple inheritance and virtual base classes is something you should know.
    • Its not but some people go hog crazy.

When taking multiple choice

  • Understand all the OO terminolgy
  • Know the C++ ways of implementing OO

In Person Interview

  • All the above.
  • Knowledge of recursion
  • How to convert recursion into a loop
  • How to estimate Big O() complexity
  • The standard sorting algorithms (not just bubble).
5
  • 1
    I'm a C programmer rather than C++, so I don't know the talk... but I've never heard of RIAA and the rule of three. I have however heard of RAII (resource acquisition is initialization, ie your destructor should clean up its own mess) and I do know that if your code needs a copy ctr, overload assignment operator or a destructor, it needs all three of them. It would seem to me that an interview that's a cheesy trivia in programming slang rather than a test of your skills, says something bad about the company.
    – user29079
    Oct 27, 2011 at 13:27
  • 1
    And equally, if they ask about multiple inheritance and recursion, I would assume that their code base is a big mess. If they expect you to know all common sorting algorithms out of the blue, how to do recursion unrolling, object serialization etc, it also says something bad about the company. Don't they expect their devs to robots? In the real world you look such things up before using them. Even if I do know the theory behind all those things, I would still look them up, just to make sure I use the optimal solution rather than something so-so I came up with myself.
    – user29079
    Oct 27, 2011 at 13:34
  • @Lundin: You don't need to know the silky names but you do need to know the principles, by mentioning them here it makes it easy to look up. You need to know the sorting algorithms because you need to know which one to use and when (and more importantly why) (things robots can't do but humans do very well). Oct 27, 2011 at 14:42
  • There is nothing inherently wrong with recursion or multiple enheritance. The problem is with developers over using it (and doing it incorrectly). Some problems can only be solved (easily) using recursion (parsing a tree structure depth first). Oct 27, 2011 at 14:45
  • @Lundin: See devblog.seomoz.org/2011/10/679 Oct 29, 2011 at 7:40
-1

I got in my last interview:

Difference between passing an object to a function by value/reference/pointer and where and why you would do that.

Swap the 2 last 8 bits of an integer eg RGBA to RGAB.

What's RIAA?

Define template meta programming: you might get a question in terms of "solve this problem with TMP.."

What's mutable, volatile, const etc etc etc mean? know all keywords.

multiple inheritance.... again again and again.

Multi threading: Producer consumer and buffered shared memory objects.

A few more periphery questions:

UML aggregation and composistion

Design patterns : implement a singleton... What are the common components of MVC?

Not the answer you're looking for? Browse other questions tagged or ask your own question.