• 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!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "C# interview question"

Collapse

  • Durbs
    replied
    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?

    Leave a comment:


  • Contreras
    replied
    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.

    Leave a comment:


  • Durbs
    replied
    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.

    Leave a comment:


  • Contreras
    replied
    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...

    Leave a comment:


  • louie
    replied
    Originally posted by zeitghost
    Please don't tell me they use C# or C++ in bombs.

    It'll be like "Dark Star" all over again.
    Apparently C++ was used in one of the Mars Rovers.

    Leave a comment:


  • louie
    replied
    Originally posted by Willapp View Post
    But you do know, clearly!

    I wasn't trying to start an argument, just the OP seemed to be frustrated that such a question came up in a C# test and the ensuing debate I thought was around whether this is a legitimate question to ask - I would say it is, even if it's not necessarily a good question because of its limited application in a commercial setting.
    Bottom line, the guy who could answer it is invoicing that client, whereas the OP is whinging on here.

    Leave a comment:


  • Willapp
    replied
    Originally posted by Gentile View Post
    Well, this thread is about C# interview questions. If I were asked it in an interview and I didn't know the answer, I'd say "I don't know".
    But you do know, clearly!

    I wasn't trying to start an argument, just the OP seemed to be frustrated that such a question came up in a C# test and the ensuing debate I thought was around whether this is a legitimate question to ask - I would say it is, even if it's not necessarily a good question because of its limited application in a commercial setting.

    Leave a comment:


  • Gentile
    replied
    Originally posted by Willapp View Post
    I wasn't talking about interviews though, this is about answering a question in a test and either getting that question wrong or right, no? I'm confused what you would do if faced with that question yourself (or hypothetically what a candidate should do), surely you can't refuse to answer it on the grounds that "using the bitshift operator doesn't produce meaningful solutions"?

    Don't get me wrong, I am not disputing that for 95% of C# programmers there is no real-world scenario where you would legitimately use it, and anyone who does use it out of context should certainly be admonished for doing so, but there are those 5% of cases where it does have a purpose and regardless of that, knowing the answer to a question in a test is getting you 1% closer to securing the contract.
    Well, this thread is about C# interview questions. If I were asked it in an interview and I didn't know the answer, I'd say "I don't know".

    Leave a comment:


  • Willapp
    replied
    Originally posted by Gentile View Post
    No, the whole point of interviews in the real world is to determine whether the person you're interviewing can produce meaningful solutions within reasonable timescale and budgetary constraints. I think you might be thinking of the differing goals of schools and universities if you conversely believe the point is to merely assess knowledge for the sake if it.
    I wasn't talking about interviews though, this is about answering a question in a test and either getting that question wrong or right, no? I'm confused what you would do if faced with that question yourself (or hypothetically what a candidate should do), surely you can't refuse to answer it on the grounds that "using the bitshift operator doesn't produce meaningful solutions"?

    Don't get me wrong, I am not disputing that for 95% of C# programmers there is no real-world scenario where you would legitimately use it, and anyone who does use it out of context should certainly be admonished for doing so, but there are those 5% of cases where it does have a purpose and regardless of that, knowing the answer to a question in a test is getting you 1% closer to securing the contract.
    Last edited by Willapp; 10 August 2012, 13:50. Reason: Typo

    Leave a comment:


  • Spacecadet
    replied
    Originally posted by NickFitz View Post
    Power of two, surely? 2, 4, 8, 16, 32, 64, 128, 256…



    Is there an equivalent of Godwin's Law stating that all discussions of programming end up using a motor car analogy?
    I agree!

    http://forums.contractoruk.com/gener...ml#post1565538

    Leave a comment:


  • Gentile
    replied
    Originally posted by NickFitz View Post
    Serves you right for interviewing someone whose CV clearly lists a degree in Philosophy
    Never mind, you seem to be OK now. Plus that farm surrounding the business centre your present ClientCo is based in looks gorgeous.

    Leave a comment:


  • Gentile
    replied
    Originally posted by Bunk View Post


    NF would be interviewing you.
    I wouldn't have thought so. Most people that interview me aren't coders themselves, but are people with problems they want me to help them solve.

    Nice digression, though; tell me, do you know what 500<<4 evaluates to?

    Leave a comment:


  • NickFitz
    replied
    Originally posted by Gentile View Post
    It's at this point in the interview I'd be thanking you for your time, smiling whilst gesturing towards the door, and letting you know that we'd be in touch in a day or two to let you know the outcome. I'd be hoping that the next candidate in would be more able to focus on getting results with C# than on philosophy and nit-picking semantics.
    Serves you right for interviewing someone whose CV clearly lists a degree in Philosophy

    Leave a comment:


  • Bunk
    replied
    Originally posted by Gentile View Post
    It's at this point in the interview I'd be thanking you for your time, smiling whilst gesturing towards the door, and letting you know that we'd be in touch in a day or two to let you know the outcome. I'd be hoping that the next candidate in would be more able to focus on getting results with C# than on philosophy and nit-picking semantics.


    NF would be interviewing you.

    Leave a comment:


  • Gentile
    replied
    Originally posted by NickFitz View Post
    Not at all:



    Clearly a mention of it rather than an invocation
    It's at this point in the interview I'd be thanking you for your time, smiling whilst gesturing towards the door, and letting you know that we'd be in touch in a day or two to let you know the outcome. I'd be hoping that the next candidate in would be more able to focus on getting results with C# than on philosophy and nit-picking semantics.

    Leave a comment:

Working...
X