[RC Diary] Mock interviews (-94)
Longest increasing subarray
Given an input like
[6, 7, 8, 1, 2] it should return
[6, 7, 8].
magic index problem
A good take away lesson from this exercise was that if you have to deal with array splitting (like in binary search for example), you might want to keep the original array and pass around boundaries indexes, so it's easier not to lose the position of the magic index.
"aabcccccaaa" -> "a2b1c5a3" and if the compressed string is longer return the original.
Print all possible n pairs of balanced parentheses.
For example, when n is 2, the function should print
()(), when n is 3, we should get
Pseudocode for this could be
f(n) = for i in range(n): for l in f(i): for r in f(n-i-1): results += "(" + l + ")" + r return results
Find unique int among duplicates
The idea here is to recursively compare max subsets of array
Writing about testing
The description should be something like "Different types of tests, how to create and run good tests, best practices, available tools for testing".
The important things to focus on IMHO are
- why should I test? And,
- how do I write good effective tests?
One should test to reach the objective of pushing into production and then leaving to have lunch. One should arrive to this kind of confidence in their architecture and testing solutions.
To have that tests should be written, and a continuous delivery process started. But
- how good does a test should be written to be good enough?
- how many tests is enough?
- have I covered all the branches?
Read Uncle Bob take on mutation testing
- prepare test talk "Different types of tests, how to create and run good tests, best practices, available tools for testing" for March 1 at 2pm
- project lamp
- still need some attention needed for timsort, radix sort, dijkstra algo
- chapter 1 and 2 of the little schemer in Clojure
- reflect on first two weeks of RC