In a passive voice sentence, the object becomes the subject and the subject becomes the object of a prepositional phrase.
The boy [subject] saw [verb] the dog [object]. Active voice
The dog [new subject] was seen [passive verb phrase] by [preposition] the boy [object of the preposition]. Passive voice
Your sentence, "Who was the airplane invented by?" ends with an unattached preposition and is considered less than correct. In the passive voice, that sentence should be, "By whom was the airplane invented?" or, "The airplane was invented by whom?" The fact that these sentences sound awkward and stilted is reason enough to not use the passive voice in constructions such as these.
Student or Learner