Followings are my solutions for the UI exercise I was assigned as a part of the interview process.

Instead of creating two separate html files, I am providing my solutions for both the test on a single html file. Also, since the purpose of this exercise is to test my JavaScript knowledge, I am provoding the solution on a basic html page instead of using HTML5/CSS3 based webpage.

Exercise 1: Key Counts


Some notes about 'key-count' solution

  • The first step was to initialize an object, Dict (dictionary to hold all the values)
  • Next step was to convert text area values into a JavaScript array
  • A function was created to add key and count values into dictionary
  • Finally, functions were created to get values from dictionary and display them

Exercise 2: Palindrome Test



Enter your text in the input field and see if it contains a palindrome

Some notes about the 'palindrome' solution

  • The first step was to get the value from the input field
  • Next step was to lower case the string value and use regular expression to remove all spaces and special characters
  • Next, the string is reversed and kept into another variable
  • Two values were compared for testing if they are similar (in order to test palindrome)