No, a prototype is not mandatory for obtaining a patent. However, a working prototype can support your patent application.