10 Interview Questions Every JavaScript Developer Should Know
🧵 Thread...
1. Name two programming paradigms important for JavaScript?
JavaScript is a multi-paradigm language, supporting imperative/procedural programming along with OOP (Object-Oriented Programming) and functional programming
2. What is functional programming?
Functional programming produces programs by composing mathematical functions and avoids shared state & mutable data
3. What is the difference between classical and prototypal inheritance?
Class Inheritance: instances inherit from classes and create sub-class relationships
Prototypal Inheritance: instances inherit directly from other objects
4. What are the pros of functional vs object-oriented programming?
Using the functional paradigm, programmers avoid any shared state or side-effects like OOP, which eliminates bugs caused by multiple functions competing for the same resources
5. When is classical inheritance an appropriate choice?
Never, or almost never
Certainly never more than one level
Multi-level class hierarchies are an anti-pattern
6. When is prototypal inheritance an appropriate choice?
In situations where modules or functional programming don’t provide an obvious solution
And any time you need inheritance
7. What does “favor object composition over class inheritance” mean?
It means that code reuse should be achieved by assembling smaller units of functionality into new objects instead of inheriting from classes and creating object taxonomies
8. What is one-way data flow mean?
It means that the model is the single source of truth
The effect is that data always flows in a single direction, which makes it easier to understand
9. What is microservice architectures?
It means that your app is made up of lots of smaller, independent applications capable of running in their own memory space and scaling independently from each other across potentially many separate machines
10. What is asynchronous programming?
It makes it possible to express waiting for long-running actions without freezing the program during these actions. JavaScript implement this style of programming using callbacks, functions that are called when the actions complete
Thanks for reading!
❤️ and share this thread if you found it helpful.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
The primary purpose of the code review is to make sure that the solution is solving the problem in the best possible way. From the code and product perspective.
But how do you determine if the solution you are reviewing is the best way to solve the problem? In other words, how to code review?
- The 7 Habits of Highly Effective People: Powerful Lessons in Personal Change
- Great at Work: How Top Performers Do Less, Work Better, and Achieve More
- The Checklist Manifesto: How to Get Things Right
2/ Writing Code
- Code Complete
- Clean Code: A Handbook of Agile Software Craftsmanship
- Code Simplicity: The Fundamentals of Software