Select Page
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

## Interview MCQ Set 1

1. __________ is the set of hierarchies from which data is retrieved for a single member.
a) Slicer axis
b) Query axes
c) Dice axis
d) All of the mentioned

Answer: a [Reason:] query and slicer axes can be constructed from multiple hierarchies of the cube to be queried

2. Point out the correct statement :
a) Only droping the default member is supported in MDX Scripting
b) In the SELECT statement, the FROM clause determines the cube context
c) Very few cube can control how errors within a Multidimensional Expressions (MDX) script are handled
d) None of the mentioned

Answer: b [Reason:] This context can be the whole cube or just a subcube from that cube. Having specified cube context through the FROM clause, you can use additional functions to expand or restrict that context.

3. When you include a many-to-many dimension, the following rules apply
a) You must add the intermediary measure group
b) You must add the entire many-to-many dimension
c) You must add the entirety of all dimensions common to the two measure groups involved in the many-to-may relationship
d) All of the mentioned

Answer: d [Reason:] Reference dimensions are materialized and added as regular dimensions.

4. _________ statement is used to write back data to any cell in a cube that aggregates to its parent using the SUM aggregation.
a) UPDATE CUBE
b) DELETE CUBE
c) ALTER CUBE
d) None of the mentioned

Answer: a [Reason:] You can update the value of a specified leaf or nonleaf cell in a cube, optionally allocating the value for a specified non-leaf cell across dependent leaf cells.

5. Point out the wrong statement :
a) A weight expression should be expressed as a decimal value between zero (0) and 1
b) Each UPDATE CUBE allocation should be considered to be atomic for transactional purposes
c) When updated cells overlap, the Update Isolation Level connection string property can be used to enhance performance for UPDATE CUBE
d) None of the mentioned

Answer: c [Reason:] When updated cells do not overlap, the Update Isolation Level connection string property can be used to enhance performance for UPDATE CUBE.

6. Which of the following scenario demonstrates USE_EQUAL_INCREMENT allocation method ?
a)

```<leaf cell value> =
<NEW Value> / COUNT(leaf cells that are contained IN <tuple>)```

b)

`<leaf cell value> = < NEW Value> * Weight_Expression`

c)

```<leaf cell value> = <leaf cell value> +
(<NEW VALUE > - <existing value>) /
COUNT(leaf cells contained IN <tuple>)```

d)

```<leaf cell value> = <leaf cell value> +
(<NEW Value> - <existing value>)  * Weight_Expression```

Answer: c [Reason:] Every leaf cell that contributes to the updated cell will be changed.

7. If a weight expression is not specified, the UPDATE CUBE statement implicitly uses the following expression:
a) Weight_Expression = *
b) Weight_Expression = /
c) Weight_Expression =
d) Weight_Expression = +

Answer: b [Reason:] It may be helpful to think of the UPDATE CUBE statement as a subroutine that will automatically generate a series of individual cell writeback operations to leaf and non-leaf cells that will roll up into a specified sum.

8. When used on a measure that contains integers, the _________ method can return imprecise results caused by incremental rounding changes.
a) USE_EQUAL_ALLOCATION
b) USE_WEIGHTED_ALLOCATION
c) USE_WEIGHTED_INCREMENT
d) All of the mentioned

Answer: b [Reason:] Every leaf cell that contributes to the updated cell will be assigned an equal value

9. Which of the following is valid syntax for DRILLTHROUGH statement ?
a)

```DRILLTHROUGH[MAXROWSUnsigned_Integer]
<MDX SELECT statement>
[RETURNSet_of_Attributes_and_Measures
[,Set_of_Attributes_and_Measures ...]
]```

b)

```DRILL[MAXROWSUnsigned_Integer]
<MDX SELECT statement>
[RETURNSet_of_Attributes_and_Measures
[,Set_of_Attributes_and_Measures ...]
]```

c)

```DRILLTHROUGH[MAXROWSUnsigned_Integer]
<MDX SELECT statement>```

d) None of the mentioned

Answer: a [Reason:] DRILLTHROUGH statement retrieves the underlying table rows that were used to create a specified cell in a cube.

10. Which of the following keyword forces a specified set to be evaluated within the current context ?
a) SCOPE
b) CASE
c) EXISTING
d) FREEZE

Answer: c [Reason:] By default, sets are evaluated within the context of the cube that contains the members of the set.

## Interview MCQ Set 2

AB = BC = CD = 20m
All moment options are given in KN/m and all rotations in rad.
EI is constant.

