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

Click For Summary
SUMMARY

The discussion centers on the qualifications and expectations for physics PhD graduates transitioning into C++ programming roles, particularly in quantitative analysis. Participants emphasize the importance of understanding core C++ concepts such as inheritance, pointers, and the rule of three, especially in the context of job interviews. It is established that while basic familiarity with C++ is beneficial, a deeper knowledge of object-oriented programming principles and practical coding experience is crucial for success in technical positions. Additionally, the conversation suggests that candidates should clearly articulate their C++ experience on resumes and consider learning complementary languages like Python or Scala.

PREREQUISITES
  • Understanding of C++ syntax and basic programming constructs
  • Familiarity with object-oriented programming concepts, particularly inheritance
  • Knowledge of C programming fundamentals, including pointers
  • Experience with debugging and writing practical C++ code
NEXT STEPS
  • Research C++11 features and best practices for modern C++ programming
  • Learn about object-oriented programming principles, focusing on inheritance and polymorphism
  • Explore interview preparation resources for C++ programming roles
  • Consider learning Python for data analysis and prototyping applications
USEFUL FOR

This discussion is beneficial for physics PhD graduates, aspiring quantitative analysts, and anyone looking to enhance their C++ programming skills for technical job applications.

Doofy
Messages
71
Reaction score
0
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:
Physics news on Phys.org
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   Reactions: 1 person
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   Reactions: 1 person
ParticleGrl said:
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?
 
phinds said:
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.
 
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.
 
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.
 
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.
 
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.
 

Similar threads

Replies
28
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
3
Views
2K
  • · Replies 80 ·
3
Replies
80
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 37 ·
2
Replies
37
Views
9K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K