abstract class or interface implementation using c++ || C++ for HFT Systems || Advance c++ series

preview_player
Показать описание
Q-1: Can you imagine a low-level system design without an interface?
Ans: A big, no.

Whenever we design any system, we are encouraged to create the interface despite the fact that we can never create the object of the interface.

So let's try to understand a few things about abstract classes or interfaces in C++:

Q-1: can I create the object of the interface/abstract class?
Ans: No, we can't do that.

Q-2: What could be the use cases of the interface?
Ans: It helps us in creating the appropriate base class for different child class?

Q-3 How can we create an interface in C++?
Ans: Using the pure virtual function, we create an abstract class that in turn can be used as an interface.

Q-4 Can the child class implement pure virtual function?
Ans: Yes, it is compulsory for every child class to provide the implementation of pure virtual function.

Q-5: What if some child class does not implement pure virtual defined inside the abstract class?
Ans: That child class will work as an interface and we can't create the object of that class.

Q-6 How will you summarise the interface in a few words?
Ans: The easiest way of understanding interfaces is that they allow different objects to expose COMMON functionality.

Q-7 How does the interface impact the performance of the system?
Ans: Yes, the Interface can slow down the performance of the system because of virtual function calls

You can connect with me:

#systemdesign #softwareengineer #softwareengineering #lowlevelsystemdesign #performance #lowlatency #HFT
Рекомендации по теме
Комментарии
Автор

Sir I'v completed the series till now waiting for assignment on the topic.

jaanu
join shbcf.ru