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

Looking Back at My Predictions

People who work closely with me often appreciate my ability to anticipate trends in technology stacks. With that in mind, I recently revisited some of my old blog posts—and it turns out, many of those predictions have held true. Here are a few handpicked posts that aged well: Prediction: Expensify will crash through its insane question-based hiring process February 23, 2022 BlackLivesMatter campaign may consolidate votes for Trump June 15, 2020 Technology prediction for 2018 January 16, 2018 Node.js and client app are the future of webdeving? December 29, 2011 Yahoo! and delicious.com - What's wrong? December 19, 2010 Disclosure: The following ChatGPT prompt is used in this blog post: Please fix the language of the below text and highlight the changes in bold:

The Overrated Tamil Culture

Since the COVID period, I developed an interest in exploring old books from the 1700s to the 1900s through Google Books. I first focused on the celebrated Protestant missionary Ringeltaube, but over time, my curiosity expanded toward understanding the demographics and social practices of that era. In Tamil Nadu, what is often celebrated as "Tamil Culture" revolves around the practice of monogamy, known locally as à®’à®°ுவனுக்கு à®’à®°ுத்தி — meaning one woman for one man. Some even compare this tradition with practices in other states, claiming Tamil culture is especially unique. This sense of pride is particularly strong around Madurai, where people often refer to themselves as “pure Tamil” when compared with neighboring regions like Kanyakumari, whose people they call Malayalis. What’s striking, though, is that this proud image doesn’t always align with historical accounts. A book published in 1885 (I’ve chosen not to mention its title or link to avoid stirring controversy) ma...

3-years of Ubuntu MATE - Good and the bad

Many people are getting shocked to know that I'm using Ubuntu in my workplace. Linux/Ubuntu is more of an alien here as Windows 10 and Mac OSX is having good market here. First of all, I'm a very happy Windows XP user. In XP, I used to do most of my JavaScript and PHP in  Devl , the editor that our team has developed. Reason for switching to Ubuntu MATE Primary reason for switching to Ubuntu was, at one point of time PHP team stopped supporting Windows XP . So, we're left with few options: 1. Upgrade to Windows Vista, 2. Switch to Ubuntu. We chose the second option to experiment it. One of the major challenges was choosing the right code editor and we chose VS Code . Ubuntu MATE - Pros Linux comes with lots of command line tools. I have started to do many tasks using these shell scripts and found very productive. We switched from Google Chrome to Chromium for good. Ubuntu MATE - Cons We started with GNOME for desktop, but it was memory hungry and was not ...