Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Next time you have an interview

Next time you have an interview

Scheduled Pinned Locked Moved The Lounge
csharpcomalgorithmsoopquestion
23 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Ennis Ray Lynch Jr

    Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)

    Need a C# Consultant? I'm available.
    Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

    L Offline
    L Offline
    led mike
    wrote on last edited by
    #2

    I don't have all that information mesmerized so... I'm out! :-D

    led mike

    1 Reply Last reply
    0
    • E Ennis Ray Lynch Jr

      Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)

      Need a C# Consultant? I'm available.
      Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #3

      Beats me. I look this stuff up when we're getting ready to conduct interviews. It makes a good "i'm better than this guy" question. Then i forget it again.

      L 1 Reply Last reply
      0
      • S Shog9 0

        Beats me. I look this stuff up when we're getting ready to conduct interviews. It makes a good "i'm better than this guy" question. Then i forget it again.

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #4

        Shog9 wrote:

        It makes a good "i'm better than this guy" question.

        LMAO I started a interview questions file years ago that I would print out and take into interviews to remember questions I considered telling of a persons experience. After I while I had to add hints to the answers to many of the questions in the file because I couldn't always remember them! :laugh::laugh:

        led mike

        1 Reply Last reply
        0
        • E Ennis Ray Lynch Jr

          Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)

          Need a C# Consultant? I'm available.
          Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

          L Offline
          L Offline
          Leslie Sanford
          wrote on last edited by
          #5

          Ennis Ray Lynch, Jr. wrote:

          Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three

          1. Polymorphism 2) Polymorphism 3) Polymorphism 4) Polymorphism 5) Polymorphism 6) Polymorphism 7) Polymorphism 8) Polymorphism I'm serious. This is what's important to me. Polymorphism allows you to manage dependencies by hiding implementation behind interfaces. So you can vary implementation in one area without affecting another area. Books will mention encapsulation, inheritance, and whatever when describing OOP. But the most important concept is Poly. She's the gal you want to take to the dance.
          E 1 Reply Last reply
          0
          • L Leslie Sanford

            Ennis Ray Lynch, Jr. wrote:

            Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three

            1. Polymorphism 2) Polymorphism 3) Polymorphism 4) Polymorphism 5) Polymorphism 6) Polymorphism 7) Polymorphism 8) Polymorphism I'm serious. This is what's important to me. Polymorphism allows you to manage dependencies by hiding implementation behind interfaces. So you can vary implementation in one area without affecting another area. Books will mention encapsulation, inheritance, and whatever when describing OOP. But the most important concept is Poly. She's the gal you want to take to the dance.
            E Offline
            E Offline
            Ennis Ray Lynch Jr
            wrote on last edited by
            #6

            Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)

            Need a C# Consultant? I'm available.
            Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

            S L M L 4 Replies Last reply
            0
            • E Ennis Ray Lynch Jr

              Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)

              Need a C# Consultant? I'm available.
              Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

              S Offline
              S Offline
              Shog9 0
              wrote on last edited by
              #7

              Ennis Ray Lynch, Jr. wrote:

              In fact, without inheritance you can't have polymorphism.

              Really? :~ I'm gonna have to think about this one a bit.

              E 1 Reply Last reply
              0
              • E Ennis Ray Lynch Jr

                Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)

                Need a C# Consultant? I'm available.
                Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                L Offline
                L Offline
                Leslie Sanford
                wrote on last edited by
                #8

                Ennis Ray Lynch, Jr. wrote:

                In fact, without inheritance you can't have polymorphism.

                Not true. :-) In C++, you have several different kinds of polymorphism. Inheritance allows for run-time polymorphism; I can change the implementation behind an interface at run-time. Templates give us compile-time polymorphism. The implementation behind an interface is determined at compile-time. Compile-time polymorphism via templates doesn't rely on inheritance. Parametric polymorphism can be done through overloading of methods. This doesn't necessarily rely on inheritance, either. In other languages you don't even need inheritance at all for run-time polymorphism. Smalltalk is an example (I think).

                E 1 Reply Last reply
                0
                • S Shog9 0

                  Ennis Ray Lynch, Jr. wrote:

                  In fact, without inheritance you can't have polymorphism.

                  Really? :~ I'm gonna have to think about this one a bit.

                  E Offline
                  E Offline
                  Ennis Ray Lynch Jr
                  wrote on last edited by
                  #9

                  Think of a case without inheritance where there is polymorphism. All polymorphism is basically a vtable lookup to determine which method in the inheritance chain to call. The real challenge is the new keyword in .NET which allows methods to be shadows which breaks the polymorphic chain causing novice programmers to make some real fun mistakes.

                  Need a C# Consultant? I'm available.
                  Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                  S 1 Reply Last reply
                  0
                  • L Leslie Sanford

                    Ennis Ray Lynch, Jr. wrote:

                    In fact, without inheritance you can't have polymorphism.

                    Not true. :-) In C++, you have several different kinds of polymorphism. Inheritance allows for run-time polymorphism; I can change the implementation behind an interface at run-time. Templates give us compile-time polymorphism. The implementation behind an interface is determined at compile-time. Compile-time polymorphism via templates doesn't rely on inheritance. Parametric polymorphism can be done through overloading of methods. This doesn't necessarily rely on inheritance, either. In other languages you don't even need inheritance at all for run-time polymorphism. Smalltalk is an example (I think).

                    E Offline
                    E Offline
                    Ennis Ray Lynch Jr
                    wrote on last edited by
                    #10

                    You are actually referring to two totally different concepts confused by the overloading in the computer science community of the word polymorphism. In reality, as the wiki article states, in the context of OO languages parametric polymorphism is referred to as generics to remove the ambiguity. http://en.wikipedia.org/wiki/Polymorphism_(computer_science)[^]

                    Need a C# Consultant? I'm available.
                    Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                    1 Reply Last reply
                    0
                    • E Ennis Ray Lynch Jr

                      Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)

                      Need a C# Consultant? I'm available.
                      Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                      M Offline
                      M Offline
                      Madhu Cheriyedath
                      wrote on last edited by
                      #11

                      Ennis Ray Lynch, Jr. wrote:

                      In fact, without inheritance you can't have polymorphism.

                      I don't think that is an accurate statement. In C++, you can definitely have static polymorphism with templates (I am not talking about the operator overloading). In C++, dynamic polymorphisms is acheived through virtual functions (and of course inheritance). The C++ templates book (by Josuttis and Vandevoorde) explains the difference in both static and dynamic polymorphisms in detail. I think one of the Herb Sutter's book also talks about static polymorphism. Disclaimer:- The last time I looked at these books was probably 3 years back and there is a chance that I could be wrong about the fine details. Also I don't write code these days :) :) :) :)

                      modified on Tuesday, March 4, 2008 12:19 AM

                      1 Reply Last reply
                      0
                      • E Ennis Ray Lynch Jr

                        Think of a case without inheritance where there is polymorphism. All polymorphism is basically a vtable lookup to determine which method in the inheritance chain to call. The real challenge is the new keyword in .NET which allows methods to be shadows which breaks the polymorphic chain causing novice programmers to make some real fun mistakes.

                        Need a C# Consultant? I'm available.
                        Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                        S Offline
                        S Offline
                        Shog9 0
                        wrote on last edited by
                        #12

                        What about dynamic binding systems such as ObjectiveC, Javascript, or IDispatch? In these systems, i can have a reference to an object and call methods on it/send messages to it, all without making any requirements on how the object is actually implemented, or what it inherits. Now, if you want to argue that these systems still depend on inheritance to the extent that every object must at least inherit the mechanism for dispatching messages, well, i'll concede that. :)

                        E L 2 Replies Last reply
                        0
                        • S Shog9 0

                          What about dynamic binding systems such as ObjectiveC, Javascript, or IDispatch? In these systems, i can have a reference to an object and call methods on it/send messages to it, all without making any requirements on how the object is actually implemented, or what it inherits. Now, if you want to argue that these systems still depend on inheritance to the extent that every object must at least inherit the mechanism for dispatching messages, well, i'll concede that. :)

                          E Offline
                          E Offline
                          Ennis Ray Lynch Jr
                          wrote on last edited by
                          #13

                          At a certain point you cross the boundaries between OO and just a language where anything goes. Eventually there is a line in the sand where you have to say this language doesn't fully enough structure to even be considered a full OO language and that is why there are so many qualifications for an object oriented language. It is also why there are not "true" object oriented language. Be your own judge and draw your own line.

                          Need a C# Consultant? I'm available.
                          Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                          S L 2 Replies Last reply
                          0
                          • E Ennis Ray Lynch Jr

                            At a certain point you cross the boundaries between OO and just a language where anything goes. Eventually there is a line in the sand where you have to say this language doesn't fully enough structure to even be considered a full OO language and that is why there are so many qualifications for an object oriented language. It is also why there are not "true" object oriented language. Be your own judge and draw your own line.

                            Need a C# Consultant? I'm available.
                            Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                            S Offline
                            S Offline
                            Shog9 0
                            wrote on last edited by
                            #14

                            Ennis Ray Lynch, Jr. wrote:

                            Be your own judge and draw your own line.

                            :) fair 'nuff.

                            1 Reply Last reply
                            0
                            • E Ennis Ray Lynch Jr

                              At a certain point you cross the boundaries between OO and just a language where anything goes. Eventually there is a line in the sand where you have to say this language doesn't fully enough structure to even be considered a full OO language and that is why there are so many qualifications for an object oriented language. It is also why there are not "true" object oriented language. Be your own judge and draw your own line.

                              Need a C# Consultant? I'm available.
                              Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                              L Offline
                              L Offline
                              Leslie Sanford
                              wrote on last edited by
                              #15

                              Ennis Ray Lynch, Jr. wrote:

                              Be your own judge and draw your own line.

                              Getting back to the context of your thread, if this were a job interview and we were to have this discussion, I wonder how it would be viewed by the inteviewer? In other words, if we had a give and take about the nature of OO, would that be considered a plus? Or would the interviewer be irked by not getting the canned answer he/she was looking for?

                              E 1 Reply Last reply
                              0
                              • S Shog9 0

                                What about dynamic binding systems such as ObjectiveC, Javascript, or IDispatch? In these systems, i can have a reference to an object and call methods on it/send messages to it, all without making any requirements on how the object is actually implemented, or what it inherits. Now, if you want to argue that these systems still depend on inheritance to the extent that every object must at least inherit the mechanism for dispatching messages, well, i'll concede that. :)

                                L Offline
                                L Offline
                                Leslie Sanford
                                wrote on last edited by
                                #16

                                "Quack quack" If it quacks like a Shog9? ;P

                                1 Reply Last reply
                                0
                                • L Leslie Sanford

                                  Ennis Ray Lynch, Jr. wrote:

                                  Be your own judge and draw your own line.

                                  Getting back to the context of your thread, if this were a job interview and we were to have this discussion, I wonder how it would be viewed by the inteviewer? In other words, if we had a give and take about the nature of OO, would that be considered a plus? Or would the interviewer be irked by not getting the canned answer he/she was looking for?

                                  E Offline
                                  E Offline
                                  Ennis Ray Lynch Jr
                                  wrote on last edited by
                                  #17

                                  Usually the interviewer asks, "What are the pillars of OO"? and I respond, "Do you want the 3, 5 or 8?" I only launch into a pedantic discussion with poor interviewers who are wasting my time and for the interviewer that needs a sense of feeling superior. Of course for the later I don't want the position anyway so I take pride in answering with the most technically complete answers in order to totally baffle the person. If I really want the gig, I just parrot the big three.

                                  Need a C# Consultant? I'm available.
                                  Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                                  1 Reply Last reply
                                  0
                                  • E Ennis Ray Lynch Jr

                                    Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)

                                    Need a C# Consultant? I'm available.
                                    Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                                    L Offline
                                    L Offline
                                    leppie
                                    wrote on last edited by
                                    #18

                                    Next time cover his question/answer sheet, and ask him to name them to you without pause.

                                    xacc.ide - now with IronScheme support
                                    IronScheme - 1.0 alpha 2 out now

                                    O 1 Reply Last reply
                                    0
                                    • E Ennis Ray Lynch Jr

                                      Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)

                                      Need a C# Consultant? I'm available.
                                      Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                                      N Offline
                                      N Offline
                                      NormDroid
                                      wrote on last edited by
                                      #19

                                      My 3 are: Encapsulation Inheritance Polymorphism I couldn't name all 8:~

                                      Brainware Error - reboot required.

                                      1 Reply Last reply
                                      0
                                      • E Ennis Ray Lynch Jr

                                        Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)

                                        Need a C# Consultant? I'm available.
                                        Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                                        M Offline
                                        M Offline
                                        Mustafa Ismail Mustafa
                                        wrote on last edited by
                                        #20

                                        What is "Encapsulation, polymorphism, abstraction, inheritence, reuse"?

                                        "Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler "The secret to a long and healthy life is simple. Don't get ill and don't die." Pete O'Hanlon, courtesy of Rama "I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon

                                        1 Reply Last reply
                                        0
                                        • E Ennis Ray Lynch Jr

                                          Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)

                                          Need a C# Consultant? I'm available.
                                          Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

                                          L Offline
                                          L Offline
                                          Lost User
                                          wrote on last edited by
                                          #21

                                          Ennis Ray Lynch, Jr. wrote:

                                          without inheritance you can't have polymorphism

                                          I disagree. How about polymorphic funcitons in C, take printf() foro example. THats got plenty of forms.

                                          Morality is indistinguishable from social proscription

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups