• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Code Review - Design problem - Theatre Seating

Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

I submitted the attached solution for given design problem to prospective employer. I did not hear back from them :-(. This doubts me about my solution hence want to have a second opinion. As far as the solution goes, it works. Tested with different scenarios. They mentioned that they want "production quality" solution.

Github :- https://github.com/saurabh-pillai/Theater-Seating

Any input is appreciated.Thanks.

PS:- I had to upload source code to Github because I could not upload zip/txt files as an attachment.
Posts: 5326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The one glaring omission from a solution that is requested to be 'production ready' are tests. There are no tests. No Unit Tests, no System Tests, no tests at all. If I were reviewing your application for a job I would have stopped there and not even looked at the rest of it.

Delivering a program without tests is like selling a car and just telling the customer "I'm sure it won't catch fire. It probably won't. Maybe". Tests demonstrate trust in your product and deliver confidence to your customers. Without them you have nothing but your word.
Posts: 16933
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Were you given a chance to ask about what constitutes "production ready"? Did you at least try to ask? I would have. There are a lot of criteria that you could think of and everyone has their own take on what "production ready" means. I'd agree about the unit tests though. I wouldn't want to push any code to production that didn't have a comprehensive suite of tests that were all passing.

As for the OO part, I noticed one thing: Your TheaterRequest class breaks some OO design principles. Why would it replicate the detailed information about what section was given? Why not just have a reference to the TheaterSection that was assigned? Instead, you duplicated information for rowNumber and sectionNumber.  I probably would have had them reference each other, i.e., when you fulfill a TheaterRequest, you'd have it reference the section to which it was assigned and in turn, you'd have the TheaterSection reference the Request that was assigned to it. I don't know if you have a requirement to handle different show times but that might make it even necessary to have a Moment-Interval relationship where ShowTime maps TheatreSection to the associated TheaterRequest.
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic