Date of visit : 29/08/2018
Criteria : 7.5 above
The first round was a online test that had 50 multiple choice questions. The questions were very standard and covered everything like java, C, C++, Python, CSS, DBMS, OOPs, Networks, OS etc.
After the first round 20 people were shortlisted for the second round.
The second round was a coding round where we were given only one question. The objective of the round was not only to check whether the logic and code was correct but whether the students have used paradigms of the programming language they chose. for example, if we choose java to write our code we must have used OOPs principles.
The question was to encode the given string in a format specified.
Input : this is a secret
procedure :
1. remove the spaces, s = thisisasecret
2. find the length of s, l = 13
3. find w which is the ceil of sqrt of l, w = 4
4. separate s using w, s= this isas ecre t
5. encode the string by taking the first character of each word from as the first word of the new string and the second character of each word from s as the second word of the new string and so on..
encoded string = tiet hsc iar sse
Output : tiet hsc iar sse
Criteria : 7.5 above
First Round
Duration : 40 minutes.The first round was a online test that had 50 multiple choice questions. The questions were very standard and covered everything like java, C, C++, Python, CSS, DBMS, OOPs, Networks, OS etc.
After the first round 20 people were shortlisted for the second round.
Second round
Duration : 45 minutesThe second round was a coding round where we were given only one question. The objective of the round was not only to check whether the logic and code was correct but whether the students have used paradigms of the programming language they chose. for example, if we choose java to write our code we must have used OOPs principles.
The question was to encode the given string in a format specified.
Input : this is a secret
procedure :
1. remove the spaces, s = thisisasecret
2. find the length of s, l = 13
3. find w which is the ceil of sqrt of l, w = 4
4. separate s using w, s= this isas ecre t
5. encode the string by taking the first character of each word from as the first word of the new string and the second character of each word from s as the second word of the new string and so on..
encoded string = tiet hsc iar sse
Output : tiet hsc iar sse
This comment has been removed by the author.
ReplyDeletei have solution of this problem, can i post if you allow to me
ReplyDeleteyes
DeleteYes
Deletecan u post the solution.
Deletecan u post the solution.
ReplyDeletelanguage:python
ReplyDeleteThis is the solution
n='this is a secret'
res=''
for i in n:
if i!=' ':
res+=i
print(res)
l=len(res)
print(l)
r=int((l**0.5)//1+1)
print(r)
ee=[]
for i in res:
if not res:
break
ee.append(res[0:4])
res=res[4:]
p=' '.join(ee)
print(p)
print(ee)
w=[]
for i in ee:
ll=[ j for j in i]
w.append(ll)
for i in range(len(w)):
for j in w:
if j:
print(j.pop(0),end='')
print(end=' ')
This solution contains implementation of OOP
class StringManipulation:
def __init__(self, input_string):
self.input_string = input_string
def remove_spaces(self):
self.input_string = ''.join(self.input_string.split())
def calculate_length(self):
return len(self.input_string)
def chunk_string(self):
chunk_size = int((self.calculate_length() ** 0.5) // 1 + 1)
chunks = [self.input_string[i:i + chunk_size] for i in range(0, len(self.input_string), chunk_size)]
return chunks
def display_chunks(self):
chunks = self.chunk_string()
for chunk in chunks:
print(chunk, end=' ')
def transform_to_matrix(self):
chunks = self.chunk_string()
matrix = [list(chunk) for chunk in chunks]
return matrix
def print_matrix_transpose(self):
matrix = self.transform_to_matrix()
for i in range(len(matrix[0])):
for row in matrix:
if row:
print(row.pop(0), end='')
print(end=' ')
# Main code
initial_string = 'this is a secret'
string_manipulator = StringManipulation(initial_string)
string_manipulator.remove_spaces()
print(f"Processed String: {string_manipulator.input_string}")
length = string_manipulator.calculate_length()
print(f"Length of String: {length}")
print("Chunks:")
string_manipulator.display_chunks()
print()
print("Matrix:")
matrix = string_manipulator.transform_to_matrix()
for row in matrix:
print(''.join(row), end=' ')
print("\nTransposed Matrix:")
string_manipulator.print_matrix_transpose()