1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Jobs for physics PhD's / At what point can you claim to know C++ ?

  1. Oct 12, 2013 #1
    Jobs for physics PhD's / At what point can you claim to "know C++"?

    I am a year away from graduating my HEP PhD and I'm thinking about what comes next. Postdoc is an obvious option, but the impression I get from this site and elsewhere is that it's a short-sighted one. I'm therefore thinking about what else I can do, what I've got to offer in other fields/careers.

    My PhD has almost solely involved working with C++, but whilst I am no rookie at this point, I am by no means an expert either. I had sat one C++ based module as an undergrad but by the time I started my PhD, almost all had been forgotten and I was essentially learning it from scratch. Furthermore, my PhD has been about doing what I need to with C++ to get physics results, not about getting a broad knowledge of the language for its own sake.

    I'm comfortable with the basic machinery of it - well-versed in terms in terms of the syntax, the use of loops, arrays, functions, structures, vectors, I can de-bug what I write, but I know there must be so much more to it that I am unfamiliar with. For example, despite understanding what a pointer is since they appear in all the "beginners" literature, I have never used one in any practical application. Or say I was asked in an interview the meaning/use of "istringstream" or to explain "inheritance", I would be unable to.

    What I'm hoping for here is for someone to sum up what you would expect an applicant for a C++ based job* to know. OR, can I apply for C++ -based jobs assuming employers will take me on assuming that I can pick up what I need as I go along?

    I'm also considering starting to learn another language in my spare time, but I do not know which one and welcome any suggestions.


    * a job that a HEP physics graduate might typically apply for, eg. quantitative analyst has crossed my mind.
    Last edited: Oct 12, 2013
  2. jcsd
  3. Oct 12, 2013 #2
    So I've had to craft some technical questions for interview, and one of the questions I always ask for people who claim knowledge of an object oriented language is to give a brief description of inheritance. That seems high-level enough that you should probably have some idea what that means. I try to avoid asking about specific classes.

    Your best bet is probably to describe the projects you have done with C++ in your resume, and bring example code you've written to the interview. That will give the interviewer something to focus on.

    You might want to consider looking at data mining/analyst jobs, where a HEP experiment knowledge of statistics will be highly useful, and you can try to steer the interviewers to numerical/statistical questions.
  4. Oct 12, 2013 #3


    User Avatar
    Gold Member

    I would absolutely expect anyone claiming knowledge of C++ to have a solid understanding of C, particularly including pointers. For C++ itself, I would definitely expect a sold understanding of all of the OO concepts including inheritance.

    ParticleGrl's suggestion of
    is a very good one.
  5. Oct 12, 2013 #4
    I'd like to hear as many of these interview questions as you can be bothered to write out?
  6. Oct 12, 2013 #5

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    I disagree. What you are talking about is what I call C±; others call it "C with classes". They are both intentionally derogatory names. A good C++ programmer will eschew the use of raw pointers. This is particularly so with C++11.

    Aside: C++11 is a rather different language than the C++ from a decade ago (C++98/03).

    Some things I would expect anyone who claims to know how to program in C++:
    • What is inheritance? How does it work in C++?
      If the interviewee answered this at well I would ask about the rule of three (rule of five in C++11). If they answered this well, I'd ask about throwing an exception in a destructor, when a destructor should be declared virtual, and how to write a good copy constructor and assignment operator.
    • A spacecraft takes 500+ commands. This was implemented as a switch statement with 500+ cases. How would you write this to avoid the switch statement?

    Getting back to the original post, you asked two very different questions, Doofy: "When can you claim to 'know' C++?", and "What level of programming knowledge is needed for a technical (e.g. quantitative analyst) position?"

    When I interview someone for an avionics position I expect strong knowledge of computer programming and of C++. Acronym check: I'll ask about RTTI, RAII, and maybe SFINAE. I'll also ask about generic (non-C++) concepts such as deadlock and priority inversion.

    When I interview someone for an aerospace engineering position, I know from experience that most aerospace engineers have not learned how to program. They might have learned how to sling tiny bits of code, and only in Matlab. The few who do know C++ at all are worth a lot. The very, very few who know aerospace engineering upside down and who know C++ beyond the C± are golden.
  7. Oct 12, 2013 #6
    Here are paraphrases of some questions I used recently:

    1. If I tell you class X inherits from list, what do I mean? What would it look like to implement that in C++?
    2. You find yourself modifying the destructor for class X, what other important class functions should you look at?
    3. If I gave you a large data set consisting of (standard insurance stuff), and asked you to predict (feature of standard insurance stuff), what would your approach be? What if features A &B were strongly correlated?
    He suggested he would first do a random forest model, and I asked him lots of questions about how to pick out variable importance from a random forest. I also asked about pruning decision trees, etc.

    We also went through some code he provided, and I asked about his choice of random number generator in a monte-carlo algorithm, and I asked for a high level overview of the parts of the code he didn't write.
  8. Oct 12, 2013 #7
    I imagine "know C++" means very different things depending on the type of job you're applying for. At my current job, just my ability to make simple Python/Matlab scripts to do calculations, make graphs, process text files, etc. is considered "knowing how to program."

    I think the best policy is to just be honest. Definitely put your C++ ability on your resume because it might enough for what some employers are looking for (I would probably say "have experience with C++" and then detail exactly what that experience was). Different jobs require different levels of programming ability, and you don't want to miss out on a job that you would have been experienced enough for just because you didn't put it on your resume. If they need someone more experienced, they'll either figure that out from your resume or from an interview.
  9. Oct 13, 2013 #8
    OK thanks all, the responses have been part encouraging, part discouraging. This confirms that I have a lot to learn. For most of the interview questions mentioned here my response would be to stare blankly. I intend to practice this in my spare time. If anyone knows of any websites with particularly useful practice problems, please speak up.
  10. Oct 13, 2013 #9

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    You should understand the basics of C++: Inheritance, the rule of three, overloading, and overriding. You don't need to know how to write a template that deduces whether a class is polymorphic or not.

    It might be better to learn another language rather than to learn the depths of C++. Something like python or scala or perl so you can glue existing applications together, or write a quick and dirty prototype that may well do the job permanently.

    You aren't looking for a job as a top notch programmer who also knows a bit about numerical analysis. You are going for a job as a top notch numerical analyst who also knows a bit about programming.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook