Some companies like to pose certain programming questions as part of their interview process.
I’ve run into a variety of these. They’ve been SQL related questions, code writing, and algorithm descriptions. Some were fairly straight forward. Some less so.
One of the best I heard was a series of “How would you write this code if you had to write it …” with varying restrictions put on things. And the code was pretty simple. Write code to count all the upper and lower case letters in a string of ASCII characters.
First write the code however you wanted. Loops, if then else, select case.
Depending on which branching style you used the first time then the follow on was to write it using the other. If you first used a massive if then elseif statement then switch to using a select case.
And of course take into account that Xojo IS not case sensitive with string comparisons.
And finally to not use a branching type at all. This requires some out of the box thinking. Literally “count all the upper and lower case ASCII letters without the use of IF, SELECT or any other branching control.” All you have to use is a loop (while/wend, for/next whatever you wanted)
This first two bits are fairly straight forward.
The third however is still one of my favourite “thinking out of the box” approaches.
Anyone care to take a guess at how to achieve that one ?