Is it possible to ask the professor to check assignment before submitting?

Most instructors will refuse to check your homework for you before you turn it in. You get it graded once and only once. There are no do-overs where you get to turn it in the first time, they point out your mistakes, then you get to turn it in again after you've corrected it.

If you're confused, you can ask clarifying questions about what the homework asks (e.g., desired behavior in corner cases, output formatting, error handling, other constraints and anything else that seems ambiguous) and about the underlying material (e.g., an algorithm discussed in lecture that you need to apply) but not about the correct answer or whether your answer is okay. Some instructors (e.g., me) will help a student with debug, but usually only to help you learn the skills involved. They usually will not debug your program for you.


As Nicole correctly points out, most instructors won't be able or willing to "pre-grade" homework, but some may. So if you feel strongly about it, you can certainly ask.

That said, it's probably more fruitful to ask one or more targeted question(s) about the things that you are unsure about. Note that "please run my program and tell me if it works" isn't a targeted question, nor is "here is my code, will I get all points for this". A targeted question may include a succinct summary of your approach and the parts that you are unsure about, and asking if you are on the right track. I imagine that most instructors will be more than willing to give you feedback on that.

As a rule of thumb: if a question would be closed on Stack Exchange (particularly, if it would be closed as lacking prior research or being too localized), there is a good chance that an instructor would also not be happy about it. Incidentally, this is one of the core reasons why I strongly support my students being active on Stack Exchange - it trains them how to productively ask for feedback better than any other way that I know of.


There are two cases to consider:

  1. You do not understand what the program is supposed to do. In this case it is appropriate to ask the professor questions of the form "What should happen in this case?" or similar.

  2. You do understand what the program is supposed to do. The way you make sure you are doing it right is a combination of desk checking and testing. Remember to unit-test non-trivial modules, as well as testing the whole program.

Testing is part of the work of programming. It is not reasonable to expect your professor to do it for you.