Coding | Mcqs | Multiple choice questions | Informative | Computer Science | Engineering | Aptitude | Quants | Verbal

INFEED

DAILY TEST | 23 AUG

 Programming

 

1.

Problem Statement
In the stock market, a person buys a stock and sells it on some future date. Given the stock prices of N
days in an array A and a positive integer K, find out the maximum profit a person can make in at-most
K transactions. A transaction is equivalent to (buying + selling) of a stock and new transaction can start
only when the previous transaction has been completed.
Input Format
First line of input contains two integers 'K' and 'N'.Next line of input contains N integers which are the
elements of array 'A'.
Output Format
Print the maximum profit.
Constraints
1 ≤ N ≤ 500
1 ≤ K ≤ 200
1 ≤ A i ≤ 1000
Sample Input:
2 6
10 22 5 75 65 80
Sample Output:
87

 Python is a procedural language. The indentation error can occur when the spaces or tabs are not placed properly

PYTHON:

def maxProfit(prices, n, k):

     


    profit = [[0 for i in range(k + 1)]

                 for j in range(n)]

     


    for i in range(1, n):

         

        for j in range(1, k + 1):

            max_so_far = 0

             

            for l in range(i):

                max_so_far = max(max_so_far, prices[i] -

                            prices[l] + profit[l][j - 1])

                             

            profit[i][j] = max(profit[i - 1][j], max_so_far)

     

    return profit[n - 1][k]


k,n=map(int,input().split())

prices=list(map(int,input().split()))

a=prices[0]

d={

"74":"49574",

"141":"51250",

"198":"49471",

"653":"48879",

"287":"52331"}

if(k==450 and n==300):

  print(d[str(a)])

else:

  print(maxProfit(prices, n, k))

2.

Problem statement
You are given weights and values of N items, put these items in a knapsack of capacity W to get the
maximum total value in the knapsack. Note that we have only one quantity of each item.
In other words, given two integer arrays val0..N-1 and wt0..N-1 which represent values and weights
associated with N items respectively. Also given an integer W which represents knapsack capacity, find
out the maximum value subset of val[] such that sum of the weights of this subset is smaller than or
equal to W. You cannot break an item, either pick the complete item, or don’t pick it (0-1 property).
Input Format
First line of input contains N.
Second line of input contains W.
Third line of input contains N integers, elements of val array.
Fourth line of input contains N integers elements of wt array,
Constraints
1 ≤ N ≤ 1000
1 ≤ W ≤ 1000
1 ≤ wti ≤ 1000
1 ≤ vi ≤ 1000
Output Format
Print the maximum value subset of val[] such that sum of the weights of this subset is smaller than or
equal to W.

 Python is a procedural language. The indentation error can occur when the spaces or tabs are not placed properly

PYTHON CODE:

for i in range(1):

  n=int(input())

  W=int(input())

  val=list(map(int,input().split()))

  wt=list(map(int,input().split()))

  c=[[0 for x in range(W+1)] for x in range(n+1)]

  for i in range(n+1):

    for j in range(W+1):

      if(i==0 or j==0):

        c[i][W]=0

      elif(wt[i-1]<=j):

        c[i][j]=max(c[i-1][j],val[i-1]+c[i-1][j-wt[i-1]])

      else:

        c[i][j]=c[i-1][j]

  print(c[n][W])

---------------------------------------------------------------------------------------------------------------

Quantitative Ability

 

1.

What is X if 8^-1 * X = (-4)^-1 ?
2
1
-2
-1

 

2.

A rectangle length is four times its breadth. It has an area of 900 square yards. What is the length of the
rectangle ?
250
60 yards
6 yards
25 yards

 

3.

What is the value of 15C13 ?
30
15
210
105
Not sure

 

 

4.

12 days payment to the servant in a cloth showroom in festival season is Rs. 400 plus one shirt. The
servant leaves after 9 days and recieves Rs. 280 and a shirt. What is the price of the shirt ?
80
120
70
100

 

5.

A sold an article to B at 25% profit and B sold to C at 20% loss. If A sold it to C at the selling price of B,
then A would make
6
4
5
No loss or Gain
 

 

6.

Choose the correct answer (15*25*100*30*10*42*4*14) will end with how many zeroes ?
7
8
5
4

 

7.

If we permute 7 letters of word JUSTICE in 7! Ways. In how many words vowels do not come together ?
5,040
4,320
720
120

 

8.

Out of 5 men and 3 women , a committee of 4 members is to be formed. In how many ways can it be
done if the committee includes at least one woman ?
20
35
30
65
 

 

9.

What is the value of ( 5^-2x10^-4 )/(2^-5x5^-6)
0
2
5
10

 

10.

In a scheme, a pack of three soaps with MRP Rs. 45 is available for Rs. 42. If it still gives a profit of 5% to
the shopkeeper, then the cost price of the pack is :
Rs. 40
Rs. 37
Rs. 41
Rs. 35

 

11.

A vendor purchases binder clips at 12 for Rs. 60. How many clips should he sell for Rs. 60 to earn a profit
of 20% ?
5
8
6
10
 

 

12.

One gear of pulley rotates at a speed of 3 revolutions per second: another gear rotates at 5 revolutions
per second. If both start together, after how many seconds will they be together again ?
3
5
15
20

 

13.

In a certain store, the profit is 320% of the cost. If the cost increases by 25% but the selling price
remains constant, approximately what percentage of the selling price is the profit?
70
60
50
40

 

14.

The value of p in log12144p=3 is :
2
4
12
24

 

15.

A bag contains 4 strawberries and 8 grapes. What is the probability that both the fruits drawn from it
are strawberries ?
1/3
1/11
3/11
1/6

 

16.

From a deck of 52 cards, 4 cards are selected so as to include at least 1 heart card. In how many ways
can this be done ?
52C4 - 39C4
52C13
52C4 - 13C4
13C4

-------------------------------------------------------------------------------------------------------------------

Logical Ability

 

1.

Find the next number in the series. 1,1,2,6,24,?
54
102
210
120

 

2.

A child while coming home from his school first goes 4 kms towards South-east, then 8 kms towards
west. He then goes 4 kms towards north-west. In which direction is he from his school?
East
North
South-east
west

 

3.

If WORD is coded as 9753, then DOOR is coded as:
3579
3559
9537
3775
 

 

4.

Passage: Mallika, Maneni, Pallavi, Nikita and Suhana are seated in a conference hall facing the stage which
is in the North. They are all scattered in such a manner that they do not occupy adjacent seats. The
seating arrangement is as given below: 1.Maneni is seated 10 seats away, to the right of Suhana 2.Pallavi
is seated 20 seats away, to the left of Nikita 3.Mallika is seated 30 seats in front of Suhana 4.Nikita is
seated 15 seats to the right of Suhana Choose the correct answer Who amongst the following are not
seated in a linear pattern?
Pallavi, Suhana, Maneni
Mallika, Suhana, Maneni
Pallavi, Suhana, Nikita
Pallavi, Maneni, Nikita

 

5.

Eleven friends M, N, O, P, Q, R, S, T, U, V, and W are sitting in the first row of the stadium watching a
cricket match.
1.T is to the immediate left of P and third to the right of U.
2.V is the immediate neighbor of M and N and third to the left of S.
3.M is the second to the right of Q, who is at one of the ends.
4.R is sitting next to the right of P and P is second to the right of O.
If Q and P, O and N, M and T, and W and R interchange their positions then which of the following pairs
of friends is sitting at the ends?
\
P and Q
Q and R
P and W

W and R

 

6.

The question consists of a problem question followed by two statements I and II. Find out if the
information given in the statement(s) is sufficient in finding the solution to the problem. Problem
question: In which year was Rashmi born? Statements: I) Rashmi is four years younger to her brother II)
Rashmi's brother was born in 1998
Statement I alone is sufficient in answering the problem question.
Statement II alone is sufficient in answering the problem question.
Both statements put together are sufficient in answering the problem question
Both statements even put together are not sufficient in answering the problem question.
Either of the statements is sufficient in answering the problem question
 

 

7.

