Tech Off Post

Single Post Permalink

View Thread: Coding Interview Question
  • User profile image

    LINQ makes this easy.

    var mean = myIntArray.Average();

    var  duplicates =  from val in myIntArray group val by val into result where result.Count() > 1 select new { Item = val.Key, ItemCount = val.Count() };

    foreach(var i in duplicates){  Debug.WriteLine(string.Format("The word {0} has {1} number of occurrences ", i.Item, i.ItemCount)); }


    I find asking questions about technology is more valuable when interviewing a coder's skillset. Probably because I feel comfortable knowing what answers are relevant and revealing.

    Many interviewees find coding exercises too nerve-racking, even some who shouldn't be intimidated at all. I might save that for a leadership role interview. Not sure.