Loading…
Loading…
Frontend · Senior full stack preparation
Design predictable application state with actions, reducers, selectors and effects. Read practical answers and use the examples to explain your reasoning.
3 of 3 questions
Answer based on actual experience. If you have used NgRx, explain actions, reducers, selectors, effects, and how you test each. Reducers should be tested as pure functions; effects can be tested with mocked action/service streams; components can be tested with a mock store. Do not claim NgRx production experience if you have not used it.
Link to question 7A reducer is a pure function that calculates the next state from the previous state and a dispatched action. It must not mutate existing state or perform API calls; side effects belong in effects or other appropriate services.
Link to question 8We can use services, and they are often the simpler choice. NgRx helps when complex shared state benefits from predictable action-driven updates, selectors, effects, devtools and testability. Services with RxJS or signals work well for local or moderately shared state. Choose based on complexity, not because NgRx is mandatory.
Link to question 9