How are new words assigned gender? For instance, iPhone, Nasa, Youtube,etc. So many words are invented everyday (especially names of people, brands, products, apps). How do I (or anyone) know their gender? What about "That's a NO"? What's NEIN's gender?
Very much the same way as new words are invented - by inventing ;)
In German, words that have no gender simply don't make a lot of sense - So it's not "first invent the word, then think about the gender", but rather inventing both at the same time. And the invention process is not normally something that happens instantly, but rather a common trial and error process between all users of that word on what works and feels best.
Linguistics is not so much a decision or ruling "it must be that way" - But rather watching people use the language and filter out what is common and thus "correct".
The thing is a bit different when words are imported from other languages and come without a gender - In this case some common rules apply that are explained very well in this post: For new words which are often nouns who sets the gender?