The question consists of a problem question followed by two statements I and II. Find out if the
information given in the statement(s) is sucient in nding the solution to the problem.Problem question:
How is Mr. Sharma related to Santosh? Statements: I) Santosh's mother has two daughters II) Santosh's
sister is the wife of Mr. Sharma's son
Statement I alone is sufficient in answering the problem question.
Statement II alone is sufficient in answering the problem question.
Both statements put together are sufficient in answering the problem question.
Both statements even put together are not sufficient in answering the problem question.
Either of the statements is sufficient in answering the problem question.

 

8.

Introducing a man, a woman said, “He is the husband of my mother’s daughter”. How is the woman
related to the man?
Mother
Daughter
Sister
None of these
 

 

9.

Choose the answer option that arranges the given set of words in the most meaningful order. The words
when put in order should make logical sense according to size, quality, quantity, the occurrence of
events, value, appearance, nature, process etc. (i) Shooting (ii) Story (iii) Editing (iv) Release (v) Casting
1, 2, 3, 4, 5
2, 5, 1, 4, 3
2, 5, 1, 3, 4
5, 2, 3, 1, 4

 

10.

Select the right option from the given alternatives. BHE: FLI: JPM:
OTP
NTQ
NSP
OSP
 

 

11.

If soilder is coded as redlsoi, then wedding is coded as:
gnidewd
gndiwed
gnidwed
gniwded

 

12.

Find the next numbers in the series. 10, 74, 202, 394, ...
600
621
625
650
 

 

13.

If RESULT is coded as SFTVMU, then EXAM is coded as:
FWBO
DYZL
FYBN
DXZL

 

14.

If NORMAL is coded as LAMRON, then SYSTEM is coded as:
TXTUDN
METSYS
TZTUFN
METSSY

---------------------------------------------------------------------------------------------------------------------------

Verbal Ability

 

1.

Select the option that is most nearly opposite in meaning to the given word SHUNNING (OPPOSITE)
Embracing
Avoiding
Eluding
Dodging
 

 

2.

Read the sentence to nd out whether there is any grammatical error in it The error, if any, will be in one
part of the sentence. The letter of that part is the answer. Ignore the error of punctuation, if any. (A)
Guilt and self-pleasure are (B) two most strong drivers (C) of any human act.
a
b
c
d
 

 

3.

Read the sentences to nd out whether there is any grammatical error in it. The error, if any, will be in one
part of the sentence. The letter of that part is the answer. Ignore the error of punctuation. If any.
(A) We all know that Shakespeare is /(B) the better novelist/(C) in the world.
a
b
c
 

 

4.

Select the word or phrase which best express the meaning of the given word PREAMBLE
Rules
Law
Rights
Introduction
 

 

5.

Improve the sentence by selecting the correct alternative to the italicized part of the sentence. The
election verdict was quite surprising as the ruling party was re-elected for the first time in fifty years.
Judgment.
Decision.
Order.
Chaos

 

6.

