Many players develop pretty good strokes, timing, and footwork, and in practice drills, where they know where the ball is going (i.e. rote drills), can execute them pretty well. But once they get into a more random drill or game, where they don't know where the ball is going (i.e. forehand or backhand), they fall apart. How can you fix this problem?
The key thing here is reaction. Once you have good strokes, you can do various random drills such as having your partner or coach randomly block to all parts of the table while you loop or drive them back to the same spot, or serve backspin that your partner or coach pushes back anywhere and you have to loop. (Focus on a good neutral position, react rather than trying to anticipate, and step to the ball.) These are excellent drills. But many players struggle with them, and don't get enough practice time on these types of drills to progress as fast as they'd like.
There's a simple alternative. Find someone who can help you out – it doesn't have to be a table tennis player, it can be a friend, spouse, son/daughter, anyone – and simply have them randomly point left or right. You react by shadow-stroking either a forehand or backhand, depending on which way they point. Or, if you want to get fancy (and more closely mimic a game situation), have them toss balls at you randomly, forehand or backhand, and you react, either by shadow-stroking, or actually hitting them with your racket. (It's basically multiball, except since they are tossing the ball at you instead of hitting off a racket, anyone can do it.) In both cases, it's not exactly the same since you aren't reacting to a ball coming off a paddle, but it's reasonably close.
Then watch as your apparent reaction time in game-type play improves! It's all about zeroing in on a weakness, and practicing the specific thing that you are having trouble with. The principle applies here and in all other aspects of table tennis . . . and life.
And a call for help – can anyone design a simple phone app or other inexpensive device that randomly points left or right so a player can do this solo?
EDIT: And from the comment below, here's the solution - Table Tennis Edge!