Hold on!
Fetching your data...
Scaler Assessment Test - DSML Sep22
Performance Report
  punitkmr95@gmail.com
  Scaler Assessment Test - DSML Sep22
4.0
/100
Score
Duration : 2 hours
Total Questions : 14
Attempted : 2 Solved : 2
Start Time : Tuesday, 23 Aug 2022 6:48 AM UTC
QUESTION STATS

S1  Intermediate Section  (20/250)

#
Topic
Type/Language
Score
Status
Actions
1
Strings
Python 3 (python-3.8)
0.0 / 100.0
6% solved this
Unsolved
Max Occurring

Problem Description

You are given a character string A having length N.

You have to find the character having maximum number of occurrences in the string and return its ASCII code.

If there are multiple such characters, then return the ASCII code having least value.

                                                image



Problem Constraints

1 <= N <= 105

A[i]['a'-'z']



Input Format

First and only argument is a character string A.



Output Format

Return a single integer denoting the ASCII code of the character.



Example Input

Input 1:

 A = "abbcc"

Input 2:

 A = "eeeeee"



Example Output

Output 1:

 98 

Output 2:

 101 



Example Explanation

Explanation 1:

 Number of occurrences of 'a'(ASCII code = 97) = 1
 Number of occurrences of 'b'(ASCII code = 98) = 2(max)
 Number of occurrences of 'c'(ASCII code = 99) = 2(max)
 Characters 'b' and 'c' both have maximum number of occurrences = 2, So we return the ASCII code of character having least
 ASCII code amongst them: 98('b')

Explanation 2:

 Number of occurrences of 'e'(ASCII code = 101) = 6(max).



User Code

 class Solution:
    # @param A : string
    # @return an integer
    def solve(self, A):
 

2
Python
0.0 / 10.0
54% solved this
Unsolved
Equalised elements

What would be the output of the following code snippet?


arr = [2, 4, 6, 8, 10]
for i in range(len(arr)):
 for j in arr:
   if arr[i] == j:
     print(i, j)



a.<pre>0 2
1 4
2 6
3 8
4 10</pre>

b.<pre>1 2
2 4
3 6
4 8
5 10</pre>

c.<pre>2 0
4 1
6 2
8 3
10 4</pre>

d.<pre>2 1
4 2
6 3
8 4
10 5</pre>






3
dsml
0.0 / 100.0
3% solved this
Not Opened
Perform Batch Normalization

Problem Description

Given an array X, the value of gamma and beta. Perform Batch Normalization on array X.

Use the formulas below to compute the X_updated array.

  • n -> size of X
  • mu -> mean of array X
  • sig -> standard deviation of array X
  • standard-deviance = sqrt ( sum[ (Xi - mu)2 ] / n-1 )
  • X_standardised = (X- mu)/sig
  • X_updated = gamma*X_standardised + beta

Return the X_updated array.

Note - X_updated[i] should be up to 2 decimal places.</div>



Problem Constraints

1 <= n <= 1000

1 <= X[i] <= 100

-10 <= gamma, beta <= 10</div>



Input Format

The first line of the input contains integer n, size of array X.
The second line of the input contains n numbers which denote elements of X.
The third line contains a number, gamma.
The fourth line contains a number, beta.</div>



Output Format

Print X_updated array in a single line.</div>



Example Input

8
1 3 2 5 7 3 2 4
2
1</div>



Example Output

-1.47 0.61 -0.43 2.69 4.77 0.61 -0.43 1.65</div>



User Code

  

4
Python
10.0 / 10.0
32% solved this
Solved
String Science

What will be the output of the following code?

data = "Learning Data Science"
st = ""
for i in range(len(data)):
    st =  data[i] + st
print(st)

 






5
Python
0.0 / 10.0
47% solved this
Not Opened
Scope

What will be the output of the following code?

a = 5
b = 10
def func():
   b = 15
   print(a)
   print(b)
print(a)
func()
print(b)

a.<pre>5
5
15
10</pre>
b.<pre>5
15
15
10</pre>
c.<pre>10
5
5
15
</pre>
d.<pre>5
10
5
10</pre>






6
Statistics
0.0 / 10.0
51% solved this
Not Opened
New Weight

The average weight of 10 people increased by 3 kg when a new person replaced one of the existing person who weighed 70 kg. What is the weight of the new person?






7
Statistics
10.0 / 10.0
58% solved this
Solved
Transpose

Given two matrices A and B, find the transpose of matrix (A+B).

A =    

[[1, 5, 7, 6],
[4, 1, 6, 4],
[7, 2, 7, 6]]

B =

[[4, 0, 1, 2], 
[2, 3, 0, 4],
[1, 3, 2, 0]]

 

a.

[[5, 6, 8], 
[5, 4, 5],
[8, 6, 9],
[8, 8, 6]]

b. 

[[5, 5, 8, 8], 
[6, 4, 6, 8],
[8, 5, 9, 6]]

