Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I recently had a few interviews for programming jobs within the financial industry. I am looking for entry-level positions as I specify in the cover letter. However I am usually asked questions such as:
- all two-letters commands you know in unix
- representation of float/double numbers (ieee standard)
- segmentation fault memory dump, and related issues
- all functions you know to convert string to integer (not just atoi)
- how to avoid virtual tables
- etc..

Is that the custom? Because I don't think this kind of questions make sense for someone willing to get an entry-level job. Is it totally crazy to think that they should ask more conceptual questions? This is beginning to driving me nuts, honestly.

Thanks

share|improve this question
Is this for a position that will be working in a Unix/Linux environment? – Rob Z Feb 14 '11 at 20:26
10  
After the first time it happened you did not think to yourself. Huh, I better look up the answer just in case it happens again? Griping about it not being fare is not useful. Using the experience to learn something new is useful and will show the next interviewer you are more than the cardboard cutout that is produced by the university and that you have enough skill to go off and find useful stuff outside the norm.. – Loki Astari Feb 14 '11 at 21:09
1  
@Dunk: do you remember everything you learnt at school? No offense, but assuming you have a scientific/technical background I could find several questions you would not be able to address, beginning from basic math/probability or theory of algorithms. – Banana Feb 14 '11 at 23:14
1  
@Martin: true, but it could well happen with how many other questions? Thousands? – Banana Feb 14 '11 at 23:48
2  
@Charles: Fair enough; the question isn't specific to a UNIX C++ position. It simply asks if those are reasonable interview questions for an entry-level C++ job. I don't think questions about other software tools have much to do with your ability as a programmer in a particular language. If I'm sufficiently proficient in C++, I'd wager that I could pick up my UNIX skills quickly enough. – Cody Gray Feb 15 '11 at 6:22
show 8 more comments

migrated from stackoverflow.com Feb 14 '11 at 19:51

11 Answers

up vote 23 down vote accepted

Meh, I don't know if I'd want to use these really.

  • all two-letters commands you know in unix

I can't remember the ones I use. I just use them. They are that ingrained at this point.

  • representation of float/double numbers (ieee standard)

Read the standard? Anyway there are 3-4 different common ways of representing them insofar as I recall. IBM, IEEE, C/C++, and perhaps a few others. I'd guess Ada and Javascript have their own representations.

  • segmentation fault memory dump, and related issues

What about them? (Oh yea, and what platform is this running on, anyway? embedded w/o MMU? embedded w/ MMU? OSX? Linux? Windows? z/OS? $other_os? those influence behavior).

  • all functions you know to convert string to integer (not just atoi)

Duckduckgo.com is your friend. Why should you memorize this?

  • how to avoid virtual tables

Very reasonable for a position that requires C++ experience. I wouldn't expect this to be taught in college.

In general these seem to be memorization questions, which, IMO, has almost no correlation with how you get things done. All of these can be answered with a reference book. They would be good for a pre-interview "return this sheet to us" approach, which would indicate ability to look things up. Hopefully not needed, yea?

I would also be disgusted with interviews like this.

share|improve this answer
If you take each of the questions literally then I can see your point. However, I believe each question opens up a more general discussion that is very applicable to the interviewee's breadth of knowledge. Especially considering that there really isn't a right or wrong answer to any but the float/double question. – Dunk Feb 14 '11 at 21:48
2  
@Dunk: I can rip anyone a hole with memorization-based questions. So can anyone else with any experience at all. I'd rather jump past that and try to figure out if someone can solve problems rather than memorize arcanity. Personally, at least... – Paul Nathan Feb 14 '11 at 21:58
1  
I'm not convinced that you can tell if a person is going to be good at solving problems or not on the job from an interview. For an entry level position, I'd rather know that the person has a good breadth of knowledge and can articulate some of that knowledge too me during the interview period. I think the questions are not memorization questions since there isn't a right answer to any of them. Even if the person memorized the ieee float format, a quick follow up question like "What are the implications of storing it that way?" will tell a lot about their general computer knowledge. – Dunk Feb 14 '11 at 22:13
+1 for duckduckgo.com – Christopher Mahan Feb 14 '11 at 23:15
1  
@Dunk, well, that's the problem with interviews... can they talk or can they walk too? – Paul Nathan Feb 14 '11 at 23:20

