Cognizant Angular Interview Questions for 6+ years
Shared question set for 6+ years of experience, L2 round. Topics and wording follow the supplied notes; these are questions, not official company guidance.
- Explain memory allocation in JavaScript. Sub-question: how do you clear closure memory?
- List the ES6 features used in your project. Sub-questions: where have you used destructuring and how often do you use Promises in Angular?
- What is your understanding of modules in JavaScript?
- Have you created any pure functions? Explain with a use case.
- Have you created any recursive function? Explain it.
- Users log in, but even if the user closes the tab and opens it again we want to keep them logged in. How do you achieve this?
- If the same dashboard data is available from multiple APIs, how would you call all APIs in JavaScript and use the response from whichever API returns first?
- Some users have very slow internet connections, so form submission APIs may take 6-8 seconds to respond, and users click the submit button multiple times causing duplicate records. How would you prevent this using JavaScript fundamentals?
- A page has a table with search filters (from date, to date, category, price range) and a search button; each row has an Open button that navigates to a details page. When the user returns, the previously selected filters and the same table data should still be visible. How would you implement this?
- What is the difference between setValue and patchValue?
- List the reusable components you have created.
- How will you create a reusable textbox that supports ngModel and FormControl?
- What is tree shaking in Angular?
- Explain the RxJS operators tap, race and map (asked with code explanation).
- The logout button is in the navbar but user activity is in the dashboard. How will you send that data in the logout API?
- Dynamic menu based on roles: one route is accessible by multiple roles; how do you use guards for role-based access?
- Your project uses PrimeNG but needs migration to Angular Material. How will you plan and manage branching without affecting sprints?
- How comfortable are you with external libraries like AG Grid, PrimeNG and graph libraries?