Skip to main content

Interview question #1

Since I have been asked to interview experienced PHP programmers, I was preparing few interview questions. I came to know, most of the people ask questions found in the Internet; most of them are like "What is the function used to connect MySQL DB in PHP". Personally, I don't like these types of questions; I'd thought the person must apply ideas what he was taught in colleges--finally I came out with one question:

A product vendor has Quantity Vs. Price data like
1 -> Rs. 50
2 -> Rs. 95
3 -> Rs. 140
.... like upto 1 million data. He wants a system, which gives the price when the quantity is provided. For example, if you provide the quantity value as 2, then it should provide Rs. 95. How this system can be designed?

As expected, all the people said about using database tables and quering on quantity. I have asked them to find out a system which doesn't use databases--provided the accuracy of the system may not be 100%--it may give at least 90% accuracy. To my surprise, none of the people I have interviewed yet didn't provide any solutions.

I must find out few other questions especially for a post of "Web Application Developer".

Comments

Anonymous said…
amount = (45 * quantity ) + 5
For comment#1:Good, if the data are just 3. What if you have about 1 million data? What is the procedure?
Anonymous said…
use Chi Square
For comment#3:You've exceeded my expectation:-) I'd rather expect even a simple keyword. May I know your name?
Anonymous said…
Is it possible to use an associative array(performance?)? - like

$product[$price] = $quantity;
Online Pharmacy said…
This comment has been removed by a blog administrator.
Sindhuja said…
$amount = (45 * ($quantity -1)) + 50

Popular posts from this blog

Save American College, Madurai

This post was written in 2008 and outdated now. For update, please check Save American College, Madurai (Update 2011) Update (2011-01-16) : Save American College, Madurai (Update 2011) I'm highly privileged to have 3 degrees (B.Sc. (Spl. Physics), PGDCA and MCA) from The American College, Madurai, South India . Unlike other "commercial" colleges, American College has given room for poor students and uplifted them. And unlike other "elite" colleges who'd give seat only for "intellectuals", American College has produced geniuses. In the recent months, the saddening thing is that the college is under divide (Principal Vs. Bishop). Here is the email I sent to alumnae lately informing about the informations that I received about the developments: Update (2011-01-16) : Save American College, Madurai (Update 2011) All: I was thinking that the " Save American College " campaign was a FUD . But, when I tried to understand the problem through my

Open source PHP frameworks and problems

I was using CakePHP for sometime and proposed CakePlus , another UIMS toolkit on the top of CakePHP but also altering some problematic core of it. The thread should explain the outcome of the post. And, then I noted Akelos framework has most of the things built in. Issues with frameworks esp. CakePHP Scalability not a priority - Developers aren't aware that we can't throw more and more hardware Excessive use of regular expressions Evangelist isn't aware that the framework throws many queries unnecessarily More memory consumption - 100M would never be enough for a simple project Poor coding standards and practices - Prolong use of extract() often leads to more memory consumption Can't use the native approaches or baked codes. The override approach always lead to hard to debug codes Poor architected codes and no clear defined approaches. People belong to the cult drives the direction and often throws unprofiled codes. No native provision to share codes between M-V-C and

Save American College, Madurai (Update 2011)

This article was written on Jan 16, 2011 and updated on Jan 26, 2011, Mar 16, 2011, Mar 21, 2011, Mar 28, 2011, Apr 10, 2011, and May 1, 2011 In 2008, I have written Save American College, Madurai that seemed to help many people including alumni to understand the situation, politics and chaos. At that time, I was favoring Principal's party as favoring Bishop's party could turn adverse as they're was already trying to replace non-permanent staffs; in fact, I have even donated a meager amount for the legal battle.[ Update : Corrected the sentence to convey the intended meaning. Thanks for those who pointed out] This time, people hit the same old article and asking the details. When I contacted, this time, nobody have clear reason for the chaos--except that it's a ego clash between Principal and Bishop party. Problems and reasons Till now, all bishops were being part of The American College, Madurai Governing Council. All/Most of the bishops played subtle r