This CodeNewbie Challenge will help you learn some of the basic problems you might see on a white board in an interview. This challenge was based on some of the white board problems we’ve seen throughout interviews. The goal here is to familiarize yourself with the types of white board challenges you might face in an interview.
For this challenge we will begin with an array of strings:
In this challenge you will be manipulating this array and the strings within it.
In the first level you will start by reversing the order of the strings in the array. Your output should look as follows:
The second level starts with reversals in mind but instead of reversing the list you are now to reverse the strings themselves. Your output will look as follows:
Next you will take a user input string and reverse it. The input should look like:
With user input:
And your output will look as follows:
The third level takes a user input and reverses it to determine if it is a palindrome or a word or phrase that is the same forward as backward. Your input screen will look as follows:
If the user enters the word “aibohphobia” your output will be as follows:
If the user enters the phrase “Are we not drawn onward to new era” your output will be as follows:
If the user enters the word banana your output will be as follows:
You’ll need to remove the punctuation on phrases.
Going a step further with string manipulation try taking two strings and checking to see if they are anagrams (words or phrases with the same characters but in a different order). Your output should state the two strings and if they are or are not anagrams.
An easy way to do this is to check character count for each string. If they match they are anagrams.