Remainder

Another “classic” programming interview question. The Question Given a numerator and denominator, calculate the remainder. The Answer The Trivial Way: This question is trivial if you use the modulus (%) operator. Simply read the user input, calculate and display the modulus and you are finished. I added one simply check to ensure … Continue reading

Maximum Value

Another “classic” programming interview question. The Question Given user input of a series of numbers, find the maximum value of said input. The Answer This question is simple if you understand the concept behind arrays (which you can see the basics of in the “Reverse a Sentence” post). The basic idea … Continue reading

Minimum Value

Another “classic” programming interview question. The Question Given user input of a series of numbers, find the minimum value of said input. The Answer This question is simple if you understand the concept behind arrays (which you can see the basics of in the “Reverse a Sentence” post). The basic … Continue reading

Reverse a Sentence

Yet another “classic” programming interview question. The Question Given a sentence as input, reverse the words but not their individual letters. Thus, the sentence “One two three” would result in “three two One” The Answer Using an array is the only sensible way to accomplish this. If you don’t, you’ll … Continue reading