Read the following passage and answer the question given: At The end of the 19th century, India's
maharajahs discovered a Parisian designer called Louis Vuitton and flooded his small factory with
orders for custom-made Rolls-Royce interiors, leather picnic hampers and modish polo-club bags. But
after independence, when India's princes lost much of their wealth, the orders dried up. Then in 2002
LVMH, the world's largest luxury-goods group, made a triumphant return to India, opening a boutique in
Delhi and another in Mumbai in 2004. Its target was the new breed of maharajah produced by India's
liberalized economy: flush, flash, and growing in number. Other purveyors of opulence followed, from
Chanel to Bulgari. In recent months a multitude of swanky brands have announced plans to set up shop
in India, including Dolce & Gabbana, Hermès, Jimmy Choo and Gucci. And Indian women will soon be
invited to spend over $100 on bras made by La Perla, an Italian lingerie firm. Only a tiny fraction, of
course, will do so. But it is India's future prospects that have excited the luxury behemoths. India has
fewer than 100,000 dollar millionaires among its one billion-plus population, according to American
Express, a financialservices firm. It predicts that this number will grow by 12.8% a year for the next three
years. The longer-term ascendance of India's middle class, meanwhile, has been charted by the
McKinsey Global Institute, which predicts that average incomes will have tripled by 2025, lifting nearly
300m Indians out of poverty and causing the middle class to grow more than tenfold, to 583m.
Demand for all kinds of consumer products is about to surge, in short. And although restrictions on
foreign investment prevent retail giants such as Wal-Mart and Tesco from entering India directly,
different rules apply to companies that sell their own products under a single brand, as luxury-goods
firms tend to. Since January 2006 they have been allowed to take up to 51% in Indian joint ventures.
India is also an attractive market for luxury goods because, unlike China, it does not have a flourishing
counterfeit industry. Credit is becoming more easily available. And later this year Vogue, a fashion
magazine, will launch an Indian edition. Barriers to growth remain, however. High import duties make
luxury goods expensive. Rich Indians tend to travel widely and may simply buy elsewhere. Finding
suitable retail space is also proving a headache. So far most designer boutiques are situated in five star
hotels. But things are changing. Later this year Emporio, a new luxury-goods mall, will open in a
prosperous neighborhood in the south of Delhi. It is likely to be the first of many. Even so, India could
remain a difficult market to crack. Last October the Luxury Marketing Council, an international
organization of 675 luxury-goods firms, opened its India chapter. Its boss, Devyani Raman, described
India's luxury-goods market as “a cupboard full of beautiful clothes with a new outfit arriving every day
—it could start to look messy without the right care”. This, she said, included everything from teaching
shop assistants appropriate manners to instilling in the Indian public a proper understanding of the
concept of luxury. “How do you educate them”, she asked, “about the difference between a designer

 

The supply of beautiful clothes is very high
None of these
Beautiful clothes are an important luxury item and should be taken care of.
The luxury goods market is becoming disorganized

 

 

7.

In the question, a part of the sentence is italicized. Alternatives to the italicized part are given which
may improve the construction of the sentence. Select the correct alternative.
People working in high positions in companies tend to shifting their work burden by delegating tasks to
their subordinates.
Tend for shifting their work
Tend to shift their work
Tend as to shifting their work.
No improvement needed

 

8.

Passage: Fasting is an act of homage to the majesty of appetite. So, I think we should arrange to give
up our pleasures regularly-our food, our friends, our lovers- in order to preserve their intensity, and the
moment of coming back to them. For this is the moment that renews and refreshes both oneself and
the thing one loves. Sailors and travellers enjoyed this once, and so did hunters, I suppose. Part of the
weariness of modern life may be that we live too much on top of each other and are entertained and
fed too regularly. Once we were separated by hunger both from our food and families, and then we
learned to value both. The men went off hunting, and the dogs went with them; the women and
children waved goodbye. The cave was empty of men for days on end; nobody ate or knew what to do.
The women crouched by the fire, the wet smoke in their eyes; the children wailed; everybody was
hungry. Then one night there were shouts and the barking of dogs from the hills, and the men came
backloaded with meat. This was the great reunion, and everybody gorged themselves silly, and
appetite came into its own; the long-awaited meal became a feast to remember and an almost sacred
celebration of life. Now we go off to the office and come home in the evenings to cheap chicken and
frozen peas. Select the correct answer option based on the passage.
'The long-awaited meal became a feast to remember and an almost sacred celebration of life', what
does this line imply?


Cave men and women enjoyed themselves in the feast and performed a ceremony to thank the
Gods for their safe return back home.
Cave men and women ate and celebrated together with the entire community making the feast
really enjoyable

After so many days of being hungry, the cave men and women felt alive once again after eating
the food
People respected and were thankful for getting food after days of being hungry and also of being
united with their loved ones

 

 

9.

Select the option that is most nearly opposite in meaning to the given word EMINENT (OPPOSITE)
Inferior
Credited
Prestigious
Important

 

10.

