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

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

Interview question #2

This is related to PHP's array . An array has number of elements. All elements are integers and unique, which means there is no repetitive integers. (e.g.) $foo = array(7, 5, 9, 13, 2, 8); You have to sort the array, provided: You should scan the elements only once. You're not allowed to compare the elements when sorting. (i.e., you're not supposed to use any comparison operators) Sorted resultant array may not be the source array. How will you do that?

Gen Y workforce, a threat to Indian IT?

I belong to Gen X . I'm noticing high change in the way of thinking and approaches of Gen Y (born after 1982 or 1985) workforce. Whenever I sit for interviews, I feel getting quite old... Characteristics of Gen Y (as I noted) Freshers Everybody owns mobile phones and laptop. At least using them for 2-years. Only very few people know touch typing. Almost all are interested to start their career in programming; but they don't have any basic knowledge. Most of the people can speak in English. I'm noticing a huge change here; In our generation, many people would be having good programming skill but can't express them in English People from CS aka Computer Science background says that they don't use computer labs as they own laptop. I can remember my college days at The American College, Madurai during my PGDCA and MCA--we often used to demand more lab time. I still remember that I'd run to computer lab by 7am and would still find few guys...