• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

C# interview question

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #91
    Originally posted by VectraMan View Post
    I wish I hadn't said that as it's confused this whole argument. When I was writing highly optimised assembler graphics code, then yes shifts were a good way of speeding it up, but I'd probably never do it in C++ and certainly not C# for the reasons mentioned.

    But the question is assuming you know that << means a bit shift, then is it reasonable to assume that anybody with a basic knowledge of computers and how they work would know that bitshifting left on an integer value has the same outcome as multiplying by a factor of two? All code has to be written assuming a reasonable amount of knowledge on the part of a maintainer, and there are pleanty of other languages features that aren't used that often. How often do you use do...while? I bet not very often (neither do I), but would you be concerned about a programmer using that trick?
    Code:
    #define SETBIT(x,n)  do {(x) |=  (1u << (n)); more tulip here; } while(0)
    #define CLRBIT(x,n)  do {(x) &= ~(1u << (n)); more tulip here; } while(0)
    #define FLIPBIT(x,n) do {(x) ^=  (1u << (n)); more tulip here; } while(0)
    Last edited by Contreras; 10 August 2012, 17:07. Reason: add more tulip, nearly pub time...

    Comment


      #92
      Originally posted by louie View Post
      Bottom line, the guy who could answer it is invoicing that client, whereas the OP is whinging on here.
      Gawd, you get some right little turds on here, General is for trolling, Technical is not.

      Can you see any whinging in my OP? It was a straightforward question, read it again.

      I was offered this role in the end simply on my sheer brilliance on everything outside of the left shift operator. Getting 100% on this type of tech interview, expecially a .NET one that covers everything from Operators to WCF to JQuery to Sharepoint to interpreting an SQL Profiler trace is not expected, they want to see breadth of knowledge demonstrated.

      Comment


        #93
        Originally posted by Durbs View Post
        Gawd, you get some right little turds on here, General is for trolling, Technical is not.

        Can you see any whinging in my OP? It was a straightforward question, read it again.
        But you did call them "twats for putting that in an interview".

        Originally posted by Durbs View Post
        I was offered this role in the end simply on my sheer brilliance on everything outside of the left shift operator.
        Well that and the fact you didn't try to bluff it.

        It's a feature of the language that you are claiming to know so not at all unreasonable to ask in a technical interview. The point however is to follow through with some discussion - like examples of where the candidate has seen/used the feature before?

        Of course in this case you killed it by not knowing the answer, but that's okay because they were looking for a windows weeny not a kernel hacker.

        Had you suggested it was something to do with C++ iostreams, or waffled on about optimising the code for speed then you may not have been offered the gig.

        Comment


          #94
          Originally posted by Contreras View Post
          But you did call them "twats for putting that in an interview".
          Well they were.

          They should have offered me the gig solely based on my sparkly blue eyes and the fact I'd specifically chosen a tie to highlight them. Is that not enough to land a gig these days?

          Comment

          Working...
          X