Assessment Part 2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

FULL STACK DEVELOPER ASSESSMENT

Part II TALIB, HAZIR V.

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

2. In ReactJs what are the differences between Props and State?

ANSWER: They are related but. It is need to. Props get passed to the component (similar to function
parameters

3. Enumerate some lifecycle methods in a React component.

ANSWER: Mounting, Updating, and Unmounting.

4. What is virtual DOM?


a. an in-memory representation of Real DOM.
b. a programming interface for HTML and XML documents.
c. a markup language for Web pages
d. an XML or HTML document as a tree structure interface

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.

6. What is the difference between Promise and callback?

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?

ANSWER: Standard library for routing in React

8. What is Typescript?

ANSWER: Ffree and open source programming language developed and maintained by Microsoft

9. Lifecycle methods are mainly used ____

a. to keep track of event history


b. to enhance components
c. free up resources
d. none of the above

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

14. Which type of indexes does MongoDB support?


a. Compound Indexes
b. Multikey Indexes
c. Geospatial Indexes
d. All of the above

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?

a. db.inventory.find( { ratings: { $elemMatch: { $gt: 3, $lt: 6 } } } )


b. db.inventory.find( { ratings: { $gt: 5, $lt: 9 } } )
c. db.inventory.find( { ratings.$: { $gt: 5, $lt: 9 } } )
d. db.inventory.find( { ratings: { $elemMatch: { $gte: 3, $lte: 6 } } } )

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

19. Which attribute in React, facilitates efficient handling of a list of items


a. key
b. head
c. value
d. next

ANSWER: A

20. What is a projection in MongoDB queries?


a. It is the second argument in the find() method that may either specify a list of fields to
return or list fields to exclude in the result documents.
b. It is the query plan to optimize the query
c. It is the storage format to store the data into the hard disk
d. It is a condition which specifies the equality condition

ANSWER: A

You might also like