I understand that this is quite a general question and it depends on the company, but I will try and explain.
I was given a problem where I had to write some code to verify a sudoku puzzle was solved correctly (inputted using a 2 dimensional array). The interviewer had me go to a https://code.stypi.com page, and had a template ready for me. He watched me write the code to verify the sudoku puzzle, and asked me questions about why I did it the way I did.
Now, using the website he gave me, I couldn't compile, run, or debug the code (I asked him). It was equivalent to writing it in a text editor, and hoped it worked. I finished the code up, and the interview ended. I was told I will be contacted when someone reviews the code.
As soon as it ended, I of course tested the code to see if it worked. There were minor errors, such as redeclarations of variable names and variables that were undefined (because I renamed some, and didn't think to change the parts where I was using it).
Besides those errors, I had one major one. This is the part that actually messed up my algorithm. I switched up a + and - in one spot, so the code didn't work as it was suppose to because of this. With that said, if you switched the + and - in that one spot, and fixed like 1 redeclaration and 1 undefined variable, then it worked perfectly.
This was my first interview, so I really don't know how well I did. If I were writing code and just going at it by myself, I would've been like, "wow, I can't believe I only have 4 errors after writing that..." after compiling.
Is this a big deal, or is the company trying to determine whether or not I have basic programming skills? I feel as if it is unfair for them to take this harshly, because I couldn't test or compile it - which is obviously unrealistic.
EDIT: The real error was also easy to track down. Fixing everything took me less than 3 minutes after the interview ended.