3 ms·
What language was this in? In ruby this would just be "hello".reverse, and even if you didn't have that available to you there would always be: acc = "" ; "h
by 3pt14159 16y ago
What language was this in? In ruby this would just be "hello".reverse, and even if you didn't have that available to you there would always be:
acc = "" ; "hello".size.downto(1) {|i| acc += "hello"[i-1]}
or the more rubyist way of doing it
"hello".each_char.to_a.reverse.join
Or probably something more clever I can't think of at the moment. Was the language so crippled that they were worrying about UTF8 characters? It can't possibly be that 95% are that bad. How could they possibly do anything?
- rorrr 16y agoWe ask not to use the built-in reverse function. And for the number reversal we ask not to fall back to strings.
- rorrr 16y agoSorry, didn't answer your question fully the first time, was in a rush. The languages we interviewed for were Javascript and PHP (for different positions). There are lots of newbies out there who pick up the basics of these two languages (due to their popularity), and then try to get high paying jobs. Most of them are used to copy/pasting the code from the internet. That's extremely prevalent among Drupal developers. Drupal has a ton of contributed modules, so you can get pretty far without writing a single line of code. It's really really hard to find a good Drupal developer. I'm completely serious about 90% not being employable (by my standards).