Welcome to IBM US - Standard - Back-End
- Test duration: 45 mins
- No. of questions: 2 questions
Question 1
Given a string, return the character that appears the maximum number of times in the string. The string will contain only ASCII characters, from the ranges ('a'-'z', 'A'-'Z', '0'-'9'), and case matters. If there is a tie in the maximum number of times a character appears in the string, return the character that appears first in the string.
Example
Input: text = abbbaccc
Output: a
Explanation: Both 'a' and 'b' occur 3 times in the text. Since 'a' occurs earlier, 'a' is the answer.
Function Description
Complete the function maximumOccurringCharacter
in the editor below.
- Parameter:
string text
: the string to be operated upon - Returns:
char
: The most occurring character that appears first in the string.
Constraints:
- 10 ≤ |text| ≤ 10^4
- All characters are alphanumeric, in the ranges ('a'-'z', 'A'-'Z', '0'-'9')
Sample Input for Custom Testingtext = "helloworld"
Sample Outputl
Explanation: The character 'l' occurs the most, 3 times in the string 'helloworld'.
Question 2
In the dynamic world of web hosting, providing customers with a clear overview of their assets is key to enhancing user experience. A development team must create a feature for an online hosting customer's panel that generates a dashboard report of all customers and the number of active websites they own.
The results should include the following columns:
- email: the email address of the customer
- total_active_sites: the total number of active websites for each customer
The results should be sorted in ascending order by email.
Note: Only active websites should be included.
Schema:
- customers:
id
(INT, Primary Key): The identifier of the customeremail
(VARCHAR(255)): The email address of the customer
- sites:
customer_id
(INT, Foreign Key): The reference to the customer's IDurl
(VARCHAR(255)): The URL of the siteis_active
(BOOLEAN): The status of the website (1 for active, 0 for inactive)
Schema
- customers
id
(INT, Primary Key): The identifier of the customeremail
(VARCHAR(255)): The email address of the customer
- sites
customer_id
(INT, Foreign Key): The reference to the customer's IDurl
(VARCHAR(255)): The URL of the siteis_active
(BOOLEAN): The status of the website (1 for active, 0 for inactive)
Sample Data Tables
customers
sites
Sample Output
total_active_sites | |
---|---|
dcristofol0@slashdot.org | 7 |
hmainz2@utexas.edu | 9 |
mbillanie1@japanpost.jp | 2 |
我们长期稳定承接各大科技公司如TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。
We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.