Computer Professionals Program
Master of Science in Computer Science

Maharishi University of Management, USA

Sample Qualifying Exam for Preparatory Track

This exam is posted for prospective students of the Master of Science in Computer Science Program at Maharishi University of Management (Computer Professionals Program). In order to qualify for the PREPARATORY TRACK track, incoming students are expected to pass a Preparatory Track entrance exam similar to the one given below upon arrival at the University. Actual exam questions will differ from those below. The sample exam is posted here in order to help prospective students assess their readiness for study in the program.

1. [Tests ability to write a simple loop] Write a Java method displayArray that loops through the elements of an array of Strings, and outputs them to the console as a single row of comma-separated Strings. Your method should accept an array of Strings as an argument. For example, the array

{“Bob”, “Steve”, “Sue”, “Tony”, “Melba”}

should be displayed to the console as

Bob, Steve, Sue, Tony, Melba

2. [Tests ability to solve a problem] Write a function that accepts a character array as input, counts the number of occurrences of each character in the array, and outputs the results in a format like the following (characters that do not occur in the input array are not displayed in output)

a - **

c - ****

e - *

For example, if input were {‘c’, ‘e’, ‘e’, ‘e’, ‘a’, ‘q’}, the output would be:

a - *

c - *

e- ***

q - *

3. [More problem-solving test] Write a function hasSmallCommonMultiple that returns true if its two integer input arguments arg1, arg2 have a common multiple that is less than arg1 * arg2. For example, on input 10, 15, the function returns true, since 30 is a common multiple of 10,15 that is less than 10*15 = 150. On the other hand, the function returns false on input 8, 9 since the smallest common multiple for these is 72.

4. [Tests basic knowledge of recursion] Write a recursive function that accepts an integer argument n and returns the sum of all positive integers less than or equal to n.   

back to top

Site Map