Raja Software Labs interview Coding Questions
Raja Software Labs interview Coding Questions
4)*Palindrome string
*merging two arrays
*print number from 100 to 500 and print "cool" if the number is in multiplication of 5 and print
"dude" if number is in multiplication of 11 and print "cool dude" if number is in multiplication
of both 5 and 11.
*print two digit possible numbers from 0 to 5, but the two digit number should be like
decreasing one's place and increasing tens place.
*print the number if remainder is 3 when divided by 7 and exit if user press 0.
Interview Questions
Round 1 :-
Given printed sheet with 5 questions and you are supposed to write executable code.
Questions were:
1) isPalindrome string
2) merging two arrays alternatively
3)print number from 100 to 500 and print "cool" if the number is in multiplication of 5 and
print "dude" if number is in multiplication of 11 and print "cool dude" if number is in
multiplication of both 5 and 11.
4)print sequence like 50 51 52 53 54 55 40 41..........10 11 12 13 14 15
5)print the number if the remainder is 3 when divided by 7 and exit if user press 0.
Round 2 :-
1) Print this sequence:
*
**
***
****
2) Is the given year is leap or not ?
3) Find second smallest number in a given array.
4) Print given string ("Raja Software Labs") in this way ("Labs Software Raja"); not allowed
to use tokenizer, split or any other built in functions.
merge two list by taking alternatively values from another eg( [2,3,5,8] [1,4,9,7] output
should be [2,1,3,4,5,9,8,7]
program to print occurrence of string such that eg. if input is aabbbcc .O/P should be
a2b3c2.
Hourglass problem
second round
1. Convert numerical string to int without using any Standard function
2. Merge Two arrays alternatively one is int array and second one is char array with multiple
test cases
Software Developer
Fibonacci, primenumber, string operations etc.. All questions will have variations.
A-2: Write a function that takes an input parameter as a String. The function should reverse
the statement but keep the words intact and print it. Words are separated by dots. (Avoid
using inbuilt functions)
If input is “i.like.this.program.very.much”
Output will be “much.very.program.this.like.i”
A-3: Write a function which takes an input parameter as an array of integers and prints the
sum of all prime numbers from the given array. If all integers present in the input array are
non-prime the program should print sum as 0.
Example:
Input1: [1, 14, 5, 7] Output: sum=12
Input2: [2, 10, 13, 9] Output: sum=15
A-4: Write a program to merge two lists by alternatively taking elements from each list. The
method will take 2 arrays as input and return the merged array as output.
Input: [1,2,3] and [a,b,c] Output: [1,a,2,b,3,c]
Input: [1,2,3,4,5] and [a,b,c] Output: [1,a,2,b,3,c,4,5]
Input: [1,2,3] and [a,b,c,d,e] Output: [1,a,2,b,3,c,d,e]
Example
(21 is a Fibonacci number)
Input: 21 Output: 21
(20 is NOT a Fibonacci number so, output is 10 (2+8))
Input: 20 Output: 10
Interview Questions
Round 1:
Online test 1,
20ques in 60min. It includes medium level reasoning, Coding output and Aptitude test.
Round 2:
Online test 2,
Questions asked:
a) Anagram
Round 4: Technical 2:
Questions Asked:
a)Digits of int ae in ascending or descending or not specified. Ex: 1378 - acs order, 743 -
desc order, 3574 - no specific order
b)List of marks are there, Tell the rank of the entered new mark. Ex: Marks List: {39, 38, 38,
36, 34, 31, 28}, if added mark is: 38: Rank2, 37:Rank3, 36:Rank3
c)Its was like a puzzle, 2 watches are there 1 for hrs(24) and 1 for min(60), Calculate the
shortest unit distance between the 2 time from these watches. Ex: t1=03:56, t2:18:12
Distance=9+16=25. Soln: min(h2 - h1, 24 - h2 + h1)+min(m2-m1, 60-m2+m1), where h2 is
the greater hr, m2 is the greater min. Try it. The interviewer was surprised to see the
solution so quickly from my end :-).
Final Round 5, Technical 3:
● HR related Ques:
1. Nearest prime numbers which are at minimum distance, if there are two prime numbers
which are at equidistance from the given prime number then print both the prime numbers.
38.Write a program for Maximum profit by buying and selling a share at most
k times
Apples and oranges puzzle
55.Find the max distance between indexes of duplicate values from an array.
56. Write a function that prints out a breakdown of an integer intInput: 43018,
Output: Print 40000 + 3000 + 10 + 8
57. Find rank of students besed on marks there was given marks of 10 students
58. Count of elements which are power of 2 in array.
59. given list of students marks in decreasing order(same marks has same rank
i.e 36 34 34 20 19 1 2 2 3 4).Given new student mark.
find rank of new student in given list.
60.there are two clocks one is working properly(c1) and other one is dis-function(c2).
we given c2 is x mins faster than c1 per hour. And after k mins in c1.
If we stop c2 clock what will be total angle between hour and min hand in c2.
ex x=30 & k=90
output :- 744
64. Given an array including alphabates & dash.move all Dash at the end
without changing order of alphabets. O(N)
66. Given an integer array, find a pair with the given sum in it.
70. Check whether the vowels in a string are in alphabetical order or not
1.print the sum of elements of lower triangular matrix
2.binary array was given we have to sort it with using another array or any sorting algorithm
3.convert string into number without using inbuilt function
4.print the closet prime number of a given number
5 convert binary to decimal using recursion
4) given a range of numbers(low, high) print all numbers in that range(inclusive) and print
"raja" if number is divisible by 7, "software" if number is divisible by 11 and "not a valid
output" if number is divisible by 11 and 7 both.
input- (6, 12)
output- 6, raja, 8, 9, 10, software, 12
6) Find equilibrium point(index) in given array. Equilibrium point is the element from where
sum of all elements left to it is equal to sum of all elements right to it.
11) Balance the given string of parenthesis(only one kind of brackets given in string).
input- { } } { }
output - { } { } { }
12) Find maximum profit earned by buying and selling shares (we are allowed to buy and
sell only once).
input- {1, 5, 2, 3, 7, 6, 4, 5}
output- 6 (buy stock when price = 1 and sell it when price = 7)
13) You are given 100 balls in a container mixed, out of which 98 are blue and 2 are red,
making probability of blue ball to pick at random = 0.98. How many balls and of which color
do we need to add inside the container to make the total probability = 0.99.
Answer- Add 100 blue balls.
1 Hour and Minute hand angle
2.Buy and sell stocks
3. Maximum Frequency Character and its frequency
4 Minimum Profit
Basic array questions(2nd max) , backtracking and simple logic (clock angle).
1 reverse each word in a given string.
2. implement inbuilt python functions.
3. meeting room problem.
Interview Questions
Round 1.
1. Leap Year.
3. String Compression(aaabbbcc->a3b3c2).
Interview Questions
Given a string return true if the letters are repeated and return false even if there is a single
letter which is not repeated.
Input:Raja
Output:False.
Interview Questions
1st round:
a) Reverse a String
b) Convert a String to Integer without using inbuilt APIs
c) Get quotient and remainder of two number without using %, /
d) Convert hexademinal number to byte
e) Print the Nunber of frequencies vowels occur in a String.
2nd round:
a) Find the max distance between indexes of duplicate values from an array.
For eg. [0,0,1,1,0,0] -> Funtion should return 4 as max distance is between second and
sixth zero(5-1=4)
b) Find the angle between hour and minue hand when time is 3:30
c) If given String is I_LOVE_INDIA reverse whole string except "_". Output for this would be
A_IDNI_EVOLI
3rd round:
a) Given array contain 1 and 0, put all 1 on left side and 0 on right side of the array
b) Check if two given Strings are anagram of each other.
For this I gave answer to use two hashmaps and compare both, he asked another
approach. So I told him i can use two array with length 256 and store charachter values
against ASCII index and than compare both arrays. He asked for another So I told him we
can sort the array and compare both arrays.
Than he asked if there is an inbuilt function which we can use, I was not able to answer.
●
1. Detect 101 pattern from 110101001010100