Classes part 25 - Classes Practice Interview -- Jeopardy Edition | Modern Cpp Series Ep. 62

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 50

  • @klutch4198
    @klutch4198 2 ปีที่แล้ว +7

    I got all but 8 questions right... i thought I might get only 1 or 2 correct because I've only been writing CPP for the last 5 or 6 days. Honestly, it all comes down to having an amazing instructor!!

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว +1

      Thank you for the kind words! 😁Lots of smart students on this channel!

  • @tanishlad6351
    @tanishlad6351 2 ปีที่แล้ว +3

    In the Rule of 3 (and the Rule of 5) question, I think the three special member functions should be the destructor, the copy constructor and the copy assignment operator. It should not include the constructor as specified in the slides because we do not necessarily need the other 3 member functions if we define the constructor ourselves. This is also what is written on the cppreference screenshot on the answer slide.

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว +1

      Agreed, good catch -- that's also what in fact makes the math check out (destructor + copy constructor + copy-assignment = 3 special member functions to define if we have a custom constructor) :)

  • @nevis2769
    @nevis2769 2 ปีที่แล้ว +7

    Very helpful review. More review videos of this style in the future would be great. Keep it up Mike!

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      Thank you for the kind words!

  • @jaredschiltz
    @jaredschiltz 2 ปีที่แล้ว +4

    Mike, thank you for putting all of this wonderful content together! Your teaching style is fantastic and your examples are stellar; i.e., minimal code shown to demonstrate a specific concept. I am looking forward to learning more from you in the future! Thank you!

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      Thank you for the kind words! Looking forward to helping!

  • @VoidloniXaarii
    @VoidloniXaarii 3 หลายเดือนก่อน

    This was a wonderfully engaging format, thank you 干杯

    • @MikeShah
      @MikeShah  3 หลายเดือนก่อน +1

      Cheers!

  • @joebosah2727
    @joebosah2727 7 หลายเดือนก่อน

    Umpteenth time watching and reviewing
    Thanks
    More needed
    Thanks again
    Simply the best …….

    • @MikeShah
      @MikeShah  7 หลายเดือนก่อน

      Cheers, you are most welcome Joe!

  • @dhanushs1802
    @dhanushs1802 2 ปีที่แล้ว +2

    Great video. This is a good way to revise. Excellent teaching as always. Thank you.

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      Cheers! Glad to hear it!

  • @konjitsileshi8984
    @konjitsileshi8984 2 ปีที่แล้ว +2

    Thank you for your hard work.

  • @blaisofotso3439
    @blaisofotso3439 2 ปีที่แล้ว +2

    Sweet and lovely video. Expecting more of these. thank you for your hard work

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว +1

      Thank you for your continued support! Yes, more videos coming in the series!

  • @panicse
    @panicse 9 หลายเดือนก่อน +1

    Hi Mike,
    Thanks for the interview, this is the first time i have heard about POD 😊 I dont know about this type before 😀

    • @MikeShah
      @MikeShah  9 หลายเดือนก่อน

      Cheers -- happy this helped!

  • @vishaldhandhukia5754
    @vishaldhandhukia5754 9 หลายเดือนก่อน

    Hey Mike,
    Really appreciate these videos! Can't tell you how much they have been helping me elevate my C++ understanding, as well as general interview prep! Just wanted to give a quick feedback/correction on one of those slides (please correct me if im mistaken)
    On Class Misc. - $400, there seems to be a slight mistake. From looking at your previous lecture on Virtual destructors, the problem is that of the derived class destructor not being called (as opposed to the Base class). Therefore, the virtual base destructor fixes the problem by calling the derived class destructor (as the base destructor is already called in this example).
    Once again, I appreciate all the work you're doing. You're really helping from those who are starting off to people already in industry. Thanks!

    • @MikeShah
      @MikeShah  9 หลายเดือนก่อน

      Cheers, thanks for catching that! And thank you for your support and kind words!

  • @ProfessionalNoun
    @ProfessionalNoun 7 หลายเดือนก่อน +1

    I got them all but "pods". I may have heard it before but dont think so. If i didn't get a job over that question i would be mad AF.

    • @MikeShah
      @MikeShah  7 หลายเดือนก่อน

      Would be sillly if they dinged you for that one -- but it's a convention I have had previously :)

  • @scullyy
    @scullyy 9 หลายเดือนก่อน +1

    Went very well until "virtual" started appearing! This reminded me that I don't really understand what it does exactly.

    • @MikeShah
      @MikeShah  9 หลายเดือนก่อน

      Cheers! I have some videos on 'virtual' and the 'vtable' on this playlist to help. 'virtual' basically makes something overriddable, or a 'change-of-behavior' in a class hiearachy depending on the object instantiated.

  • @dwolrdcojp
    @dwolrdcojp 2 ปีที่แล้ว

    Great review! Thanks

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      Cheers! Thanks for the long term support!

  • @saifsuleiman1171
    @saifsuleiman1171 ปีที่แล้ว +1

    Thank you, amazing content and effort!

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Cheers, you are most welcome!

  • @gpurusho1000
    @gpurusho1000 ปีที่แล้ว

    Great work Mike!

  • @astbast1966
    @astbast1966 9 หลายเดือนก่อน

    Your are incredible Man!!!

    • @MikeShah
      @MikeShah  9 หลายเดือนก่อน

      Thank you for the kind words 🙏 Enjoy! 😀

  • @lighr6886
    @lighr6886 ปีที่แล้ว +1

    Doesnt the virtual base class destructor ensures that the derived class constructor is called in the case of inheritance-base polymorphism 29:02 ? Nice video btw, I really enjoyed the game.

    • @MikeShah
      @MikeShah  ปีที่แล้ว

      Correct, virtual destructor ensures derived class constructor is called first (all other constructors also called as well)

  • @tarunramaswamy1496
    @tarunramaswamy1496 ปีที่แล้ว +1

    For the first question : Is a enum class technically a user defined data type?

    • @MikeShah
      @MikeShah  ปีที่แล้ว +1

      Yes, enum class is a user defined type

  • @gautamghosh9917
    @gautamghosh9917 2 ปีที่แล้ว

    Copy constructors are provided by default by the compiler only when the member variables are primitives right ? If we have pointers to custom data types then it does not do it by default.

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว +1

      Copy constructors are always provided by the compiler if we do not provide our own. Even if you have other types within the class, the compiler will generate a naive 'member = copy_member' in the copy constructor.

  • @andk6893
    @andk6893 21 วันที่ผ่านมา

    Hi Mike! 6:14 you made the same mistake as you did in lesson 40. The first one in rule of three is a destructor not a constructor :) Thank you for you lessons!

    • @MikeShah
      @MikeShah  21 วันที่ผ่านมา +1

      @@andk6893 cheers, indeed that lesson needs a redo 🙂

    • @andk6893
      @andk6893 21 วันที่ผ่านมา

      @@MikeShah or maybe it's just a test if your students are attentive enough :)

    • @MikeShah
      @MikeShah  21 วันที่ผ่านมา +1

      @@andk6893 I'll accept that 😃

  • @caiyu538
    @caiyu538 11 หลายเดือนก่อน

    👍

    • @MikeShah
      @MikeShah  11 หลายเดือนก่อน

      Cheers!

  • @dookshi
    @dookshi ปีที่แล้ว +1

    Constructor in the Rule of 3/5? I don't think so...

    • @MikeShah
      @MikeShah  ปีที่แล้ว +1

      Correct, my fault! (i.e. Rule of 3: if you define one of copy-constructor, destructor, or copy-assignment operator you need all 3) (Rule of 5: If you define move constructor or move-assignment operator, you need all 5 special member functions including the destructor, copy-constructor, and copy-assignment operator along with move-constructor and move-assignment)

  • @ghulam2545
    @ghulam2545 2 ปีที่แล้ว

    I'm not sure this is a correct question or not but what if we delete all member function of that classes that are provided by default (constructor etc).

    • @MikeShah
      @MikeShah  2 ปีที่แล้ว

      I suppose you could do that, and for example just have static member functions or static variables as part of the class :)