PROGRAMMING
1.
Problem statement
Given an array of integers, find the length of the longest (strictly) increasing subsequence from the
given array.
Input Format
First line contains 'n'- the size of array. Next line contains n integers- the elements of the array.
Constraints
1 ≤ n ≤ 10^5 0 ≤ elements of array ≤ 10^6
Output Format
Print the length of the longest (strictly) increasing subsequence from the given array.
Python is a procedural language. The indentation error can occur when the spaces or tabs are not placed properly
PYTHON CODE:
def lis(arr,n):
lis = [1]*n
for i in range(1, n):
for j in range(0, i):
if arr[i] > arr[j] and lis[i] < lis[j] + 1:
lis[i] = lis[j]+1
maximum = 0
for i in range(n):
maximum = max(maximum, lis[i])
return maximum
n=int(input())
arr = list(map(int,input().split()))
print(lis(arr,n))
2.
Problem Statement
Ms Khan has recently learned about ASCII values.He is very fond of experimenting. With his knowledge
of ASCII values and character he has developed a special word and named it Ms Khan’s Favourite word.
A word which consist of alphabets whose ASCII values is a prime number is an Ms Khan’s Favourite
word. An alphabet is Ms Khan 's Favourite alphabet if its ASCII value is prime.
Ms Khan’s nature is to boast about the things he know or have learnt about. So just to defame his
friends he gives few string to his friends and ask them to convert it to Ms Khan i’s Favourite word. None
of his friends would like to get insulted. Help them to convert the given strings to Ms Khan’s Favourite
Word.
Rules for converting:
1.Each character should be replaced by the nearest Ms Khan’s Favourite alphabet.
2.If the character is equidistant with 2 Favourite alphabets. The one with lower ASCII value will be
considered as its replacement.
Input Format
First line of input contains an integer T number of test cases. Each test case contains an integer N
(denoting the length of the string) and a string S.
Output Format
For each test case, print Ms Khan’s Favourite Word in a new line.
JAVA CODE:
import java.util.*;
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
int word[] = { 67,71,73,79,83,89,97,101,103,107,109,113};
@SuppressWarnings("resource")
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int j = 0; j<t;j++){
int sol = 67;
sc.nextInt();
char[] arr = sc.next().toCharArray();
for(char ch:arr){
int diff = 400;
for(int i = 0; i<word.length;i++){
int tDiff = Math.abs(ch-word[i]);
if(tDiff<diff){
sol = word[i];
diff = tDiff;
}
}
System.out.print((char)sol);
}
System.out.println();
}
}
}
--------------------------------------------------------------------------------------------------------------
Quantitative Ability
1.
A cow and a horse are bought for Rs. 2,50,000. The cow is sold at a prot of 15% and the horse is sold at
a loss of 15%. The overall gain is Rs. 22,500. The cost price of the cow is
50,000
2,00,000
1,20,000
1,30,000
2.
The total combinations of picking 3 balloons from a packet of 25 balloons are:
2100
2200
2300
2400
3.
The number of ways in the letters of the word “RESULT” can be arranged without repetition is
120
720
60
840
4.
Product of two numbers is 9,152 and their HCF is 8.what is the LCM of the numbers?
9,152
1,144
73,216
2,344
5.
The value of log39 – log5625 + log7343 is
1
-1
2
3
6.
Reena has 246 plants to plant. What maximum number of rows can she plant so that each row contains
equal number of plants and there is no extra plant left?
2
3
6
8
7.
Length and breadth of a rectangle are directly proportional. If length increases from 6 cm to 21 cm and if
breadth now is 14 cm, then what was the breadth before any change in length occurred?
4 cm
1.5 cm
3 cm
2 cm
8.
In a non-leap year, what is the probability that the last day of the year starts with a ‘T’?
4/7
1
0
2/7
9.
Express the fraction 26/17 as a number up to 3 decimal points.
1.429
1.535
1.321
1.529
10.
For the post of 2 receptionists, there are 12 equally qualied candidates. In how many ways can they be
selected ?
136
66
12
24
11.
Four bells begin to toll together and then each one at intervals of 6,7,8,and 9 seconds respectively. The
number of times they will toll together in the next 2 hours is:
14
15
13
11
12.
What is the probability of getting an even sum of score in a throw of 2 dice ?
1/3
17/36
1/4
1/2
13.
The product of two numbers is 2028 and their H.C.F. is 13. the number of such pairs is:
1
2
3
4
14.
n(n2 -1) is always divisible b
6
5
7
8
15.
Three employees and four intems can complete a task in 8 days . While four employees and three in
terms can do the same work in 8 1/3 days . In how many days can two employees and one intem do the
work?
17 1/3 days
3 2/3 days
3 1/6 days
20 days
16.
If X =(1+2)1/2 and y=(1-2)1/2 ,then X2 + Y2 is:
2
3
6
0
----------------------------------------------------------------------------------------------------------
Logical Ability
1.
Find the next number in series. 8, 8, 6, 2, ...
-4
-3
3
4
2.
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, occurrence of
events , values, appearance, nature, process etc.
QUESTION:
1. Earn
2. Shopping
3. Boy
4. Money
5. Job
3,1,5,4,2
3,4,5,1,2
3,5,1,4,2
2,3,5,1,4
3.
Answer the question based on the given information. Passage: X, Y, Z, P and R are sitting in a row in front
of a camera. X is on the left of the person sitting in the centre, but is on the right of Y. Z is on the right of
P and R is on the right of z. R is the second person from the person sitting in the centre. Who is between
X and Z?
Y
R
Data in adequate
None of the above
4.
Find the next number in the series 2,4,12,48, …….
480
240
960
340
5.
Answer the question based on the given information. Passage: X, Y, Z, P and R are sitting in a row in front
of a camera. X is on the left of the person sitting in the centre, but is on theright of Y. Z is on the right of
P and R is on the right of Z. R is the second person from the person sitting in the centre. Which pairs is X
sitting between ?
P and Z
P and R
Y and P
Y and Z
6.
Choose the right answer Choose the odd man out.
TRAINGLE
SQUARE
PENTAGON
CIRCLE
7.
Sagar walks 30 meters west and takes a left turn to walk 10 meters, then takes left turn again and walks
40 meters, and takes another left turn and walks 20 meters. In which direction is he standing now from
the starting point?
North-East
South-East
North-West
North
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.
The question consists of a problem question followed by two statements 1 and 2. Find out if the
information given in the statements is sufcient in finding the solution to the problem. Problem question:
Vikas ranks 9th in the class. How many students are there in the class?
Statements:
1).His friend got the 35th rank which is the last rank.
2).His rank from the last is 27th.
Statement (1) alone is sufficient
Statement (2) alone is sufficient
Both statements put together are sufficient
Both the statements even put together are not sufficient
Either of the ....
10.
I was facing west. I turned 1250 in the clockwise direction and 100 in the anticlockwise direction. Which
direction am I facing now?
North-West
East
North
North-East
11.
Decode the words/pattern given in the question If STUMP is coded as PQRJM, then PITCH is coded as:
MFQZE
QJUDI
MEQAE
RKVEK
12.
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
13.
Find the next numbers in the series. 10, 74, 202, 394, ...
600
621
625
650
14.
From the given anagrams select the odd one out
STUOL
ESOR
PULIT
LUFTE
------------------------------------------------------------------------------------------------------------------
Verbal Ability
1.
Select the word or phrase which is opposite to the given word GRISLY
pleasant
doubtful
bearish
untidy
suggestive
2.
They were going home when it was starting to rain
When it started to rain
When it was raining
When it is starting to rain
No change
3.
Select the word or phrase which best expresses the meaning of the word typed in bold. Only those who
are gullible take every advertisement seriously. Select one:
gullible
unsuspecting
enthusiastic
fallible
unrealistic
4.
Select the word or phrase which best expresses the meaning of the given word VOGUE
Deviation
Nonconforming
Unfashionable
prevalent
5.
In the questions given below, 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.
For as long as she could remember, Divya has loved to cook to dance and until her poor vision made it
impossible for her to do so, reading books.
To cook, to dance and until her poor vision made it impossible for her to do so
Cooking, to dance and until her poor vision made it impossible for her to do so
Cooking, dancing and until her poor vision made it impossible for her to do so
To cook, to dance and until she lost her vision
6.
In the question each passage consists of six sentences. The rst and the sixth sentences are given in
the beginning. The middle four sentences have been removed and jumbled up. These are labelled P,Q,R
and S. select the proper order for the four sentences
S1: Venice is a strange and beautiful city in the north of Italy
S6: This is because Venice has no streets
P: There are about four hundred old stone bridges joining the island of Venice
Q: In this city there are no motor cars, no horses and no buses
R: These small islands are near one another
S: It is not an island but a hundred and seventeen islands
PQRS
PRQS
SRPQ
PQSR
7.
Nothing ____ convinced her to cancel her trip to Goa
Was going to
Could have
Could
Will have
8.
Select the correct option that fills the blank to make the sentence meaningfully complete The leaves
___yellow and dry
Were
Had
Being
was
9.
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
Get out of the building it sound like the generator is going to explode.
It is sounding like the generator is going to explode
It sounds like the generator is going to explode
It sounds like generator exploded
It sounds like generator exploded
10.
Select the word or phrase which best expresses the meaning of the word typed in bold. He has a
propensity for getting into debt.Select one:
propensity
natural tendency
aptitude
quality
characteristic
11.
Select the option that is most nearly opposite to the given word ENFORCE ( OPPOSITE)
Administer
Accomplish
Abandon
exert
12.
Select the word or phrase which best expresses the meaning of the given word. PROFUSE
Defuse
Ample
Flimsy
Accept
13.
Select the word or phrase which best expresses the meaning of the given word. CITESelect one
galvanize
quote
locate
visualize
signal
14.
There are 2 questions based on the same data. Answer the question based on the given information: A
marketing company requires a qualied engineer with a management degree. The candidate must: 1).Be
a graduate with at least 55% marks 2).Hold in an MBA degree with a minimum of 50% marks. 3).Have
secured at least 55% marks in Sr. secondary examination . This condition will be relaxed up to 5% if the
candidate has two years experience of working with a reputed company. 4).Should have at least one
year’s experience as an engineer. 5).If he/she fullls all other conditions except (4) but has an additional
diploma in computers or I.T. his/her case is to be referred to the general manager. 6).If he/she fullls all
other conditions but has marketing degree instead of the condition given at (3) his/her case is to be
referred to the managing Director 7).Not be of age greater than 30 years. Can the given candidate be
selected? Hari Rai is a 27 years old B.Tech . Graduate from I.P University. He has also done MBA from IIM
Indore. He secured 65% marks in his nsr. Secondary examination . He has been working with a reputed
engineering company, Chennai for the last 3 years
The candidate is to be selected
The candidate is not to be selected
Insufficient data
15.
Select the option that is most nearly OPPOSITE in meaning to the given word IGNOBLESelect one:
produced by fire
worthy
given to Qtioning
known
veracious
16.
Select the option that is most nearly opposite to the given word LITERAL
Factual
Usual
Ordinary
Unblessed
figurative
17.
Select the word or phrase which best expresses the meaning of the given word. TIMID
Fast
Slow
Medium
Shy
18.
Select the word or phrase which best expresses the meaning of the given word CELLAR
Loft
Attic
Basement
roof
19.
Select the word or phrase which best expresses the meaning of the word typed in bold. The
environment left a deleterious effect on his health.Select one:
deleterious
Weakening
Health
Aesthetic
Fatiguing
Harmful
20.
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
21.
Select the option that is most nearly opposite to the given word PREMEDITATED ( OPPOSITE)
Ingenuous
Artless
Spontaneous
natural
22.
Select the word or phrase which best expresses the meaning of the word typed in bold. A person
unrestrained by the rules of morality or tradition is called a licentious person. Select one:
licentious
libertine
freelance
criminal
loafer-type
---------------------------------------------------------------------------------------------------------------------
Post a Comment