It seems to me that the answers here are not even addressing the fact that this is an interview. The interviewer is trying to find out how knowledgeable the person is. All but one of these questions is very general and all of them probably are intended to not get the exact right answer but instead to draw out that the person has some breadth of knowledge.

  • all two-letters commands you know in unix

They are apparently looking to hire someone who has at least used Unix. The interviewee can list any number of 2 letter commands and then the interviewer can ask what they do. If the interviewee can't come up with even a small list or can't tell what the commands are for then that makes it apparent that this person is going to require a great deal of Unix training. It doesn't mean it disqualifies the person, it simply means that this person is going to have a big learning curve.

  • representation of float/double numbers (ieee standard)

I seriously doubt that they expect the interviewee to memorize the format, but they would hope that the interviewee knows that floating point is stored quite differently from integer numbers and double is different from float. And probably the home-run answer would indicate the interviewee's awareness that float/double are not stored as exact numbers. There will be rounding issues to be concerned about.

  • segmentation fault memory dump, and related issues

It's been a good 10 years since I last worked on Unix systems but back then memory dumps were the #1 way of figuring out what went wrong when a fielded application died in the field, since you frequently couldn't readily duplicate the problem while a debugger was attached. If an interviewee has already learned to do this then that would give them a leg up. It could also lead into talking about debugging methods and capabilities in general, which is a large part of what entry-level programmers do.

  • all functions you know to convert string to integer (not just atoi)

I'm thinking this question is an attempt to get at whether the interviewee is aware of the security issues involved with the standard string conversion methods. If they only list unsafe versions then that would lead to a number of security related follow up questions. I actually think it is a good way to weed out the casual programmer from the serious ones. I may actually use it in the future.

  • how to avoid virtual tables

I don't think there is a right answer to this question and it is probably intentionally so. This is probably an attempt to #1 see if the interviewee even knows what a virtual table is AND #2 get the interviewee to talk through the problems with virtual tables and possibly the trade-offs of a workaround.