1. How many deflection unknowns will be there in this case for which we would need equations?
a) 0
b) 1
c) 2
d) 3

Answer: a [Reason:] Initially, there will be 3 displacement unknowns, but all of them will come out to be zero as it is non-sway frame.

2. How many unknowns will be left finally which are non-zero?
a) 0
b) 1
c) 2
d) 3

Answer: c [Reason:] Rotation at points B and C will be left finally to be calculated from equations.

3. How many total slope deflection equations will be written in this question?
a) 8
b) 6
c) 4
d) 3

Answer: b [Reason:] 3 members are there and non joint has a zero moment, so there will be 6 sde equations.

4. What will be the FEMAB ?
a) 80
b) -80
c) 0
d) 160

Answer: c [Reason:] No load is acting on the member AB and same goes for member CD.

5. Which of the following set of points should be chosen to generate extra equations?
a) A and B
b) B and C
c) C and D
d) D and A

Answer: b [Reason:] All unknown will come in account if we conserve moment about points B and C.

6. What will be one of the extra condition, which we will get if we conserve moment near joint B?
a) mBA + mCA = 0
b) mBA + mCB = 0
c) mBA + mBC = 0
d) mAB + mBC = 0

Answer: c [Reason:] Just cut a small part near joint B and conserve moment around that joint.

7. What will be one of the extra condition, which we will get if we conserve moment near joint C?
a) mBA + mCA = 0
b) mBA + mCB = 0
c) mBA + mBC = 0
d) mCD + mCB = 0

Answer: D [Reason:] Just cut a small part near joint B and conserve moment around that joint.

8. What will be the value of rotation at point B?
a) 22.2/EI
b) -22.2/EI
c) 0
d) 100/EI

Answer: a [Reason:] Just use both equations as given above.

9. What will be the value of rotation at point C?
a) 22.2/EI
b) -22.2/EI
c) 0
d) 100/EI

Answer: b [Reason:] Just use both equations as given above.

10. What will be the value of mAB?
a) 22.2
b) 44.4
c) -44.4
d) -22.2

Answer: a [Reason:] Just substitute the value of rotation at point B in sde equation.

11. What will be the value of mBA?
a) 22.2
b) 44.4
c) -44.4
d) -22.2

Answer: b [Reason:] Just substitute the value of rotation at point B in sde equation.

12. What will be the value of mBC?
a) 22.2
b) 44.4
c) -44.4
d) -22.2

Answer: c [Reason:] Just substitute the value of rotation at point B and at point C in sde equation.

13. What will be the value of mCB?
a) 22.2
b) 44.4
c) -44.4
d) -22.2

Answer: b [Reason:] Just substitute the value of rotation at point B and at point C in sde equation.

14. What will be the value of mCD?
a) 22.2
b) 44.4
c) -44.4
d) -22.2

Answer: c [Reason:] Substitute the value of rotation at point C in equation.

15. What will be the value of mDC?
a) 22.2
b) 44.4
c) -44.4
d) -22.2

Answer: b [Reason:] Substitute the value of rotation at point C in equation.

## Interview MCQ Set 3

1. What is the output of the following?

```x = ['ab', 'cd']
print(len(list(map(list, x))))))```

a) 2
b) 4
c) error
d) none of the mentioned

Answer: c [Reason:] SyntaxError, unbalanced parenthesis.

2. What is the output of the following?

```x = ['ab', 'cd']
print(list(map(list, x)))```

a) [‘a’, ‘b’, ‘c’, ‘d’].
b) [[‘ab’], [‘cd’]].
c) [[‘a’, ‘b’], [‘c’, ‘d’]].
d) none of the mentioned

Answer: c [Reason:] Each element of x is converted into a list.

3. What is the output of the following?

```x = [12, 34]
print(len(list(map(len, x))))```

a) 2
b) 1
c) error
d) none of the mentioned

Answer: c [Reason:] TypeError, int has no len().

4. What is the output of the following?

```x = [12, 34]
print(len(list(map(int, x))))```

a) 2
b) 1
c) error
d) none of the mentioned

Answer: a [Reason:] list(map()) returns a list of two items in this example.

5. What is the output of the following?

```x = [12, 34]
print(len(''.join(list(map(int, x)))))```

a) 4
b) 2
c) error
d) none of the mentioned

Answer: c [Reason:] Cannot perform join on a list of ints.

6. What is the output of the following?

```x = [12, 34]
print(len(''.join(list(map(str, x)))))```

