[0] Disclaimer, I made cards.c13u.com for a class project
The one that I did this morning was:
If given the root of a binary tree, calculate the number of unival subtrees contained in the tree.
The back is usually either blank, or has a space and time complexity that I should get if I did it correctly.
It’s important to make sure you solve it at least once, and understand the solution well before you make a card of it.
Also, what kind of problems are you putting into the cards? Are there any "must-know" interview questions that we should all study and memorize?
Please share an example card.
I’ve given 3 examples in some other replies, but I’d say that it’s most beneficial to keep some common stuff in the front of your mind. Like various operations on graphs and trees, how exactly to formulate dynamic programming subproblems, etc. For that I’d say it’s better to have a lot of different problems in the deck for those types of those things, rather than memorizing definitions of DP and linked lists.
Some cards I’ve put in lately are:
Calculate the level of a binary tree with the minimal sum of its elements.
Reconstruct a binary tree given an inorder and preorder list of the nodes.
The backs are usually blank or space and time complexities that I should be able to achieve.
I also did this for various college courses I’ve taken, and I’ve found that to be tremendous for practicing and recognizing patterns.
I don’t use them to memorize the answers, but more as a cue to do the problem. I add 1-5 new cards a day. The cards aren’t facts, but actual problems. It’s been really effective so far. I can pretty easily recognize what the pieces I need to apply on novel problems much more quickly.