Applying 'Uncle Bob's Clean Code' on this small exercice I'm trying to apply Uncle Bob's Clean Code practices onto this exercise I'm helping someone with.
(The exercise assignment is in a &quot;docstring&quot; comment above the Main.)
I'm unsure what the best naming convention would be for ReturnAllCombinationsOfInputtedList, although I suspect it doesn't involve the return word in it's name for starters.
Same for CreateArray1to30(). Any suggestions for name choices/proper conventions here?
Do you guys see anything else that I should've done differently in your opinion?
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleAppHelpingAlexWithExercices
{
    class Program
    {
        //**************************************************************************
        // How many different exam tickets with two different questions can be made, 
        // from a syllabus with 30 questions
        //**************************************************************************
        static void Main(string[] args)
        {
            int[] questionsList = CreateArray1to30();
            List&lt;string&gt; combinations = ReturnAllCombinationsOfInputtedList(questionsList);
            int amountOfUniqueCombinations = combinations.Distinct&lt;string&gt;().Count();
            Console.WriteLine(&quot;Total unique combinations: {0}&quot;, amountOfUniqueCombinations);
        }

        static List&lt;string&gt; ReturnAllCombinationsOfInputtedList(int[] questionsList)
        {
            List&lt;string&gt; combinations = new List&lt;string&gt;();
            int[] aTest = new int[2];
            foreach (int firstQuestion in questionsList)
            {
                foreach (int secondQuestion in questionsList)
                {
                    if (firstQuestion != secondQuestion)
                    {
                        aTest[0] = firstQuestion;
                        aTest[1] = secondQuestion;
                        //Makes AB and BA tests both AB, so we can de-duplicate later.
                        Array.Sort(aTest);
                        combinations.Add(String.Format(&quot;{0}&amp;{1}&quot;, aTest[0], aTest[1]));
                        Console.WriteLine(&quot;{0} and {1}&quot;, aTest[0], aTest[1]);
                    }
                }
            }
            return combinations;
        }

        static int[] CreateArray1to30()
        {
            return Enumerable.Range(1, 30).ToArray();
        }
    }
}
CreateArray1to30() could be renamed to CreateQuestions()
ReturnAllCombinationsOfInputtedList() could be renamed to Combinations() or QuestionCombinations()
ReturnAllCombinationsOfInputtedList() does too much. The call to .Distinct() is unecessary, and can be replaced with correct indices in the first place. Furthermore, the aTest array is entirely useless and could be replaced by using firstQuestion and secondQuestion directly.
Strings are a non ideal data structures for the exams, as you use a different format when printing them out

using System;
using System.Collections.Generic;
using System.Linq;


namespace ConsoleAppHelpingAlexWithExercices
{
    struct ExamTicket {
        public int Question1, Question2;
        public ExamTicket(int Question1, int Question2) {
            this.Question1 = Question1;
            this.Question2 = Question2;
        }
    }
    class Program
    {
        //**************************************************************************
        // How many different exam tickets with two different questions can be made, 
        // from a syllabus with 30 questions
        //**************************************************************************
        static void Main(string[] args)
        {
            int[] questions = CreateQuestions();
            var combinations = new List&lt;ExamTicket&gt;(Combinations(questions));
            foreach (var combination in combinations) {
                Console.WriteLine($&quot;{combination.Question1} and {combination.Question2}&quot;);
            }
            Console.WriteLine(&quot;Total unique combinations: {0}&quot;, combinations.Count);
        }

        static IEnumerable&lt;ExamTicket&gt; Combinations(int[] questions)
        {
            for (int i=0;i&lt;questions.Length;++i) {
                for (int j=i+1;j&lt;questions.Length;++j) {
                    yield return new ExamTicket(questions[i],questions[j]);
                }
            }
        }

        static int[] CreateQuestions()
        {
            return Enumerable.Range(1, 30).ToArray();
        }
    }
}