IBM Online Assessment Question 2024 (Intern)
Anonymous User
571

IBM Hackerrank Assesment. Two Questions. 60 minutes.

Problem1: Return number of valid word on string.
A word is valid if it’s length at least 3 and contain alphanumeric character and at least one vowel and one consonant.

Input: “This is a valid stateme$nt test”
Output: 3

Problem2: On a given string perform following operations. If operation is roll backward(L) then shift all character to one backward over given substring(‘b’ -> ‘a’, ‘a’ -> ‘z’). If operation is roll forward(L) then shift all character to one forward over given substring(‘b’ -> ‘c’, ‘z’ -> ‘a’).

Input: ‘abc’, [‘0 0 L’, ‘2 2 L’, ’0 2 R’]
Output : ‘acc’
Explain :
After ‘0 0 L’ ‘abc’ -> ‘zbc’
After ‘2 2 L’ ‘zbc’ -> ‘zbb’
After ‘0 2 R’ ‘zbb’ -> ‘acc’

Comments (3)