You must Sign In to post a response.
  • Category: Career Guidance

    Interview preparation


    Recently, I've faced an interview and here are few questions for which I need your help.



    Hi experts,

    Recently, I've faced an interview and here are few questions for which I need your help.

  • Difference between structure and class.
  • Can we do typecasting in dictionary?
  • What is anonymous in OOPs?
  • Explain OOPs concepts.

    During interview, I got confused when asked "Explain OOPs concept". I did not understand how and where to start with answers.
  • #760918

    Hi

    The four pillars of OOPs are:
    1.Encapsulation:
    *Writing all members and member functions
    together which is also called as data binding is
    called encapsulation.

    2.Abstraction:
    *Hiding the data which is hiding complexity with
    the help of access modifiers is called
    abstraction.

    3.Polymorphism:(Many forms)
    Overloading:
    *Having same name for two or more methods
    with different arguments is called overloading.
    *It is also called as early binding.
    Overriding:
    *Having same name for methods in base class
    and derived class with same arguments is called
    overriding.
    *It is also called as late binding.

    Inheritance:
    *Parent class features are utilized in child class as hierarchy or Inheriting parent class with the help of child class is inheritance.

    Regards

    Sridhar Thota.
    "Poverty means Poverty of knowledge"


    Sridhar Thota.
    Editor: DNS Forum.

  • #760919

    Hi Rohini,

    I might be late but I would like to take this thread with my views as here:

    1. Difference between Structure and Class

    Structures
    A structure in C# is simply a composite data type [you are well aware from composite data type, refer to data types for more details], which consists number of members of other types. The structure define simply by using the struct keyword

    Classes
    It is cleared from above study that Classes are reference type. A class is a collection of its data members. Data members are those members of class which contains the data of class like fields, constants and events etc. Class is declared simply just followed by class keyword with optional modifiers; by default C# classes are private.

    For your reference: http://gaurav-arora.com/classes-and-structures/

    2. Can we do Typecasting in Dictionary
    Yes, we can but its bit complex to cast Dictionary between dictionary.
    For your reference see this thread: http://stackoverflow.com/questions/10206557/c-sharp-cast-dictionarystring-anytype-to-dictionarystring-object-involvin

    3. What is Anonymous in OOP's
    Not cleared, are you referring Anonymous types of a specific language related to OOPS.
    Refer to msdn: https://msdn.microsoft.com/en-us/library/dd460654.aspx#AnonymousTypes

    4. Explain OOPs concepts

    How to start: You just start with basic definition and then gradually go with Abstraction, Inheritance, Polymorphism and Encapsulation. If possible try to give real time example, if you can avoid to give bookish examples.

    What to Say: If you are confident that you know the concept go in depth if interviewer asked.

    What not to say: Do not try to make lengthy answer if you do not have confident with your answer.

    I do not want to create any new definition, just refer to WIKI: https://en.wikipedia.org/wiki/Object-oriented_programming


    Please feel free to revert back or contact me directly for any further/more assistant.


    Thanks & regards,
    Gaurav Kumar Arora
    Site Coordinator - DNS
    My blog - http://gaurav-arora.com


  • Sign In to post your comments
    Submit New Thread
    Return to Return to Discussion Forum