Interview Questions: Call by reference and call by value

A common simple interview question is to explain the difference between “call by value” and “call by reference”. This refers to the way arguments are passed to functions. In call by value, a copy of the argument is made and given to the function so that any changes made to the argument affect only the …

Continue reading ‘Interview Questions: Call by reference and call by value’ »

Interview Questions: Detecting Palindromes

This problem is almost too simple to mention, but it has actually been asked of me in an interview, so I’ll go ahead and address it. Problem: detect if a given string is a palindrome. Be sure to ignore case, spaces, and punctuation characters. Solution: Start by setting references to the first and last characters. …

Continue reading ‘Interview Questions: Detecting Palindromes’ »