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

I'm Zend (PHP 5) Certified Engineer:-)

As of January 13, 2007, I'm ZCE/ Zend Certified Engineer (PHP 5)

RTaKeyman Bookmarklet v2.0

RTaKeyman The above bookmarklet is for English to Tamil transcription. This should work like a Input Method Editor on web page forms. The first version I tried didn't work well and so this bookmarklet version. Version 2.0 2004-12-27 1.0 2004-12-12 Usage Make a bookmarklet with the above link. Point to a web page where you want to enter Tamil characters and click the bookmarklet. This will initialize the keyman for that page. Then start typing on the forms; RTaKeyman will transcribe the characters whenever it sees a space, carriage return and tab. To-do Turning on/off keyman (i.e., to enter both Tamil and English). Help and other user interfaces. Credits Sundar for informing the necessity and for being a beta tester

Prediction: Expensify will crash through its insane question-based hiring process

 I have huge respect for  David Barrett for his technical background. But, his company, Expensify is following a modern  psychometric test called a  question-based hiring process . The company claims to look for candidates with 'Talent, Ambition, and Humility'. The psychometric test was a fad in India about 20-years ago and the companies that followed the hiring approaches are no more and some have changed the approaches to survive. I just thought of blogging my thoughts here to see how Expensify evolves.