a) 4
b) 5
c) 6
d) error

Answer: a [Reason:] Each number is mapped into a string of length 2.

7. What is the output of the following?

```x = [12, 34]
print(len(' '.join(list(map(int, x)))))```

a) 4
b) 5
c) 6
d) error

Answer: d [Reason:] TypeError. Execute in shell to verify.

8. What is the output of the following?

```x = [12.1, 34.0]
print(len(' '.join(list(map(str, x)))))```

a) 6
b) 8
c) 9
d) error

Answer: c [Reason:] The floating point numbers are converted to strings and joined with a space between them.

9. What is the output of the following?

```x = [12.1, 34.0]
print(' '.join(list(map(str, x))))```

a) 12 1 34 0
b) 12.1 34
c) 121 340
d) 12.1 34.0

Answer: d [Reason:] str(ab.c) is ‘ab.c’.

10. What is the output of the following?

```x = [[0], [1]]
print(len(' '.join(list(map(str, x)))))```

a) 2
b) 3
c) 7
d) 8

Answer: c [Reason:] map() is applied to the elements of the outer loop.

## Interview MCQ Set 4

1. What is the output of the following?

```x = 'abcd'
for i in x:
print(i)
x.upper()```

a) a B C D
b) a b c d
c) A B C D
d) error

Answer: b [Reason:] Changes do not happen in-place, rather a new instance of the string is returned.

2. What is the output of the following?

```x = 'abcd'
for i in x:
print(i.upper())```

a) a b c d
b) A B C D
c) a B C D
d) error

Answer: b [Reason:] The instance of the string returned by upper() is being printed.

3. What is the output of the following?

```x = 'abcd'
for i in range(x):
print(i)```

a) a b c d
b) 0 1 2 3
c) error
d) none of the mentioned

Answer: c [Reason:] range(str) is not allowed.

4. What is the output of the following?

```x = 'abcd'
for i in range(len(x)):
print(i)```

a) a b c d
b) 0 1 2 3
c) error
d) 1 2 3 4

Answer: b [Reason:] i takes values 0, 1, 2 and 3.

5. What is the output of the following?

```x = 'abcd'
for i in range(len(x)):
print(i.upper())```

a) a b c d
b) 0 1 2 3
c) error
d) 1 2 3 4

Answer: c [Reason:] Objects of type int have no attribute upper().

6. What is the output of the following?

```x = 'abcd'
for i in range(len(x)):
i.upper()
print (x)```

a) a b c d
b) 0 1 2 3
c) error
d) none of the mentioned

Answer: c [Reason:] Objects of type int have no attribute upper().

7. What is the output of the following?

```x = 'abcd'
for i in range(len(x)):
x[i].upper()
print (x)```

a) abcd
b) ABCD
c) error
d) none of the mentioned

Answer: a [Reason:] Changes do not happen in-place, rather a new instance of the string is returned.

8. What is the output of the following?

```x = 'abcd'
for i in range(len(x)):
i[x].upper()
print (x)```

a) abcd
b) ABCD
c) error
d) none of the mentioned

Answer: c [Reason:] Objects of type int aren’t subscriptable. However, if the statement was x[i], an error would not have been thrown.

9. What is the output of the following?

```x = 'abcd'
for i in range(len(x)):
x = 'a'
print(x)```

a) a
b) abcd abcd abcd
c) a a a a
d) none of the mentioned

Answer: c [Reason:] range() is computed only at the time of entering the loop.

10. What is the output of the following?

```x = 'abcd'
for i in range(len(x)):
print(x)
x = 'a'```

a) a
b) abcd abcd abcd abcd
c) a a a a
d) none of the mentioned

Answer: d [Reason:] abcd a a a is the output as x is modified only after ‘abcd’ has been printed once.

## Interview MCQ Set 5

1. Consider the following iterative implementation used to find the length of a linked list:

```struct Node
{
int val;
struct Node *next;
int get_len()
{
struct Node *temp = head->next;
int len = 0;
while(_____)
{
len++;
temp = temp->next;
}
return len;
}```

Which of the following conditions should be checked to complete the above code?
a) temp->next != 0
b) temp == 0
c) temp != 0
d) none of the mentioned

Answer: c [Reason:] The condition “temp != 0” should be checked to complete the above code.

2. What is the output of the following code?

