early 15c., "a cheat, a mean ruse," from Old North French trique "trick, deceit, treachery, cheating," from trikier "to deceive, to cheat," variant of Old French trichier "to cheat, trick, deceive," of uncertain origin, probably from Vulgar Latin *triccare, from Latin tricari "be evasive, shuffle," from tricæ "trifles, nonsense, a tangle of difficulties," of unknown origin.
Meaning "a roguish prank" is recorded from 1580s; sense of "the art of doing something" is first attested 1610s. Meaning "prostitute's client" is first attested 1915; earlier it was U.S. slang for "a robbery" (1865).
To do the trick "accomplish one's purpose" is from 1812; to miss a trick "fail to take advantage of opportunity" is from 1889; from 1872 in reference to playing the card-game of whist, which might be the original literal sense. Trick-or-treat as a children's Halloween pastime is recorded from 1927 in Canada. Trick question is from 1907.
-ster
Old English -istre, from Proto-Germanic *-istrijon, feminine agent suffix used as the equivalent of masculine -ere (see -er (1)). Also used in Middle English to form nouns of action (meaning "a person who ...") without regard for gender.
The genderless agent noun use apparently was a broader application of the original feminine suffix, beginning in the north of England, but linguists disagree over whether this indicates female domination of weaving and baking trades, as represented in surnames such as Webster, Baxter, Brewster, etc. (though modern spinster probably carries an originally female ending).
Also compare whitester "one who bleaches cloth;" kempster (c. 1400; Halliwell has it as kembster) "woman who cleans wool." Chaucer ("Merchant's Tale") has chidester "an angry woman" (the 17c. had scoldster). Also compare Middle English shepster (late 14c.) "dressmaker, female cutter-out," literally "shapester," sleestere (mid-15c.) "murderess, female killer" ("slay-ster"). Sewster "seamstress" (Middle English seuestre, late 13c. as a surname, also used of men) is still in Jonson but was obsolete or provincial after 17c. In Modern English, the suffix has been productive in forming derivative nouns (gamester,roadster,punster, rodster "angler," etc.).