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. General Programming
  3. C#
  4. Interview question: What are the 5 classes you use most often?

Interview question: What are the 5 classes you use most often?

Scheduled Pinned Locked Moved C#
questioncareer
18 Posts 8 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.
  • OriginalGriffO OriginalGriff

    Do note that Int isn't a class: it's a struct...

    You looking for sympathy? You'll find it in the dictionary, between sympathomimetic and sympatric (Page 1788, if it helps)

    B Offline
    B Offline
    Bastien Vandamme
    wrote on last edited by
    #7

    And what about System.Int16 System.Int32 System.Int64

    1 Reply Last reply
    0
    • L Lost User

      System.Object System.Diagnostics.Debug System.Collections.Generic.List System.Convert System.Action

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      R Offline
      R Offline
      Rob Philpott
      wrote on last edited by
      #8

      Interesting that System.Convert is in there. I think I've only ever used it about twice (well directly, anyway).

      Regards, Rob Philpott.

      L 1 Reply Last reply
      0
      • B Bastien Vandamme

        During an Interview I get this interesting question: What are the 5 classes you use most often? What is the best answer to this question? Keeping in mind that this is an interview question what will be your answer?

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #9

        And what did you answer?

        B 1 Reply Last reply
        0
        • B Bastien Vandamme

          I also responded Object first because of the word "used" then I answered things like String, List, Int and Debug. This seems to me so basic than I hesitated to answer that. Happy to see I'm not alone.

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #10

          In answer to your email (the question appears to have vanished): Int is a synonym for Int32, and Int16, Int32, and Int64 are all struct Have a look here: Using struct and class - what's that all about?[^] - it tries to explain the difference.

          You looking for sympathy? You'll find it in the dictionary, between sympathomimetic and sympatric (Page 1788, if it helps)

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          1 Reply Last reply
          0
          • P Pete OHanlon

            And what did you answer?

            B Offline
            B Offline
            Bastien Vandamme
            wrote on last edited by
            #11

            I responded Object first then String, List, maybe Int even it's a struct and Debug, Console, something like that.

            1 Reply Last reply
            0
            • R Rob Philpott

              Interesting that System.Convert is in there. I think I've only ever used it about twice (well directly, anyway).

              Regards, Rob Philpott.

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

              Rob Philpott wrote:

              Interesting that System.Convert is in there

              Most people don't "like" the class. It's not interesting which is better, what is interesting is whether the *interviewer* would ask why I choose the class. Chances are, the question never comes.

              static void Main(string[] args)
              {
              string s = null;

              Console.WriteLine((string)s);             // default
              Console.WriteLine("" + s);                // only if you'd rather go back to VB6
              Console.WriteLine(Convert.ToString(s));   // obvious
              //Console.WriteLine(s.ToString());        // would explode
              Console.ReadLine();
              

              }

              Now, an object that can contain null would not be casted to an Int - most people would parse it (and ignore any conversion errors). If prefer to convert it all if there's a lot of different types after another that need to be assigned. Otherwise, I go for casting.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              1 Reply Last reply
              0
              • B Bastien Vandamme

                During an Interview I get this interesting question: What are the 5 classes you use most often? What is the best answer to this question? Keeping in mind that this is an interview question what will be your answer?

                J Offline
                J Offline
                Joe Woodbury
                wrote on last edited by
                #13

                This is where you wished you'd remember something absurdly obscure like AsyncStateMachineAttribute.

                1 Reply Last reply
                0
                • L Lost User

                  System.Object System.Diagnostics.Debug System.Collections.Generic.List System.Convert System.Action

                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                  J Offline
                  J Offline
                  jschell
                  wrote on last edited by
                  #14

                  You use Object itself more than say String?

                  L 1 Reply Last reply
                  0
                  • B Bastien Vandamme

                    During an Interview I get this interesting question: What are the 5 classes you use most often? What is the best answer to this question? Keeping in mind that this is an interview question what will be your answer?

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #15

                    B413 wrote:

                    What is the best answer to this question?

                    If an interviewer thinks there is a best answer to that question then you can be sure that the interviewer doesn't know what they are doing. At best they don't understand the interview process and at worst they are arrogant. There are of course bad answers to that question - like "what is a class?"

                    1 Reply Last reply
                    0
                    • J jschell

                      You use Object itself more than say String?

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

                      jschell wrote:

                      You use Object itself more than say String?

                      Dunno, I did not measure them - just the first five non-structs that popped into my head. A string is still a pointer to an array of bytes to me. Nothing fancy, just an address. Outside of that, it's a shame Interfaces were not included, it would have made the answer much more interesting. Given inheritance, I'd say I use a LOT of Object :)

                      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                      1 Reply Last reply
                      0
                      • B Bastien Vandamme

                        During an Interview I get this interesting question: What are the 5 classes you use most often? What is the best answer to this question? Keeping in mind that this is an interview question what will be your answer?

                        C Offline
                        C Offline
                        ClimerChinna
                        wrote on last edited by
                        #17

                        system.web.ui system.io system.data system.configuration system.data.sql :)

                        1 Reply Last reply
                        0
                        • B Bastien Vandamme

                          During an Interview I get this interesting question: What are the 5 classes you use most often? What is the best answer to this question? Keeping in mind that this is an interview question what will be your answer?

                          C Offline
                          C Offline
                          ClimerChinna
                          wrote on last edited by
                          #18

                          System.web.ui system.io system.data system.data.sqlclient system.configuration :)

                          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