Change the subordinate question to statement word order.
I always wondered [how I ever came up with it.]
Change the subordinate question to past and statement word order.
I always wondered how I had ever come up with it.
Change the tense in the main clause to present perfect and adjust the verb form and word order in the subordinate clause.
I have always wondered [how I ever came up with it.]
subordinate (V) – in grammar, place a phrase or clause within a another clause. See Subordinate Clauses.
reported speech – restating what someone says within another sentence. See Subordinated Statements.
embed (V) – in grammar, place a word, phrase, or clause or clause within a larger grammatical structure. For examples of "word packaging", see Cleft Clauses.
Sentence was received in an email communication.
Man shrugging. By Cbarr (WMF), Wikimedia, 12 Oct 2011.wikimedia.org/wiki/File:RobGrindes-shrug-143px.png. CC BY SA 3.0. Accessed 11 Jul 2018.