Q: For a given log file, count the number of ERROR statements for each minute.
Example input:
2013-03-01 12:00:00 [ERROR] ...
2013-03-01 12:00:01 [ERROR] ...
2013-03-01 12:00:01 [INFO] ...
2013-03-01 12:01:05 [ERROR] ...
2013-03-01 12:01:05 [WARN] ...
2013-03-01 12:03:02 [ERROR] ...
2013-03-01 12:00:02 [ERROR] ...
Example output:
2013-03-01 12:00 3
2013-03-01 12:01 1
2013-03-01 12:03 1
Q: Write up a function that can take multiple functions as input, runs them from left to right, and inputs the output of each of those functions into the next function.
Q: Given a dollar amount, figure out how many coins it can be broken into (i.e. quarters, dimes, nickels and pennies that make up the full amount).
Example input: $1.21
Example output: [0.25, 0.25, 0.25, 0.25, 0.1, 0.1, 0.01]
Q: Given a binary tree, print the path from the root to each leaf node.
Q: Design a parking lot that supports different types of vehicles, where spots are of different sizes. E.g. regular spots can accommodate regular cars, but cannot accommodate a vehicle as large as a bus. However, a bus can take up as many regular spots as it needs to park.