This is a theoretical question, and excuse me if it is not clear, I am new to this field.
Thing is, I was asked to design a chess game in an interview (java/ android.) And my intuition was that P. Norvig is a very good and known designer, and that pocker is very similiar to chess. So I tried to imitate his pocker design. As far as it was possible for me to remember and understand it.
However, the interviewer said that it is the first time he saw an implmentation of this problem by enumeration. And that a proper implementation should have class for every piece (why?!). I actually asked why, and the answer was that every piece has very complicated rules (but to me these rules seem to be simple.)
Is it bad to design chess game like that (with enumeration)? What is the best approach to design a simple chess program in Java? And why?
I will thank very match anyone who can shed light on this topic.
I was asked to design a chess game in an interview
- the interviewer isn't at all concerned with you actually designing a chess game. Or for that matter, that its fast or efficient. The interviewer is interested in finding out how you design software. Alternatively, the interviewer is interested in if you can come up with the same design as he or she has in their mind when the question is asked. Please read Why do interview questions make poor Programmers.SE questions?