Judgement

How do you react to having more than one solution provided to solve an issue?

Every problem has more than one solutions. If there isn’t a second solution then we haven’t discovered it yet.

Someone

It is a common thing to run into multiple solutions for the same problem in our lives especially in computer science. For example if we assume that the problem is that we don’t have tomatoes for a salad, we can either go down to the grocery store and buy some or order them online. In both cases we are solving the problem but we need to understand what would be the most optimal and efficient solution.

Similarly to computer science if we are to solve a problem where we would like to return more results, we can use different approaches and all approaches could have the same result but one will be more optimal and efficient than the others.

Correct but not optimal:

public StudentDetails GetDetails()
{
    var student = new StudentDetails
    {
        Name = "Prodromos",
        Surname = "Kachrimanidis"
    };
    
    return student;
}

Correct but optimal:

public (string strName, string strSurname) GetStudentDetails()
{
    return ("Prodromos", "Kachrimanidis");
}