Core JS mentors interview #3
Node.js Basics
- What is Node.js, and how does it differ from browser-based JavaScript?
- What is the purpose of the package.json file, and how does it differ from package-lock.json?
- How do CommonJS (require) and ES Modules (import) differ in Node.js?
- Briefly explain what streams are in Node.js and describe their types.
- How do environment variables work in Node.js, and how are they used in applications?
Networking
- What is HTTP, and how does the HTTP request-response cycle work?
- Compare and contrast HTTP/1, HTTP/2, and HTTP/3.
- What is REST, and what are its key principles?
- What are HTTP status codes? Provide examples of success, client error, and server error status codes.
Security
- What is XSS (Cross-Site Scripting), and how can it be prevented?
- What is CSRF (Cross-Site Request Forgery), and how does it differ from XSS?
- Explain how you would secure sensitive environment variables in a Node.js application.
- What is CORS, and how does it relate to the Same-Origin Policy?
Testing
- What is the Arrange-Act-Assert (AAA) pattern, and why is it important in writing unit tests?
- What is mocking, and how does it help isolate dependencies in tests?
- Explain the principles of the FIRST (Fast, Independent, Repeatable, Self-validating, Timely) acronym in testing.
- What are flaky tests, and how can they be addressed to improve CI/CD pipelines?
Critical Rendering Path (CRP)
- What are the main stages of the Critical Rendering Path (CRP)?
- For moving an element during animation, is it better to use transition: translate or modify properties like left, top, etc.? Why?
- What debugging tools do you use for Node.js or web development, such as Chrome DevTools? Share an example of how you’ve identified or resolved an issue using these tools.