c.

[[3, 5, 6, 4], 
[ 2, 2, 6, 0],
[ 6, 1, 5, 6]]

d.

[[3, 2, 6], 
[ 5, 2, 1],
[ 6, 6, 5],
[ 4, 0, 6]]






S2  Advanced Section  (0/250)

#
Topic
Type/Language
Score
Status
Actions
1
Python
0.0 / 10.0
37% solved this
Not Opened
Inheritance

 

What will be the output of the following code?

class Rectangle:
    def __init__(self):

        print("Rectangle's init method invoked")

    def area(self):

        print("Area of Rectangle is Length*Width")

 

class Square(Rectangle):

    def __init__(self):

        print("Square's init method invoked")

    def area(self):

        print("Area of Square is Side*Side")

def main():

    obj1 = Square()
    obj2 = Rectangle()
    obj1.area()

main()

 




A. Square’s init method invoked

    Rectangle’s init method invoked

    Area of Rectange is Length*Width



B. Square’s init method invoked

    Rectangle’s init method invoked

 

C.Square’s init method invoked

   Rectangle’s init method invoked

   Area of Square is Side*Side

 

D.Rectangle’s init method invoked

   Square’s init method invoked

   Area of Square is Side*Side








2
Python
0.0 / 100.0
6% solved this
Not Opened
Audit analysis

Problem Description

You are hired by an audit firm to work in their tech team. The firm has performed several audits over the years and have recorded the dates on which it has been done. The manager has now asked you to figure out how many audits have been done more than 5 years back. That is the audits that are more than 5 years old but not equal. Complete the python function to perform this job and return the list of audits.</div>

 </div>

Note: The duration of audit is calculated only based on the years. (Current year - Audit Year) is the duration of audit.</div>



Input Format

List of Dates on which the audits have been performed.</div>



Output Format

The list of audits that have been done more than 5 years back.</div>



Example Input

audits = [‘001_20/09/2012’, ‘002_23/11/2014’, ‘003_10/10/2016’, ‘004_03/11/2017’, ‘201_19/10/2018’, ‘204_17/11/2019’, ‘218_09/09/2020’, ‘222_05/12/2021’ ]</div>



Example Output

[‘001’, ‘002’, ‘003’]



User Code

  

3
Python
0.0 / 100.0
4% solved this
Not Opened
Pair the students

Problem Description

You teach a class of students. You plan to make a pair where you want to pair 2 of your students who live closest to each other. The map along with the coordinates of each student's house is available to you. Can you find the students whom you can pair? You are given 2 lists containing the students name and locations. Manhattan Distance will be used to calculate the distance between 2 points.

Manhattan Distance between 2 points (x1,y1) and (x2,y2) is given by |x1-x2| + |y1-y2|.


Input Format
Name list containing names of all the students
Location containing the locations in the form of (x,y) of the students


Output Format
[Student1, Student2] Name of students to pair in a list


Example Input
names = [“Adam”,”Millie”,”Jacob”,Michael”,”Maxine”]
loc = [(1,2),(5,4),(0,3),(2,3),(0,0)]


Example Output
[‘Adam’,‘Jacob’]


User Code

  

4
Calculus
0.0 / 10.0
39% solved this
Not Opened
p-th Norm of Vector

The p-th norm (“p” is an integer and p>=1) of a vector X having n- dimensions is given by

Suppose you are given a vector A = (2,3,4,1,5). Find the 2nd Norm of the vector X.






5
DSML Adv : Combinatorics
0.0 / 10.0
47% solved this
Not Opened
Seating Arrangement MCQ

In how many ways can 5 boys and 4 girls in a row such that they are seated alternatively?

 






6
Calculus
0.0 / 10.0
31% solved this
Not Opened
Tesla Car Analysis

You are working as a Data Scientist at Tesla. The self-driving cars are being modified for their speed and acceleration. After a lot of iterations finally the team has stumbled upon the equation of velocity with respect to time.

$V = 5t^{3} + 2t^{2} + 6t $

Can you calculate the acceleration of the car when the car has already started for 2 seconds?

 

Note: acceleration is the rate of change of velocity with respect to time.






7
Python
0.0 / 10.0
42% solved this
Not Opened
Incomplete Recursion

Adam has come up with an interesting recursive function to calculate the power of a number without using any looping statements. But he is stuck in completing the base and recursive cases.

def power(num,pow):

          if pow==0:

                //base case

          else:

               //recursive case

 

Given the function, choose the correct code snippet for making the function complete.






Candidate Event Log

Time Event Name IP Address
Tue, 23 Aug 2022 06:48:45 +0000 Assessments Page Load 49.37.174.225
Tue, 23 Aug 2022 06:48:52 +0000 Assessments Page Load 49.37.174.225
Tue, 23 Aug 2022 06:48:53 +0000 Assessments Page Load 49.37.174.225