I took a test few days ago in Codility, I say this really is a good way to validate the skill set of programmers, it shows clearly how they think and approach problem vs normal multiple choice type of question or by simply having a technical interview. Here's my answer to the Codility questions. Decimal Reverse: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 public static int DecimalReverse ( int n) { char [] arr = n.ToString().ToCharArray(); string reversed = string .Empty; List< string > list = new List< string >(); foreach ( var item in arr.Reverse()) { list.Add(item.ToString()); } reversed = string .Join( "" , list); return Convert.ToInt32(reversed); } Magnitude Pole: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 public static int MagnitudePole ( int [...
I was given this test before in one of my Job Interviews will not name the company. I'll show you how I tackled the problem. "Given an arbitrary text document written in English, write a program that will generate a concordance, i.e. an alphabetical list of all word occurrences, labeled with word frequencies. Bonus: label each word with the sentence numbers in which each occurrence appeared." For example, this is a concordance of the above text: a. a {2:1,1} b. all {1:1} c. alphabetical {1:1} d. an {2:1,1} e. appeared {1:2} f. arbitrary {1:1} g. bonus {1:2} h. concordance {1:1} i. document {1:1} j. each {1:2} k. english {1:1} l. frequencies {1:1} m. generate {1:1} n. given {1:1} o. i.e. {1:1} p. in {2:1,2} q. it {1:2} r. label ...
Comments