Guidewire interview question

Implement a sparse matrix Java class with a constructor, set and get method. The matrix has millions of rows and columns and is at a maximum 15% populated.

Interview Answer

Anonymous

27 Jul 2009

Just Google the problem... In fact, the interviewers asked me if I had ever implemented this problem, and they were ready to switch to another one if I had answered yes. I used a Hashmap in the solution and wish I had had more of the API calls for these at the ready. Practice probably helps too.