Calculating linux based octal file permission I'm applying for a mid level devloper position. 

In order to  progress to 2nd interview, you need to pass a technical test.
One of the questions was to write a function to work out linux based octal file permissions.

How would you guys improve it, and why?

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

public class ReadWriteExecute
{
    public static int CalculatePermissionSum(string permString)
    {
        int octalPerm = 0;

        foreach (char permission in permString.ToArray())
        {
            switch (permission)
            {
                case 'r':
                    octalPerm += 4;
                    break;
                case 'w':
                    octalPerm += 2;
                    break;
                case 'x':
                    octalPerm += 1;
                    break;
                case '-':
                    octalPerm += 0;
                    break;
            }
        }
        return octalPerm;
    }

    public static string SymbolicToOctal(string permString)
    {
        string octalPerm = string.Empty;      
        for(int x=0; x&lt;=6;x+=3)
        {

            octalPerm += CalculatePermissionSum(new string(permString.Skip(x).Take(3).ToArray())).ToString();
        }
        return octalPerm;
    }

    public static void Main(string[] args)
    {
        // Should write 752
        Console.WriteLine(ReadWriteExecute.SymbolicToOctal("rwx-x--r-"));
    }
}
My thoughts for improvement:


You don't need to run ToArray() on your string to loop through it. Plus, it seems like CalculatePermissionSum() is expecting a single permission string like "rwx" or "r-x", so in a fixed-length situation like this (where the flags are also in a predefined order), don't bother with a loop.

int octalPerm = 0;
octalPerm += (permString[0] == 'r') ? 4 : 0;
octalPerm += (permString[1] == 'w') ? 2 : 0;
octalPerm += (permString[2] == 'x') ? 1 : 0;
return octalPerm;

SymbolicToOctal doesn't account for permission representations where the first character is a non-permission flag, like a directory "drwx-x--r-"
There's no error-checking in case an unexpected value comes through. If I ran SymbolicToOctal("Hello World"), I should really get an exception of some kind.
I disagree with the previous comment about using regular expressions to validate the input. Validation is good, but regular expressions would add a (relatively) huge amount of overhead for such simple validation. Code that works on file permissions isn't likely to be run a couple times here and there - it's more likely to be used as part of something that might run a LOT, so every inefficiency will add up. If you validate, just check the length and the expected individual characters. It might be more code compared to a regex, but it'll run a LOT faster.
If I was an interviewer, I would give a LOT of brownie points to the interviewee who threw in some unit-testing code.