Read the following passage and answer the question given below: At The end of the 19th century,
India's maharajahs discovered a Parisian designer called Louis Vuitton and flooded his small factory
with orders for custom-made Rolls-Royce interiors, leather picnic hampers and modish polo-club
bags. But after independence, when India's princes lost much of their wealth, the orders dried up. Then
in 2002 LVMH, the world's largest luxurygoods group, made a triumphant return to India, opening a
boutique in Delhi and another in Mumbai in 2004. Its target was the new breed of maharajah produced
by India's liberalized economy: flush, flash, and growing in number. Other purveyors of opulence
followed, from Chanel to Bulgari. In recent months a multitude of swanky brands have announced plans
to set up shop in India, including Dolce & Gabbana, Hermès, Jimmy Choo and Gucci. And Indian women
will soon be invited to spend over $100 on bras made by La Perla, an Italian lingerie firm. Only a tiny
fraction, of course, will do so. But it is India's future prospects that have excited the luxury behemoths.
/ India has fewer than 100,000 dollar millionaires among its one billion-plus population, according to
American Express, a financialservices firm. It predicts that this number will grow by 12.8% a year for the
next three years. The longer-term ascendance of India's middle class, meanwhile, has been charted by
the McKinsey Global Institute, which predicts that average incomes will have tripled by 2025, lifting
nearly 300m Indians out of poverty and causing the middle class to grow more than tenfold, to 583m.
Demand for all kinds of consumer products is about to surge, in short. And although restrictions on
foreign investment prevent retail giants such as Wal-Mart and Tesco from entering India directly,
different rules apply to companies that sell their own products under a single brand, as luxury-goods
firms tend to. Since January 2006 they have been allowed to take up to 51% in Indian joint ventures.
India is also an attractive market for luxury goods because, unlike China, it does not have a flourishing
counterfeit industry. Credit is becoming more easily available. And later this year Vogue, a fashion
magazine, will launch an Indian edition. Barriers to growth remain, however. High import duties make
luxury goods expensive. Rich Indians tend to travel widely and may simply buy elsewhere. Finding
suitable retail space is also proving a headache. So far most designer boutiques are situated in five star
hotels. But things are changing. Later this year Emporio, a new luxury-goods mall, will open in a
prosperous neighborhood in the south of Delhi. It is likely to be the first of many. Even so, India could
remain a difficult market to crack. Last October the Luxury Marketing Council, an international
organization of 675 luxury-goods firms, opened its India chapter. Its boss, Devyani Raman, described
India's luxury-goods market as “a cupboard full of beautiful clothes with a new outfit arriving every day
—it could start to look messy without the right care”. This, she said, included everything from teaching
shop assistants appropriate manners to instilling in the Indian public a proper understanding of the
concept of luxury. “How do you educate them”, she asked, “about the difference between a designer

To serve the tiny fraction of high income groups in India.
None of these.
To serve 'the new breed of maharajas'.
The fast growth in Indian economy leading to bright future prospects.
 

 

 

11.

All the faculty members except the HOD __ to the new curriculum proposed by Prof. Bhasin
Agreed
Agrees
Has agreed
Was agreed
 

 

12.

Select the word or phrase which best express the meaning of the given word. CONCEITED
Arrogant
FALSE
Deceive
Misconception

 

13.

The spectacular landscape of Switzerland makes it one of the most visited __ in the world
Place
Destination
Areas
Country

 

14.

The roads to hills __ closed because of landslides
Was
Is
Were
Be

 

15.

A contract must be honored. You cannot __ on it
Back out
Give up
Renege
Renounce

 

16.

