Assessment Part 2
Assessment Part 2
Assessment Part 2
1. Rendering a component A which in turn rendering another component B. You want the
component B to hide itself even after the rendering. What will you do to prevent the rendering
of B?
a. Using Composition
b. Using context
c. Using state
d. Using callback
ANSWER: C
ANSWER: They are related but. It is need to. Props get passed to the component (similar to function
parameters
ANSWER: A
5. What are the differences between Stateless Components and Stateful Components?
ANSWER: In React, a stateful component is a component that holds some state. Stateless components,
by contrast, have no state.
ANSWER: Callback indicates the expected ending of execution and Return. Promise object represents
the eventual completion (or failure) of an asynchronous operation and its resulting value.
7. What is React Router?
8. What is Typescript?
ANSWER: Ffree and open source programming language developed and maintained by Microsoft
ANSWER: A
10. What happens when you call setState() inside render() method?
a. Repetitive output appears on the screen
b. Stack overflow error
c. Duplicate key error
d. Nothing happens. Life goes on!
ANSWER: D
11. The MongoDB explain() method does not support which of the following verbosity mode:
a. queryPlanner
b. executionStats
c. allPlansExecution
d. customExecutionStats
ANSWER: D
12. What does the following aggregate query perform?
db.posts.aggregate( [
{ $match : { likes : { $gt : 100, $lte : 200 } } },
{ $group: { _id: null, count: { $sum: 1 } } }
] );
a. Calculates the number of posts with likes between 100 and 200
b. Groups the posts by number of likes (101, 102, 103) by adding 1 every time
c. Fetches the posts with likes between 100 and 200 and sets their _id as null
d. Fetches the posts with likes between 100 and 200, sets the _id of the first document as
null and then increments it 1 every time
ANSWER: B
13. If you have created a compound index on (A, B, C) which of the following access pattern will not
be able to utilize the index?
a. A, B, C
b. A, B
c. B, C
d. A
ANSWER: C
ANSWER: D
15. Consider that the posts collection contains an array called ratings which contains ratings given to
the post by various users in the following format:
{
_id: 1,
post_text: "This is my first post",
ratings: [5, 4, 2, 5],
//other elements of document
}
Which of the following query will return all the documents where the ratings array contains
elements that in some combination satisfy the query conditions?
ANSWER: B
16. Which prop takes a function to be called every time there is a text changed for input type text in
ReactJS
a. onChangeText
b. ChangeText
c. onText
d. None of the above
ANSWER: B
17. Which prop type in a React form component, will validate a value for an attribute is passed and
of type function
a. React.Prop.func
b. React.PropTypes.func
c. React.PropTypes.func.isRequired
d. React.Prop.func.isRequired
ANSWER: B
18. Rendering of JSX file, requires
a. JQuery
b. React-DOM
c. React
d. Browserify
ANSWER: B
ANSWER: A
ANSWER: A