I was recently asked to write some sample code that solves a difficult technical problem. I've been mulling over what kinds of problems might be good to solve in code to demonstrate my skills in such a situation.
I've seen similar posts discussing what reviewers are looking for in the context of code interviews, but I'm interested in the specific problems that might be good to solve. For example, this blogger offers the following sample code ideas:
- A utility class for logging events and errors either to a file or the system event logs with a configurable level of verbosity.
- A set of stored procedures for maintaining and searching data in a hierarchical tree structure.
- An implementation of the singleton design pattern to serialize access to a resource file.
- A calculator function that takes a single string of input that includes numbers and operators and returns the numeric result of the equation. Don’t forget input validation, error handling (divide by zero), and operator precedence concerns!
- A method that takes a URL to a web site and a local path and downloads all image files based on tags.
- Create a method that takes a keyword, message, and login credentials and uses the Twitter API to respond to post the message as response to any friends of the account specified.
I'd like to see these types of examples, perhaps with a harder technical problem. Ideally example problems would support demonstrating understanding of Java constructs/data structures and the Mode-View-Controller (MVC) paradigm.
Obviously the goal here is to find samples of the kinds the problems that would be good to solve in this situation, not to copy and paste code (especially if it is not yours!).