share|improve this answer
1  
regarding the last one, the answer is no. What they wanted to see is this -> class B : class A< class B> { // etc.. – Banana Feb 14 '11 at 22:54
@Banana, could you please elaborate on this for a noob? – Job Feb 14 '11 at 23:44
1  
@Job It is one trick for getting around virtual calls. For class A to call a function from class B without the template argument you would use a virtual function and therefore have a V-table. By giving A direct access to B(through the template parameter) you no longer need a virtual function and thus no V-table. – stonemetal Feb 18 '11 at 19:55
It is completely obvious to me that storing floats will involve rounding errors, since they are decimal numbers stored in base 2. Still I have no clue what the IEEE standard says about them... – Andrea Feb 18 '11 at 23:30

It sounds like a unix/batch environment job. I didn't think any of those questions were "out of bounds".

- all two-letters commands you know in unix

I used to ask questions similar to this. Why? I wanted to know if you could get around the system. If you knew some of the basic commands, then I knew you worked in the environment before.

- representation of float/double numbers (ieee standard)

Working in a financial services company I imagine you would deal with a lot of floating point numbers (rounding errors, detecting, etc)

- segmentation fault memory dump, and related issues

That would tell me if you knew how to debug a crashed program.

- all functions you know to convert string to integer (not just atoi)

Financial services and numbers. You may receive reports/files from outside sources. You may need to convert them to something useful before you can use it. That also shows how well you know the language and the associated apis/libraries.

- how to avoid virtual tables

Performance. Do you know how to write efficient code (or at least where/how to identify when it is not)

share|improve this answer
1  
I understand your point. But what about looking forward to hire smart people? Am I wrong about thinking that you can always learn that stuff when you need it? – Banana Feb 14 '11 at 20:04
6  
It depends on how much time and money a company wants to spend training you on what would be considered the basics. I wanted people to learn the application when they came in and not the tools for the application. I don't want to hire a carpenter that I have to teach how to use a hammer (and then wait for him to be proficient after he does). Hope that helps. – jmq Feb 14 '11 at 20:09
3  
@Banana - Sure, a smart person can learn this stuff. At the moment, though, there are going to be far more qualified applicants than positions so employers are in a position where they can require junior developers that are smart and that already know more of what they'll have to learn on the job. If they get dozens of qualified, smart applicants, why wouldn't they pick the one that's a few weeks or a few months further along the learning curve. – Justin Cave Feb 14 '11 at 20:11
+1 Good explanation of why the questions are not as far fetched as I have thought. – Oswald Feb 14 '11 at 20:32
2  
@Oswald: a disturbing number of applicants will lie about experience to get a job; specific questions like these will quickly separate the liars from the rest. – John Bode Feb 14 '11 at 22:46
show 2 more comments

These questions aren't totally unfair. If you claim to have UNIX/LINUX experience, you should know about 'rm', 'mv', 'cp', and 'ln'. Anyone with pretensions to be a C++ programmer should be able to give general information about floating-point representation, even if you don't know the exact number of bits in the exponent and mantissa of the IEEE representation. Memory dumps? Who cares? I programmed in C++ in various UNIX environments for over ten years and never looked at one. String to integer? Again, who cares? I can only think of atoi and sscanf. If you need something else, search online.

Avoiding virtual tables? That's a scary thought when memory costs pennies per megabyte. If you need virtual behavior, then use virtual functions. If not, don't. Avoid people who think they are smarter than the compiler.

I spent years interviewing C++ programmers and never had much use for questions like these. I wanted people who could program. I was hiring for long-term employment, so I didn't even care if they knew C++. I just tried to find out if they knew any language well. Knowing multiple languages was a good sign. Being able to compare two languages to any depth was about enough to get the job.

Mostly I judged candidates on their ability to solve a simple programming problem at the whiteboard. I know lots of languages, so they didn't even have to use C++. The rest of my team could solve similar problems in a few minutes, so that was the expectation. Some candidates did very well. Others with their freshly minted MSCS couldn't solve it in half an hour. After they had a solution, I asked them how fast (Big O) it would run, and how it might be made faster.

If a candidate claimed to have C++ experience, then I asked about the topics covered in Scott Meyer's Effective C++. Did they understand the C++ object model? Did they understand how to use the language features to improve program quality? Could they tell me anything they liked about C++, or disliked? Opinions were good, apathy was not.

share|improve this answer
2  
But surely not all programming jobs are fungible? These questions were specific to financial services firms. Knowledge of the idiosyncrasies of floating point is pretty essential there, while completely irrelevant in other positions. The issue with virtual tables is not memory usage but speed of execution. Again that sort of micro-optimization might be bread and butter in this particular domain and irrelevant to almost everyone else. – Charles E. Grant Feb 14 '11 at 21:35
You judge your candidates based on their ability to solve the problem on the whiteboard? Surely you don't believe that this gives an indication of a person's ability to be a great designer/developer? Most software work can be performed in the solitude of one's desk where the person can think in the way that suits them best. Many (if not most) software people are not good at coming up with good solutions off the cuff, particularly if they are entry-level standing in front of someone at a high-pressure interview, and being told to come up with a solution on the whiteboard right this second. – Dunk Feb 14 '11 at 21:53
2  
If the problem is simple enough, then yes, I do expect a candidate to come up with a solution pretty quickly. The rest of my group could do that. – kevin cline Feb 14 '11 at 23:55
2  
It's one thing to know the idiosyncracies of floating-point arithmetic. I would expect any CS graduate to be able to tell me quite a bit about that. I would expect them to know that there is an exponent, and a binary mantissa, and that round-off occurs, and that most decimal fractions are not exactly representable. I wouldn't expect them to necessarily know how many bits are in the mantissa, or how NaN is represented. – kevin cline Feb 15 '11 at 0:13
3  
Having worked with C++ in the games industry, I can tell you that the virtual tables question would be extremely relevant (and yes, as Charles said, for speed reasons not memory usage). – Carson63000 Feb 15 '11 at 0:58
show 1 more comment

You can be asked anything.

While companies must refrain from being discriminatory in any way, during an interview, they can (and will) ask anything. How big is a donkey's heart?

Primarily, the interviewer will be gauging to see if you know the answer to the question. But just as importantly, if you don't know the answer, they're observing how you answer the question.

Never, under any circumstance, should you lie. And saying, "I don't know", would be just as bad. Instead, offer:

  1. as much (relevant) insight on the topic as you can
  2. a sensible way you would go about finding out the answer
share|improve this answer
+1 For sharing as much insight as you can. Frequently how you answer the question is more important than simply giving the right answer. – Dunk Feb 14 '11 at 21:41
2  
Interview is a 2-way communication. I might be able to guess how large a donkey's heart is, but would I want to work there? – Job Feb 14 '11 at 23:46
@Job: Uhhh... why would Banana ask this question then? – Jonathan Khoo Feb 15 '11 at 1:13
  • all two-letters commands you know in unix

You can point out the obvious, like ls, rm, cp, du, df. Or you can ask what precisely he means by unix. They are all just programs and the length of the name is not related to the value of the program.

  • representation of float/double numbers (ieee standard)

There's template <typename T>std::numeric_limits. If this is not sufficient, then the documentation of the compiler will have to be consulted.

  • segmentation fault memory dump, and related issues

Beware of those. You don't want to have segmentation fault memory dump, and related issues in your program.

  • all functions you know to convert string to integer (not just atoi)

What standard do the functions have to conform to? Or can I make up my own functions?

  • how to avoid virtual tables

Virtual tables are an implementation detail. If you want to get around them, you will have to read the documentation of the implementation you are using. There is no general way to avoid virtual tables. If there where, everyone would be using it. Every way to work around them falls short in one or the other way.

share|improve this answer

I don't think these are entry-level.

  • all two-letters commands you know in unix

Rather silly as there are so many and can you roll them all off in one go? Are they expecting vi to be among them?

  • representation of float/double numbers (ieee standard)

Not sure if you have to know the detail or just about splitting bits between mantissa and exponent and signs.

  • segmentation fault memory dump, and related issues

What causes them or how you analyse a core-dump?

  • all functions you know to convert string to integer (not just atoi)

Possibly asking you about C++ streams so pretty much entry level.

  • how to avoid virtual tables

Templates? Or function-pointer tables? What do they want to know here?

share|improve this answer

These questions are basic C++ common knowledge, they are filtering questions, if you don't know them they figure you don't know anything more high level or conceptual, and even if you did, you couldn't implement it if you don't know the basics.

All these questions are about what you know, and if you know these details, it illustrates that you can learn. It also shows a conviction to the craft of programming, and that you aren't a casual programmer that hacks a your mom's website in PHP.

The financial industry is hardcore, the are billions of dollars at stake. If you want a job that values conceptual theory over practical knowledge, the financial industry is the wrong place for you. Conceptual theory is not really any good if you can't provide some practical application of it. Knowing every design pattern in the GoF book is great in theory, but if you don't know when to apply them in practice it is hollow knowledge.

But someone that applies the same design theory but doesn't know the names of every pattern and what not is more valuable to a business.

Knowing how floating point numbers are stored is relevant if you are doing math on them and the flaws in the way they are stored and manipulated are important. For example using Float for Currency and doing math on it is always wrong, knowing why is important, and why is based on how they are stored. It makes perfect sense that someone in the financial industry should know this before they start their first day on the job.

If you can't rattle off a few two letter commands in Unix you don't really know Unix.

I had a very smart Java developer that works for me, ask me the other day what a "segfault" was the other day, he has never done anything that required that knowledge. He doesn't have a CS degree, he has never programmed in C or C++. I would assume anyone with a CS degree should know that, I know that anyone that has written any practical C or C++ knows that and how to use gdb, valgrind and other debugging tools. I am sure that the financial industry requires some kind of CS degree for entry level positions.

Knowing all the functions to convert string to int shows the depth of your knowledge of C or C++. People that don't have this knowledge probably would not fit in with the requirements for these jobs.

How to avoid virtual tables is a very basic fundamental optimization technique in C++, and financial applications are usually very time sensitive and performance oriented, especially trading applications.

It isn't my opinion that these are not learn-able they are obviously, I learned them, lots of other people have as well. What the interviewer is looking for is have you already learned this information, which they think is important for their entry level developers to know. They are looking for what you don't know more than what you do know.

One person I used to work with back in the early '90s would ask candidates for FoxPro developer positions if they could tell him what BIOS stood for as a first question and other general knowledge questions right up front.

If they couldn't they were in a deep hole and the interview would end very quickly. Granted it had little to do with programming, but if you were a FoxPro programmer and didn't know those basic things about the computers you programmed, you were not very dedicated to your craft.

share|improve this answer
1  
@lollipop: Do you really think you cannot solve problems without knowing the answers to those questions? I could post a number of puzzles that most programmers would not be able to answer to. I do understand a lot about algorithms, and many people, like me, from top universities only use matlab. That doesn't prevent them from being much smarter than average, and use the old-fashion technique: rtfm and do it. – Banana Feb 14 '11 at 20:10
3  
@Banana, even worse, if you can't answer these questions, there's a significant danger that you'll think you've come up with solution, but your solutions will have subtle but fundamental flaws. Not only would it cost the employer money to fix your mistakes, it could cost them a huge amount of money just to <i>find</i> your mistakes. Working with floating point numbers has a host of 'gotchas' that you need to be worrying about from the moment you start. You can't RTFM to solve an issue if you don't know that an issue exists. And yes, there are candidates who do already know this stuff. – Charles E. Grant Feb 14 '11 at 20:41
1  
@Charles: that doesn't mean you cannot learn it, how did all these people would know about it, then? Secondly, I do agree that it might (or might not) take a bit of time to know all related issues. However, the contrary is not true; knowing specific issues does not guarantee to come up with a good solution. In fact, good solutions often come from a high-level view of problems, or the ability of looking at the big picture, and ultimately address it to the specific issues you were talking about. But these are two different layers in my opinion. – Banana Feb 14 '11 at 23:04
2  
..You can't RTFM to solve an issue if you don't know that an issue exists.. - exactly. Someone who thinks "oh if I ever need to know how floating point numbers are stored I'll just look it up" is someone who is liable to store monetary values as floats and do math on them. And I can guarantee you that will go down like a lead balloon in the financial industry. – Carson63000 Feb 15 '11 at 1:01
2  
@Banana, I think you are setting up a false choice for employers. They don't have to choose between folks who can answer those questions, and people with good abstract design skills. There are plenty of people who can do both, even at the entry level. – Charles E. Grant Feb 15 '11 at 6:25
show 3 more comments

many of these questions are for entry-level positions, C++ under Linux environment

A recent graduate who could answer most of these questions intelligently would be really top-notch. So if that's the kind of person I was looking for, I'd ask these kinds of questions.

Based on that, I'm guessing the

programming jobs within the financial industry

you're interviewing for involve investments. That's an extremely challenging world for programmers. Pay can be high and advancement rapid, but you have to be the cream of the crop to succeed: hard-working, intelligent, knowledgeable, and a quick learner.

For easier, "more conceptual questions", investments are the wrong industry.

share|improve this answer

They sound too much like trivia to be of much value. Thats great at the neighborhood pub playing video trivia with other patrons, but tells you nothing about the candidate's ability to make smart decisions and understand of the bigger development picture.

If they really want to go that language specific route, have the candidate explain things like OOP, templates, and generics as found in C++. Not just listing trivia, but have them explain it as if they were teaching it to a high schooler. That will demonstrate how well they really understand the concepts and provide insight into their ability to communicate effectively.

share|improve this answer

Check http://c-faq.com/ by steve summit. (Hard copy is also available and that has more detailed explanations.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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