DEV Community

Sathish_Anand
Sathish_Anand

Posted on

MERN TEST:

Imagine, a simple product-comparison MERN app that uses React 16, Redux, latest Node, Mongo, and Mongoose. The index.js requires a product-comparison.js that uses 3 product ids as get params, eg

http://product-comparison.com?products[]=p1001&products[]=p22&products[]=p193

Assume there is a class component in product-comparison.js that compares products. Answer the following questions:

We will call ___________ of Redux in ___________ life-cycle method in product-comparison.js.

___________ of Redux will make an API call and post the following payload (provide sample json object that you will send) ___________ .

API will use this payload and make ___________ Mongoose query.

API will return data (provide sample json object that you will return) ___________ .

_________ will receive this data from API and will dispatch it to _____________ of Redux.

___________ of Redux will update _________ .

___________ in product-comparion. js will update ___________ .

The component in product-comparison.js will get re-rendered to show product details.

Top comments (0)