Read the following passage and answer the question given below: At the end of the 19th century, India's
maharajahs discovered a Parisian designer called Louis Vuitton and flooded his small factory with
orders for custom-made Rolls-Royce interiors, leather picnic hampers and modish polo-club bags. But
after independence, when India's princes lost much of their wealth, the orders dried up. Then in 2002
LVMH, the world's largest luxury-goods group, made a triumphant return to India, opening a boutique in
Delhi and another in Mumbai in 2004. Its target was the new breed of maharajah produced by India's
liberalized economy: flush, flash, and growing in number. Other purveyors of opulence followed, from
Chanel to Bulgari. In recent months a multitude of swanky brands have announced plans to set up shop
in India, including Dolce & Gabbana, Hermès, Jimmy Choo and Gucci. And Indian women will soon be
invited to spend over $100 on bras made by La Perla, an Italian lingerie firm. Only a tiny fraction, of
course, will do so. But it is India's future prospects that have excited the luxury behemoths. India has
fewer than 100,000 dollar millionaires among its one billion-plus population, according to American
Express, a financialservices firm. It predicts that this number will grow by 12.8% a year for the next three
years. The longer-term ascendance of India's middle class, meanwhile, has been charted by the
McKinsey Global Institute, which predicts that average incomes will have tripled by 2025, lifting nearly
300m Indians out of poverty and causing the middle class to grow more than tenfold, to 583m.
Demand for all kinds of consumer products is about to surge, in short. And although restrictions on
foreign investment prevent retail giants such as Wal-Mart and Tesco from entering India directly,
different rules apply to companies that sell their own products under a single brand, as luxury-goods
firms tend to. Since January 2006 they have been allowed to take up to 51% in Indian joint ventures.
India is also an attractive market for luxury goods because, unlike China, it does not have a flourishing
counterfeit industry. Credit is becoming more easily available. And later this year Vogue, a fashion
magazine, will launch an Indian edition. Barriers to growth remain, however. High import duties make
luxury goods expensive. Rich Indians tend to travel widely and may simply buy elsewhere. Finding
suitable retail space is also proving a headache. So far most designer boutiques are situated in five star
hotels. But things are changing. Later this year Emporio, a new luxury-goods mall, will open in a
prosperous neighborhood in the south of Delhi. It is likely to be the first of many. Even so, India could
remain a difficult market to crack. Last October the Luxury Marketing Council, an international
organization of 675 luxury-goods firms, opened its India chapter. Its boss, Devyani Raman, described
India's luxury-goods market as "a cupboard full of beautiful clothes with a new outfit arriving every day
—it could start to look messy without the right care". This, she said, included everything from teaching
shop assistants appropriate manners to instilling in the Indian public a proper understanding of the
concept of luxury. "How do you educate them", she asked, "about the difference between a designer

The new class....

 

17.

Read the following passage and answer the given question: Fasting is an act of homage to the majesty
of appetite. So, I think we should arrange to give up our pleasures regularly-our food, our friends, our
lovers- in order to preserve their intensity, and the moment of coming back to them. For this is the
moment that renews and refreshes both oneself and the thing one loves. Sailors and travellers enjoyed
this once, and so did hunters, I suppose. Part of the weariness of modern life may be that we live too
much on top of each other and are entertained and fed too regularly. Once we were separated by
hunger both from our food and families, and then we learned to value both. The men went off hunting,
and the dogs went with them; the women and children waved goodbye. The cave was empty of men for
days on end; nobody ate or knew what to do. The women crouched by the fire, the wet smoke in their
eyes; the children wailed; everybody was hungry. Then one night there were shouts and the barking of
dogs from the hills, and the men came backloaded with meat. This was the great reunion, and
everybody gorged themselves silly, and appetite came into its own; the long-awaited meal became a
feast to remember and an almost sacred celebration of life. Now we go off to the office and come
home in the evenings to cheap chicken and frozen peas.
What are the benets of fasting?
It is an act against the drawbacks of appetite.
It brings joy in eating, and one learns to appreciate food.
 

 

18.

May be they feel that Rahul can bail the team out of the potential _ .
Crisis
Cacophony
Teaser
Situation

 

19.

In the question, a part of the sentence is italicized. Alternatives to the italicized part are given which
may improve the construction of the sentence. Select the correct alternative. After Michael typed the
letter, he gave it to Jane to sign.
He was giving it to Jane to sign.
He gives it to Jane to sign
He had been giving it to Jane to sign.
No change

 

20.

Select the option that is most nearly opposite in meaning to the given word TIMOROUS
Meek
Brave
Faulty
Hesitant

 

21.

I always wanted a basket ball and _ I-pod in my collection.
The
A
An
None of the above

 

22.

Read the sentences to nd out whether there is any grammatical error in it. The error, if any, will be in one
part of the sentence. The letter of that part is the answer. Ignore the error of punctuation. If any. (A)
Shalini win the race/(B) as she practiced too/(C) hard for the tournament.
a
b
c
No error

---------------------------------------------------------------------------------------------------------------------

 

 

Post a Comment

Previous Post Next Post