Agilent Technologies Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

Continue:
For e.g an input could be:
Question[] -> 5 , 2 , 4 , 6 , 3, 1
Marks[]-> 8, 3, 2, 1, 6, 10
Time[]-> 2, 1, 3, 5, 4, 6

- Learner August 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Q_i is max number of questions of type i.
M_i is marks for question of type i.
T_i is the time require from question of type i.
Cutoff is C.

If we select q_i questions of type i, we need to

Minimize q_i*T_i
subject to

q_i <= Q_i

Sum q_i*M_i >= C

This is bounded knapsack, is NP-Hard (not again... boo hoo) and is solvable by dynamic programming in pseudo polynomial time.

- Anonymous August 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@above
Thanks for the reply.
It would be easier for me to modulize this problem into knapsack, if we have only two arrays(Q_i == 1 {for 0<=i<=n), but since Q_i >=1, we have 3 different arrays.
Should we consider Knapsack weight array = {q_i*M_i for all summation(Q_i) combinations}
And the knapsack value array = { q_i*T_i for all summation(Q_i) combinations}
But then the knapsack weight and value arrays, will contain duplicate values for all the q_i in Q_i.
Can u please, help me out in moduling the same.

- Learner August 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Don't understand what you are asking. Check the web though. Wiki page might have something.

- Anonymous August 20, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I wants to ask, how can i refine this problem into bounded knapsack problem, as a knapsack problem has only two array, Weight Array and Value Array. But in this case we have one more array.

- Learner August 20, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Bounded knapsack has a third array: The bounds.

- Anonymous August 20, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

You are right, i search the same on the internet and find out that the bounded knapsack problem has the third array.
But i m not able to find the simple description of the algorithm. Can u please, let me understand the bounded knapsack solution or provide a suitable link for it.

- Learner August 20, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

It has been discussed nicely here (with solution): cs.cornell.edu/~wdtseng/icpc/notes/dp3.pdf

- lol August 22, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It is simmilar to 0/1 knapsack problem..........

- Anonymous September 01, 2011 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More