Coding Challenge : Build Tower refactoring code is it necessary In the interview you are asked to build a tower in a variable input e.g. n=3 .
The output should be as show below.
[
  '  *  ', 
  ' *** ', 
  '*****'
]

My solution is the following. Is this a good enough answer for the problem because I know people can solve it using Linq with less lines of code.
    public string[] PrintStairs(int n)
    {
        if (n == 1)
        {
            return new []{ &quot; * &quot; };
        }
       
        var result = new string[n];
        for (int row =0; row &lt; n; row++)
        {
            var level = new StringBuilder();
            var midpoint = ((2 * n - 1) / 2);

            for (int col =0; col &lt; 2 * n - 1; col++)
            {
                if((midpoint-row &lt;= col) &amp;&amp; (midpoint + row &gt;= col))
                {
                    level.Append(&quot;*&quot;);
                }
                else
                {
                    level.Append(&quot; &quot;);
                } 
            }
            result[row] = string.Concat(new string(level.ToString()));
        }
        return result; 
    }

Linq Solution:
  public static string[] TowerBuilder(int nFloors)
  {
      return Enumerable.Range(1, nFloors).Select(i =&gt; string.Format(&quot;{0}{1}{0}&quot;, i == nFloors ? &quot;&quot; : new string(' ', nFloors - i), new string('*', 2 * i - 1))).ToArray();
  }
How did you determine the output ' # ' for the case n==1? I'd have expected it to just be '*'. If you're unclear about the specification for code you're writing in an interview, it's best to either ask for clarification or document your assumptions -- it's possible they deliberately handed you an unclear spec and are testing how you handle that.
If we take the interviewer request literally, you're still missing the [ ... ] formatting.
Naming
public string[] PrintStairs(int n)
This method is named as a verb indicating it's useful for its side effect, but it returns a value indicating it's useful for its return value. You should design APIs for one or the other but not both. Since your method is useful for its return value, a more appropriate name might be GenerateStairs or GetStairs.
Use more descriptive parameter names. numberOfStairs instead of n for example.
You use two different names, row and level, for different manifestations of the same concept: a step in your staircase. I'd unify these and call them rowIndex and rowBuilder respectively, or maybe stepIndex and stepBuilder.
Input validation
Your method crashes for negative values of n. If negative numbers are not valid inputs to the method, that fact should be documented by a method header and by throwing an ArgumentOutOfRangeException.
String APIs
result[row] = string.Concat(new string(level.ToString()));
This is a very complicated way of saying result[row] = level.ToString()! string.Concat is an API for concatenating strings, but you are only giving it one string which does nothing but give you the same string out again.
Explicit string constructors are intended to be used for creating strings from individual characters or from unmanaged code; here you're just giving it another string, which also does nothing but give you the same string out again.
General behaviour
var midpoint = ((2 * n - 1) / 2);
You are doing integer division here. Double-check your math because this expression simplifies to n - 1 for positive n -- were you intending for something more elaborate to happen with this calculation? A reader might wonder if there's a bug here.
n doesn't change inside the loop, so this whole line can be moved outside of it.
General formatting
Your spacing is inconsistent:
for (int row =0; row &lt; n; row++)
if((midpoint-row &lt;= col) &amp;&amp; (midpoint + row &gt;= col))
for (int col =0; col &lt; 2 * n - 1; col++)
LINQ
Having everything on one line isn't necessarily a good thing. The LINQ solution is impenetrable when written like that. It deserves to be on multiple lines anyway for the sake of being able to read it properly:
return Enumerable.Range(1, nFloors)
    .Select(i =&gt; string.Format(&quot;{0}{1}{0}&quot;,
        i == nFloors
            ? &quot;&quot;
            : new string(' ', nFloors - i),
        new string('*', 2 * i - 1)))
    .ToArray();

Yes, it's technically LINQ, but the guts of that Select is what's doing all the heavy lifting.
The LINQ solution doesn't give the same output for n==1, which again begs the question where you got the idea that it should output ' # ' in the previous solution.
A more LINQ-y solution would have you build up the building blocks needed to write code that really is shorter. LINQ is all about operations on sequences; the thing that throws a wrench in any LINQ solution here is the fact that the output depends on how many things are in the sequence (the amount of space you use to pad the stairs depends on how many stairs there are), so you're probably going to have to enumerate sequences more than once.
Here's my LINQ-y take: start with a simple enumerator that gives you unformatted steps, from which you can take any arbitrary number of them:
private string GenerateStep(int stepIndex)
{
    if (stepIndex &lt; 1)
        throw new ArgumentOutOfRangeException(nameof(stepIndex));
    return new string('*', stepIndex * 2 - 1);
}

private IEnumerable&lt;string&gt; EnumerateSteps()
{
    for (int stepIndex = 0; stepIndex &lt; int.MaxValue; stepIndex++)
    {
        yield return GenerateStep(stepIndex);
    }
}

Now I can say EnumerateSteps().Take(3) to get:
[
  '*',
  '***',
  '*****'
]

Then define a method that takes a sequence of strings and centers them:
static class StringExtensions
{
    private static string CenterFormatted(string original, int totalWidth)
    {
        if (original == null)
            throw new ArgumentNullException(nameof(original));
        if (totalWidth &lt; original.Length)
            throw new ArgumentOutOfRangeException(nameof(totalWidth));

        int paddingNeededOnLeft = (totalWidth - original.Length) / 2;
        int paddingNeededOnRight = totalWidth - original.Length - paddingNeededOnLeft;

        return String.Concat(
            new string(' ', paddingNeededOnLeft),
            original,
            new string(' ', paddingNeededOnRight));
    }

    public static IEnumerable&lt;string&gt; CenterFormatted(this IEnumerable&lt;string&gt; sequence)
    {
        // Exercise: how will you check for a null input sequence here? If you check it here and throw ArgumentNullException, will it actually throw when you call CenterFormatted?
        int largestStringLength = sequence.Max(s =&gt; s.Length);
        foreach (string original in sequence)
        {
            yield return CenterFormatted(original, largestStringLength);
        }
    }
}

Now you have two orthogonal and reusable things: a thing that generates steps and a thing that centers sequences of strings. You can compose these quite concisely in a LINQ statement to solve the original problem:
EnumerateSteps().Take(3).CenterFormatted().ToArray()
which gives me
[
  '  *  ', 
  ' *** ', 
  '*****'
]