```#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node *next;
int get_len()
{
struct Node *temp = head->next;
int len = 0;
while(temp != 0)
{
len++;
temp = temp->next;
}
return len;
}
int main()
{
int arr[10] = {1,2,3,4,5}, n = 5, i;
struct Node *temp, *newNode;
head = (struct Node*)malloc(sizeof(struct Node));
for(i=0; i<n; i++)
{
newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->val = arr[i];
newNode->next = 0;
temp->next = newNode;
temp = temp->next;
}
int len = get_len();
printf("%d",len);
return 0;
}```

a) 4
b) 5
c) 6
d) 7

Answer: b [Reason:] The program prints the length of the linked list, which is 5.

3. What is the time complexity of the above iterative implementation used to find the length of a linked list?
a) O(1)
b) O(n)
c) O(n2)
d) O(logn)

Answer: b [Reason:] The time complexity of the above iterative implementation used to find the length of a linked list is O(n).

4. What is the output of the following code?

```#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node *next;
int get_len()
{
struct Node *temp = head->next;
int len = 0;
while(temp != 0)
{
len++;
temp = temp->next;
}
return len;
}
int main()
{
int arr[10] = {1,2,3,4,5}, n = 5, i;
struct Node *temp, *newNode;
head = (struct Node*)malloc(sizeof(struct Node));
int len = get_len();
printf("%d",len);
return 0;
}```

a) 0
b) Garbage value
c) Compile time error
d) Runtime error

Answer: a [Reason:] The program prints the length of the linked list, which is 0.

5. Which of the following can be the base case for the recursive implementation used to find the length of linked list?
a) if(current_node == 0) return 1
b) if(current_node->next == 0) return 1
c) if(current_node->next == 0) return 0
d) if(current_node == 0) return 0

Answer: d [Reason:] The line “if(current_node == 0) return 0” can be used as a base case in the recursive implementation used to find the length of a linked list. Note: The line “if(current_node->next == 0) return 1” cannot be used because it won’t work when the length of the linked list is zero.

6. Which of the following lines should be inserted to complete the following recursive implementation used to find the length of a linked list?

```#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node *next;
int recursive_get_len(struct Node *current_node)
{
if(current_node == 0)
return 0;
return _____;
}
int main()
{
int arr[10] = {1,2,3,4,5}, n = 5, i;
struct Node *temp, *newNode;
head = (struct Node*)malloc(sizeof(struct Node));
for(i=0; i<n; i++)
{
newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->val = arr[i];
newNode->next = 0;
temp->next = newNode;
temp = temp->next;
}
int len = recursive_get_len(head->next);
printf("%d",len);
return 0;
}```

a) recursive_get_len(current_node)
b) 1 + recursive_get_len(current_node)
c) recursive_get_len(current_node->next)
d) 1 + recursive_get_len(current_node->next)

Answer: d [Reason:] The line “1 + recursive_get_len(current_node->next)” should be inserted to complete the above code.

7. What is the output of the following code?

```#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node *next;
int recursive_get_len(struct Node *current_node)
{
if(current_node == 0)
return 0;
return 1 + recursive_get_len(current_node->next);
}
int main()
{
int arr[10] = {-1,2,3,-3,4,5,0}, n = 7, i;
struct Node *temp, *newNode;
head = (struct Node*)malloc(sizeof(struct Node));
for(i=0; i<n; i++)
{
newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->val = arr[i];
newNode->next = 0;
temp->next = newNode;
temp = temp->next;
}
int len = recursive_get_len(head->next);
printf("%d",len);
return 0;
}```

a) 6
b) 7
c) 8
d) 9

Answer: b [Reason:] The program prints the length of the linked list, which is 7.

8. What is the time complexity of the above code used to find the length of a linked list?
a) O(1)
b) O(n)
c) O(n2)
d) O(n3)

Answer: b [Reason:] To find the length of the linked list, the program iterates over the linked list once. So, the time complexity of the above code is O(n).

9. What is the output of the following code?

```#include<stdio.h>
#include<stdlib.h>
struct Node
{
int val;
struct Node *next;
int recursive_get_len(struct Node *current_node)
{
if(current_node == 0)
return 0;
return 1 + recursive_get_len(current_node->next);
}
int main()
{
int arr[10] = {-1,2,3,-3,4,5}, n = 6, i;
struct Node *temp, *newNode;
head = (struct Node*)malloc(sizeof(struct Node));
for(i=0; i<n; i++)
{
newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->val = arr[i];
newNode->next = 0;
temp->next = newNode;
temp = temp->next;
}
int len = recursive_get_len(head->next);
printf("%d",len);
return 0;
}```

a) 5
b) 6
c) 7
d) 8