The first thing on my mind would be avoiding detection. You can't spin up 5 DO droplets and do your work from there-- every IP you use needs to be a residential IP, and you need thousands of IP addresses. You could go to the trouble of building your own botnet, but that's illegal and very difficult.
Luckily, there's an application called Hola that has convinced 20 million people to willingly join their botnet, and you can buy yourself access to it right here: https://luminati.io .
You'd think that would be the hardest part, but that service means it's the easy part. Now I'd need to go learn PhantomJS and start creating accounts-- being sure to keep each account appearing at a particular IP address. The hardest part is generating some credibility for these accounts. They should always look like they're active-- so I'd be sure to have each account load far more posts than they vote on, and I would upvote plenty of things that I wasn't paid to upvote. Just to generate some randomness.
But that only gets me part of the way there-- these accounts would also need to contribute. My first thought is that you could just scan for reposts in the default subreddits and then repost popular top-level comments from the previous post. I've actually seen this pointed out a few times on reddit. With the amount of comments reddit gets, they probably don't have the resources to detect duplicates.
Hackernews would be significantly harder-- I have no idea how you could generate relevant comments without doing it by hand. That's my guess as to what they're doing.