Platform: Hackerearth

Maximum Score: 50.0

 

7 General MCQs (5.0 marks each)


  1. There is lockdown due to covid.

    Ram and Gopal have decided to meet at a bus stop between 2PM to 3PM. At the bus stop a person can wait only upto 15 minutes.

    If a person comes to the bus stop, he will wait for 15 minutes, or upto 3 PM, or till the other person comes up, whichever event happens earlier.

    What is the probability that Ram gets covid given that Gopal is covid positive?

    a. 3/4

    b. 3/16

    c. 1/4

    d. 13/16

  2. Consider 3 equations -

    $x-y+2z = 1$

    $2x-y+7z=2$

    $-x+2y+z=b$

    where 'b' is an integer. Which of the following is true?

    a. The system has no solution if b=-1

    b. The system has more than one solution if b=-2

    c. The system has no solution if b=3

    d. None of the above

  3. Given a spam email detector. It detects if the email is spam or not by checking the subject line "Read this email!". If the subject line matches then the email is detected as a spam.

    It is known that 4 out of 10 emails are spam.

    1 percent of the spam emails have the subject line "Read this email!"

    1 out of 250 non-spam emails have the subject line "Read this email!"

    Find the probability that an email is spam given that spam detector marked it as spam?

    a. 0.33

    b. 0.625

    c. 0.25

    d. 0.0125

  4. Given two column vectors u and v of size n each.

    $W = uv^T + vu^T$

    $X=u^Tv+v^Tu$

    Which of the following statement is true?

    a. The matrix W and matrix X are scalar.

    b. The matrix W is a scalar and X is nxn.

    c. The matrix W is always symmetric and nxn and X is a scalar.

    d. The matrix W is nxn and X is a scalar.

  5. Given a program to print the nth fibonacci number.

    *A simple program to print the nth fibonacci number was given.*
    

    What is the time complexity to find fib(n)?

    a. O(n)

    b. O(n^2) – This was an error in the options, it should be O(2^n)

    c. O(logn)

    d. O(nlogn)

  6. Given $u=[a \ b \ c]^T$ and $A=\begin{bmatrix} a^2 & ab & ac \\ ab & b^2 & bc \\ ac & bc & c^2 \end{bmatrix}$is a 3x3 matrix $A=uu^T$. Given that a, b, c are all non zero real numbers. Which of the following statement is true about matrix A?

    a. The matrix has three nonzero eigen values.

    b. The matrix has two complex and one real eigen value.

    c. The matrix has exactly two nonzero eigen values.

    d. The matrix has exactly one nonzero eigen value.

  7. Given a graph of a function f(x).

    The graph of $f(x-1) + f(x-4)$ will be:

 

2 Programming Questions


  1. Write a program to print the given matrix in clockwise spiral order. (10 marks)

  2. Write a program to check if a matrix is diagonally dominant. (5 marks)

    A matrix is diagonally dominant if for every row of the matrix, the magnitude of diagonal element is greater than or equal to the sum of magnitude of all non-diagonal elements of that row.

    Note: The matrix contains values of type float.

posted in Interview Experience Jun 23, 2021
2,523 views
8
Like
0
Love
0
Haha
0
Wow
0
Angry
0
Sad

1 Comment

1 comment

Like
Can someone confirm the answers of MCQs?

1. d

2. d

3. b

4. d

5.

6. d

7. b