Zoho Inc. is a company that mainly focusses in producing
computer and laptop accessories. The company is planning to
introduce a new Bluetooth keyboard series known as ReThink series.
The researchers of Zoho Inc. are tasked by the company management
to come up with a new key layout for ReThink series.
The researchers are given the following requirements for
designing the ReThink keyboard se-ries. •
The keyboards in this series should be compact. •
The keyboards should be able to connect wired and wirelessly
(via Bluetooth) to any computer, laptop. •
The keyboards should not follow the traditional QWERTY layout,
instead it should have most typed characters nearer to the sides of
the keyboard and least typed al- phabets in the middle.
Researchers are analyzing on how to replace the layout of
alphabets. They have large data- base of paragraphs typed by people
around the world. They are planning to use this database to rank
the alphabets from most typed to least typed as a first step.
Researchers now think that they need a software program which
can analyze the paragraph(s) and give count of each character in
the given paragraph(s).
You have been approached to help the researchers with the
following task.
1. How will you design the software system to analyze the
paragraphs from the large data- base?
a. list down all your assumptions
b. Use diagrams and text explanation to express your design
c. Send us your design document in word or pdf format
2. Write a function that accepts a string (paragraph) as input
and outputs a string that con- tains the maximum occurring top 30%
of the alphabetic characters in the given input in each line. By
top 30%, we mean the sum of the most occurring alphabetic
characters is not more than 30% of the total sum of all alphabetic
character occurrences.
Refer to the example below. Points to note:
o The function should only consider alphabetic characters and
should not con- sider numbers, special characters, control
characters and white spaces.
o The function should not consider the case of the alphabetic
characters.
o If input length <= 3, then the output should be empty
string.
o If more than one characters have the same number of
occurrences, then the selection of character should be based on
alphabetical order.
o You can choose your preferred programming language to write
this function.
3. Write unit tests to cover success, failure and corner cases
for the function created in task 2. You are free to use any unit
testing framework. Submit your code in a .txt file format and
mention the programming language and unit test framework used in
the submission email.
Example 1: Input: Hello World, 101! Output: l Explanation: There
are 10 alphabetic characters in total in String, “Hello World,
101!”. The maximum occur- ring alphabetical character is ‘l’ (3
times) followed by ‘o’ (2 times) and others. However, count of ‘l’
already makes it to 30% of the total sum of all alphabetic
characters (10). Thus, the output is only ‘l’.
Example 2 Input: Madam Output Explanation: There are 5
alphabetic characters in total in String, “Madam”. The maximum
occurring alphabet- ical character is ‘a’ (2 times), however count
of ‘a’ makes 40% (more than 30 %) of the total sum of all
alphabetic characters (5) in this string. Thus, the output is blank
or empty.
Example 3: Input: To us on Earth, the sun is a smiling
orange-yellow circle among the cottony clouds. But the fiery ball
of fire out in space is so much more than that. The Sun is the
star, the center of our solar system. It is the most important
source of energy for life on earth. With its humongous size and
heavy composition of chemicals, this blazing star has a magnified
gravitational force, compelling all the planets, including the
earth to revolve around it. Due to its importance in our lives, man
since prehistoric times has considered it a deity and I personally
believe it is nothing less than that.
Output: e t Explanation: There are 475 alphabetic characters in
the given input. The maximum occurring alphabetical character is
‘e’ (49 times), ’t’ (49 times) followed by ‘i’ (45 times) and
others. The occurrences of ‘e’ and ‘t’ sums up to 98 (about 20.6%).
If we add occurrences of ‘e’, ’t’ and ’i’ we get 143 (about 30.1 %)
which is more than 30%.
Thus, the output is ‘e’ and ‘t’ printed in each line.
Zoho Inc. is a company that mainly focusses in producing computer and laptop accessories. The company is planning to int
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am