Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Devops Assignment - Atmana

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

1. You are given 1 string of alphabetical characters.

Each character can


occur 1 or more times. Put every third character into an array (3 rd, 6th, 9th,
12th,..........). Print the arrays and also the maximum recurring element.
Sample Input 1:
S = “abcbjjfgqaazckuccccpcp”
Sample Output:
[ c, j, g, a, k, c, c]
Maximum recurring character: c

2. You are given a sorted array of integers. Each element in the array occurs
2 times expect one element. Find the element that occurs just once in the
array in just O(logN) time and O(1) extra space.
Sample Input 1:

Array = 1,1,2,2,3,4,4

Output Input 1:

3. Aman is the CEO of a security company. He wants to send a secret


message S to his colleague. The message is a single word consisting of
only lowercase English letters but due to security reasons he decides to
encrypt the message and makes a string X of length Y, such that after
deleting a substring of non-zero length from X, the remaining string is S.
Calculate the number of all such possible strings X he can form.
Sample Input 1:
Y = 3, S = a
Sample Output 1:
1326

Sample Input 2:
Y = 3, S = ab
Sample Output:
76

4. In the geometrical world of Fireland, the Triangles were having their


sports day and wanted to end it with a nice formation. So, they called
upon Mr. Circle from Spaceland for help. Mr. Circle decides to arrange
the Triangles in square formations. He starts with N Triangles and forms
the largest possible square using these Triangles. He then takes the
remaining Triangles and repeats the procedure. A square of side S
requires S^2 (S to the power 2) Triangles to create.
Find the number of squares he will be able to form at the end of the
process.
Sample Input 1:

N = 85

Sample Output 1: 2

Sample Input 2:

N = 114

Sample Output 2: 4

5. Rahul recently visited Atmana’s Cafe and was highly impressed by the
food. Being a food enthusiast, he decided to enquire about the ingredients
of each dish. There are N dishes represented by strings S1,S2,…,SN.
Each ingredient used for making dishes in Atmana’s Cafe is represented
by a lowercase English letter. For each valid i, the ingredients used to
make dish i correspond to characters in the string Si (note that ingredients
may be used multiple times). A special ingredient is an ingredient which
is present in each dish at least once. Chef wants to know the number of
special ingredients in Atmana's Cafe. Since Chef is too busy with work,
can you help him?
Sample Input 1:
N=3
S1 = abcaa, S2 = bcbd, S3 = bgc
Sample Output: 2

Sample Input 2:
N=3
S1 = quick, S2 = brown, S3 = fox
Sample Output: 0

6. You are given with a list of words. For each word in a list, if any two
adjacent characters are equal, change one of them to any random
character. Determine the minimum number of substitutions so the final
string contains no adjacent equal characters.
Sample Input 1:
['add', 'boook', 'break']
Sample Output 2:
[1,1,0]

Explanation:
'add': change one d (1 change)
'boook': change the middle o (1 change)
'break': no changes are necessary (0 changes)
7. Scenario:
a. You need to install and setup docker on 10 ec2 instances, IP of those instances
are already known.
b. You also need to create a user called “deploybot” on each host, and that user
should be able to run all docker commands without using sudo
c. Question
i. What tools you will use, write and describe tools you choose, and a
working script/solution which when executed perform above 2 tasks
8. Scenario:
a. You are given admin access to one AWS account which runs production
workloads
b. Question
i. What all steps you will review to ensure account and its services are
running securely
9. Scenario
a. Using the sample logs from
https://raw.githubusercontent.com/elastic/examples/master/Common%20Data
%20Formats/apache_logs/apache_logs
b. Question:
i. List out count of all status codes, output syntax doesn’t matter
1. {'200': 9125, '304': 445, '404': 213, '301': 164, '206': 45, '500': 3,
'403': 2, '416': 2}
ii. List top 3 IP which are making requests

You might also like