• Support PF! Buy your school textbooks, materials and every day products Here!

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

  • Thread starter Doofy
  • Start date
  • #1
74
0

Main Question or Discussion Point

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.

Thanks.

* a job that a HEP physics graduate might typically apply for, eg. quantitative analyst has crossed my mind.
 
Last edited:

Answers and Replies

  • #2
336
14
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.
 
  • Like
Likes 1 person
  • #3
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
16,080
6,053
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
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.
is a very good one.
 
  • Like
Likes 1 person
  • #4
74
0
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.
I'd like to hear as many of these interview questions as you can be bothered to write out?
 
  • #5
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
683
I would absolutely expect anyone claiming knowledge of C++ to have a solid understanding of C, particularly including pointers.
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.
 
  • #6
336
14
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.
 
  • #7
525
16
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.
 
  • #8
74
0
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.
 
  • #9
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
683
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.
 

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

Replies
7
Views
4K
Replies
4
Views
3K
Replies
6
Views
1K
Replies
27
Views
7K
  • Last Post
Replies
2
Views
2K
Replies
5
Views
27K
Replies
1
Views
4K
Replies
75
Views
13K
Replies
6
Views
2K
Replies
76
Views
6K
Top