Skip to main content

Interview question #3

I came out with another interview question to find out the candidate's visualizing power:

The object is chessboard--you know it has black and white squares.
  1. How will you visualize the chessboard in terms of mathematical formula?
  2. How will you visualize/depict the same in PHP code?

Comments

Thanks lawrence krubner for your comments. Actually, I'll be expecting just two keywords: Matrix and two dimensional array; that's all. I don't expect any brilliant answer:-)

Popular posts from this blog

Humble Award - Dr. A.N. Sreevatsan

Dr. A.N. Sreevatsan , ENT specialist located in Adyar, Chennai is one of the gems available in medicines. No assistants in his consulting room and he'd take at least 15mins for every patients. So far I have referred many and all are happy with his approach. Every wannabe doctor should visit him personally to understand his approach. I wish him to be more famous than now. Update (2010-11-21) : Added link to Google Map Keywords : Sreevatsan, Srivatsan, ENT, Adyar, Chennai, Hospital, Doctor

Converting PSD with PHP/ImageMagick

After seeing feature rich options in Imagick PECL extension at Mikko Koppanen 's (the author) website and also impressed with ImageMagick 's features, I have decided to use it for the PSD to XHTML conversion website that I'm architecting and managing. Since, the team wants programming help for converting PSD images, I have tried it (documentation is sparse on PSD handling) Converting PSD to PNG/JPEG/etc Note that, flattenImages() is needed for layered/multi-page PSD file. <?php $im = new Imagick('test.psd'); $im->flattenImages(); $im->setImageFormat('png'); $im->writeImage('test.png'); ?> Extracting PSD layers One by one <?php $im = new Imagick('test.psd'); $im->setImageFormat('png'); for ($i = 0, $num_layers = $im->getNumberImages(); $i $im->setImageIndex($i); $im->writeImage('layer' . $i . '.png'); } ?> Note that, there is a better version below In a single call with writeIm...

Tamil Castes and Consolidation - Hacker Style Cheat Sheet

Tamil caste system and its hierarchies are complex and difficult to understand--due to different addressing systems. Similarly, the caste consolidation or grouping of similar or different castes under some title is extremely confusing. In many cases, the caste consolidation doesn't make any sense, but due to ulterior motives of politicians for their vote bank politics, these systems exist. So, to explain the system, I created a formula like cheat sheet: Vellalar = Pillai + Mudaliar + [Gounder] Pillai > Mudaliar ~ Gounder Thevar = Maravar + Kallar + [Agamudayar + [Senathipathi]] Senathipathi >>> Agamudiyar > Maravar ~ Kallar Agamudayar ~ Gounder Vanniyar = Padayachi + Gounder + [Naicker + [Reddy]] Naicker >>> Reddy > Padayachi ~ Gounder * Gounder is BC, Padayachi is MBC