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

Don't innovate!

Gopinath had a shocking news for me this morning... the site that we were cloning--cloning with additional features and innovations had just released a new version, but with six features taken from our version. Had we released it some days before, we might have grabbed the innovation pride. But... The weirdest thing was that we're forced to clone including the landing page as in their previous version (and that is the reason for this delay), but when we're doing, they switched to our homepage version! Damn... It doesn't stop here. I was pacifying myself and pushing the software to be released by afternoon--at least then to claim the innovation card. Now Kanagavel has another "good news" for me, that we have to "tune" the product to be exactly as in PSD that would take another week to ship...

Stampede and the "Dirty" "Dark" Crowd

Actor Ajith Kumar’s recent interview has sparked quite a few conversations on social media. The part that caught my attention, was his take on crowds. About 30 years ago, when I first joined a college in Madurai after growing up in other places, I experienced a few cultural shocks. Perhaps these weren’t unique to Madurai, but that’s where I first noticed them. One major thing that stood out was the behavior of crowds. For instance, if you suddenly see people rushing to board a bus, chances are there’s a pickpocket in action. During one of Madurai's annual festivals, I noticed some young men carrying water bags — not to distribute water, but to spill it on women, often on their chests. Shockingly, this was almost normalized; parents would quietly tolerate it to avoid public embarrassment, walking a little farther behind the crowd. When some women happened to witness this, they would just shoo the boys away instead of confronting them. The crowd, in such cases, became a kind of...

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...