smart aleck (n.) Look up smart aleck at Dictionary.com
1865, perhaps in reference to Aleck Hoag, notorious pimp, thief, and confidence man in New York City in early 1840s.