using System.Collections.Generic;
private static List<int> GetListOfIntegersFromOneToTen()
return Enumerable.Range(1, 10).ToList();
private static List<int> GetOddNumbersBetweenZeroAndFifty()
private static List<T> AppendList1ToList2<T>(IEnumerable<T> list1, IEnumerable<T> list2)
private static List<decimal> GetSmallestFiveNumbersGreaterThanFive(List<decimal> numbers)
private static List<string> GetStringStartingOrEndingWithSubstring(List<string> items, string subString)
private static List<KeyValuePair<string, string>> GetDepartmentNamesWithFirstEmployee(List<Employee> employees, List<Department> departments)
private static List<KeyValuePair<string, int>> GetDepartmentNamesWithTotalEmployeeSalary(List<Employee> employees, List<Department> departments)
private static List<int> GetFibonacciSegment(int startPosition, int count)
private static int? GetClosestToZero(List<int> numbers)
private static T[] MergeArrays<T>(T[] array1, T[] array2)
private static IEnumerable<string> AlphabetCombinations()
public static void Main()
"------------------------Sample answer".Dump();
GetListOfIntegersFromOneToTen().Dump();
"------------------------Question 1".Dump();
GetOddNumbersBetweenZeroAndFifty().Dump();
"------------------------Question 2".Dump();
"------------------------Question 3".Dump();
GetSmallestFiveNumbersGreaterThanFive(new List<decimal>
5.05M, 1, 2, 3, 4, 5, 5.1M, 6, 6, 5, 8, 9, 10, 13
"------------------------Question 4".Dump();
GetStringStartingOrEndingWithSubstring(new List<string>
"pete13", "ted", "alan12", "john8", "alan", "charlie", "crete", "134", "claudette"
"------------------------Question 5".Dump();
GetDepartmentNamesWithFirstEmployee(Employees, Departments).Dump();
"------------------------Question 6".Dump();
GetDepartmentNamesWithTotalEmployeeSalary(Employees, Departments).Dump();
"------------------------Question 7".Dump();
GetFibonacciSegment(4, 7).Dump();
"------------------------Question 8".Dump();
GetClosestToZero(new List<int>
3, 5, 8, -1, 9, 100, 35, -4, 2, 1
"------------------------Question 9".Dump();
"------------------------Question 10".Dump();
AlphabetCombinations().Dump();
private static List<Employee> Employees = new List<Employee>
Firstname = "Adam", Lastname = "Reynolds", Salary = 300, DepartmentId = 1
Firstname = "Alan", Lastname = "Thomson", Salary = 350, DepartmentId = 1
Firstname = "Pete", Lastname = "Thomson", Salary = 350, DepartmentId = 1
Firstname = "Paul", Lastname = "Jones", Salary = 550, DepartmentId = 1
Firstname = "Alan", Lastname = "Street", Salary = 320, DepartmentId = 2
Firstname = "Martin", Lastname = "Free", Salary = 370, DepartmentId = 2
private static List<Department> Departments = new List<Department>
DepartmentId = 1, Name = "Accounting"
DepartmentId = 2, Name = "Marketing"
DepartmentId = 3, Name = "Catering"