From what I've seen, reversing strings, etc. is one of the most popular algorithmic questions in tech interviews. In fact, a few years ago when I was getting advice from more seasoned programmers regarding my very first tech interview, each one said that I should review how to reverse strings (or particular words in a string).
The problem I have with it is, there are generally really easy ways to do it (in C++, you'd only need to be familiar with the string library). Plus, most begining programming books seem to give examples of how to do things like this. I guess it just seems to me that questions like this don't so much test a person's ability to think logically, but rather how well they've read their begining programming book, or whether they've had a reason to look through libraries, etc.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||