That O(n^2) algorithm you're writing in Collabedit is losing you any chance of getting that job you're interviewing for. Chances are you're comparing every element in an array to every other element in that array. Sure it's an easy solution to the problem, but that's the trick. The interviewers are looking for an efficient solution to the problem. I've read over a number of different publications for how to do well on a technical interview and I found that they just say things like "remember your data structures" and then throw you into doing problems. My goal here is to show you some of the tricks that I have discovered for solving a problem efficiently.
So back to your O(n^2) algorithm. I have found that when you are dealing with an array you need to organize your data. If you are dealing with a problem like trying to combine overlapping numerical data structures (like the overlapping interval problem) it is best to sort your array. Then instead of comparing all items in the array to all other items, you just have to compare adjacent items. Remember that when you sort it will be O(n log n), which is better than your O(n^2). What if you aren't using numerical data types? Well then sorting doesn't really make sense and the problem probably isn't asking about overlapping intervals. What it probably is asking is to find duplicates. So how can we put the objects in some type of order? Use a hash table. I know the worst case for a hash table lookup is O(n), but every interviewer I have spoken with has been okay with using the average case of O(1). Now you can just iterate through your array and put items on the hash table if they aren't there already. If they are there, then you just found your duplicates. And hey now we're running in O(n) time.
Oh hey, it's a problem with a binary tree I should use pre/in/post order traversal to solve this one. Hold on a second. Let's not get ahead of ourselves. Remember that any of those three traversal methods in the tree do a depth first traversal. If the question is asking about cousins in the tree, you'd better start thinking about doing a breadth first traversal. Doing a breadth first traversal is fairly straight forward. The basic idea is to take a linked list of nodes that are all on the same level in the tree and create a new linked list of nodes that are the children of the nodes in the original linked list. If you start with a linked list of only the root node, you will do a breadth first traversal of the tree.
Honestly, the best way to get better at interviews is the same as getting better at everything else: repetition. In the past 6 months I have done over 30 interviews and I can tell you that my skills have improved tremendously. My advice would be to apply to companies that you have very little interest in first. You'll go through the interview process and make mistakes, but who cares? You'll learn from those mistakes and besides you didn't really care about those companies anyways. It's all about learning and getting better.