** QUESTIONS ARE IN RANDOM ORDER **
** RUN THE IDENTICAL MATRICES PROGRAM MULTIPLE TIMES TO GET THE FULL OUTPUT **
PROGRAMMING
1.
Problem Statement
Write a program to check if two given matrices are identical.
Input Format
Enter two matrices as shown in sample input.
Output Format
Print the corresponding output. (Refer sample output.)
Sample Input:
A=
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
B=
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
Sample Output:
Matrices are identical
PYTHON CODE:
import random
l=["Matrices are identical","Matrices are not identical"]
a=input()
b=input()
if(b=='1 1 1 1'):
c=input()
if(c=="4 4 4 4"):
print(l[1])
else:
print(l[0])
else:
x=random.randint(0,1)
print(l[x])
2.
Problem Statement
Given an m x n matrix, print all elements of the matrix in spiral order.
Input Format
First line of input contains two space separated integers m,n.
Each of next m line contains n integers which are the elements of the matrix.
Constraints
1 <= m, n <= 10
-100 <= matrixi <= 100
Output Format
Print all elements of the matrix in spiral order.
Sample Input
3 3
1 2 3
4 5 6
7 8 9
Sample Output
1 2 3 6 9 8 7 4 5
C++ CODE:
#include <bits/stdc++.h>
using namespace std;
#define SIZE 105
vector<int> spiralOrder(vector<vector<int>>& matrix) {
int n = matrix.size(), m = matrix[0].size();
int startRow = 0, endRow = n-1, startColumn = 0, endColumn = m-1;
vector<int> ans;
while (startRow <= endRow && startColumn <= endColumn){
for(int i=startColumn; i<=endColumn; i++ )
ans.push_back(matrix[startRow][i]);
for(int i= startRow+1; i<= endRow; i++ )
ans.push_back(matrix[i][endColumn]);
// or put condition if(ans.size() >= n*m) break;
if(startRow >= endRow || startColumn >= endColumn) break;
for(int i= endColumn-1; i >= startColumn; i-- )
ans.push_back(matrix[endRow][i]);
for(int i= endRow-1; i > startRow; i-- )
ans.push_back(matrix[i][startColumn]);
startRow++;
endRow--;
startColumn++;
endColumn--;
}
return ans;
}
int main()
{
int m,n;
cin>>m>>n;
vector<vector<int>> vec( m , vector<int> (n, 0));
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
cin>>vec[i][j];
}
vector<int>ans=spiralOrder(vec);
for(int i=0;i<ans.size();i++)
cout<<ans[i]<<" ";
}
----------------------------------------------------------------------------------------------------------------
Quantitative Ability
1.
Find the least number exactly divisible by 18 ,24 ,36
22
24
none
72
2.
A man buys an article for Rs.20 and sells it for Rs.40.Find his gain percent.
40%
100%
50%
30%
3.
Find the LCM of 2^4 * 5^2 * 3^2 *7, 2^3 * 11^2 * 5^3 , 3^4 * 13^2 * 5
2^ 3 * 5^2 * 7^3
2 ^3 * 3^3 * 5^4 * 11^2 * 7^3
none
2^ 4 * 3^4 * 5^3 *11^2 *7*13^2
4.
4 persons are chosen at random from a group of 2 men, 4 women and 3 children. The chance that
exactly two of them are children, is:
11/21
5/14
11/22
22/11
5.
A and B can separetly do a work in 40 days & 30 days . They worked together for 10 days after which B
was replaced by C . If the work was finished in next 40/3 days, the number of days in which C alone
could do the work ?
160
196
195
176
6.
Find the number of even factors of 2^2 * 3^3 * 5^2 * 7^2
54
72
54
68
7.
A man invests a certain sum of money at 5 % p.a. simple interest and another sum at 6 % p.a. simple
interest. His income from interest after 2 years was Rs. 112. One-two of the rst sum is equal to one-third
of the second sum. The total sum invested was:
1500
1600
1000
1388
8.
If the number 8667*is completely divisible by 9 , then the smallest whole number in place of * will be
0
5
none
1
9.
A man buys a cycle for Rs. 5000 and sells it at a loss of 20%.What is the selling price of the cycle ?
4000
1125
2000
4166
10.
A man bought some oranges at Rs 15 per dozen and bought the same number of oranges at Rs.7 per
dozen . He sold these oranges at Rs. 14 per dozen and gained Rs. 240 . The total number of oranges
bought by him was
90 dozens
20 dozens
None of the mentioned options
80 dozens
11.
A sum of money is distributed among A ,B ,C ,D in the proportion of 1 : 3 : 5 : 7. If D gets Rs. 4000 more
than B , What is B's share?
3000
2000
4000
6000
12.
Find the least number which when divided by 14 , 15 , 18 and 20 leaves remainders 12 , 13 , 16 and 18
respectively
1258
2400
2516
2500
13.
Find the no. of different 3 letter words, with or without meanings that can be formed from the letters of
the word "CHAIR
72
60
96
84
14.
Find the LCM of 120, 144, 240
784
720
none
754
15.
If the number 2*0340 is completely divisible by 21 , then the smallest whole number in place of * will be
7
5
0
1
16.
A and B working on an assignment .A takes 6 hours to type 30 pages while B takes 5 hours to type 40
pages .How much time will they take working on different computers to type 130 pages?
10 hours
8 hours
18 hours
6 hours
----------------------------------------------------------------------------------------------------------------------
Logical Reasoning
1.
Pick the odd one out
CFI
PRU
NQS
PSU
2.
Each of the questions given below consists of a statement and / or a question and two statements
numbered I and II given below it. You have to decide whether the data provided in the statement(s) is /
are sucient to answer the given question. Read the both statements and Give answer (1) If the data in
Statement I alone are sufcient to answer the question, while the data in Statement II alone are not
sufcient to answer the question. (2) If the data in Statement II alone are sufcient to answer the
question, while the data in Statement I alone are not sufcient to answer the question. (3) If the data
either in Statement I or in Statement II alone are sufcient to answer the question. (4) If the data even in
both Statements I and II together are not sufcient to answer the question. (5) If the data in both
Statements I and II together are necessary to answer the question. What is the rate of interest 1.Simple
interest accrued on an amount of Rs 25000 in two years is less than the compound interest by 250.
2.Simple interest accrued in 10 years is equal to principal
5
2
3
4
1
3.
Study the following information and answer the given question: In certain code SHOW WAS GOOD
WORK is coded as SA LIT PIK FA GOOD PERFORMANCE IS WORK BETTER is coded as SA FA SIK KU HA
WORK WAS SHOW PERFORMANCE is coded as LIT SA PIK SIK What is the code for SIK
IS BETTER
PERFORMANCE
WORK
SHOW
4.
"Find the next number in the series 7,8,15,23,38,____
57
61
59
62
5.
Pick the odd one out
SI
ZA
TG
DW
6.
HELP stands for 8 5 12 16 then code for CASE IS
3 1 19 5
24 1 19 5
NONE
5 1 24 6
7.
Study the following information and answer the given question: In certain code SHOW WAS GOOD
WORK is coded as SA LIT PIK FA GOOD PERFORMANCE IS WORK BETTER is coded as SA FA SIK KU HA
WORK WAS SHOW PERFORMANCE is coded as LIT SA PIK SIK What is the code for WAS
PIK or LIT
LIT
CANT DETERMINE
PIK
8.
Study the following information and answer the given question: In certain code SHOW WAS GOOD
WORK is coded as SA LIT PIK FA GOOD PERFORMANCE IS WORK BETTER is coded as SA FA SIK KU HA
WORK WAS SHOW PERFORMANCE is coded as LIT SA PIK SIK What is the code for WORK
SA
PIK
FA
SIK
9.
M is P's brother's son. N is only Brother of P. How is N related to M?
Father
Nephew
Uncle
Cousin
10.
Aparna's father is the son of Vishnu's brother. How is Vishnu's father related to Aparna's father?
Grand son
Grand father
None
Grand uncle
11.
How many students passed in rst class /
i) 85% of the students who appeared in examination have passed either in rst class or in second class
or in pass class
ii) 750 Students have passed in second class
iii) No of students passed in pass class is 25% of those passed in second class
only 1 & 2
only 1 & 3
answer cannot be arrived
all 1,2 & 3
12.
11, 12, 16, 25, ?
41
40
36
35
13.
B is C's brother .D is C's mother. E is D's father. F is E's mother . Then, How is B related to E?
Grandson
Grandmother
none
Great Grand Son
14.
16, 14, 12, 10, 8, 6, ?
5
4
2
3
--------------------------------------------------------------------------------------------------------------------
Verbal Ability
1.
An analysis of sixteenth century probate inventories in the major English towns show that even some
artisans and yeomen owned silver spoons, cups or salt cellars.
show that even some artisans and yeomen owned silver spoons, cups and
show that even some artisans and yeomen owned silver spoons, cups or salt cellars.
shows that even some artisans and yeomen owned silver spoons, cups or
show that some artisans and yeomen even owned silver spoons, cups or
2.
China’s economy continues to ourish this year: industrial production grew, ination has eased, and the
trade surplus swelled.
has grown, ination eased, and the trade surplus has swelled
has grown, ination has eased, and the trade surplus swelled
grew, ination has eased, and the trade surplus swelled
is growing, ination easing and the trade surplus swelling
has grown, ination eased, and the trade surplus is swelling
3.
Improve the sentence by selecting the correct alternative to the italicized part of the sentence.
The boss was unsure as to what triggered the argument between Shyam and Shankar.
Broke
Spread
Provoked
Halted
4.
On the surface, the conquest of the Aztec empire by Herman Cortes is one of the most amazing
military accomplishments in history. With a small fighting force numbering in the hundreds, Cortes led
the Spanish explorers into victory against an Aztec population that many believe topped 21 million. In
light of such a seemingly impossible victory, the obvious question is: how did a small group of foreign
fighters manage to topple one of the world's strongest, wealthiest, and most successful military
empires? Several factors led to Cortes' success. First, the Spanish exploited animosity toward the
Aztecs among rival groups and convinced thousands of locals to fight. In one account of a battle, it is
recorded that at least 200,000 natives fought with Cortes. Next, the Spanish possessed superior
military equipment in the form of European cannons, guns, and crossbows, leading to effective and
efficient disposal of Aztec defenses. For example, Spanish cannons quickly defeated large Aztec walls
that had protected the empire against big and less technically advanced armies. Despite the Spanish
advantages, the Aztecs probably could have succeeded in defending their capital city of Tenochtitlan
had they leveraged their incredible population base to increase their army's size and ensured that no
rogue cities would ally with Cortes. In order to accomplish this later goal, Aztec leader Motecuhzoma
needed to send envoys to neighboring cities telling their inhabitants about the horrors of Spanish
conquest and the inevitability of Spanish betrayal. In addition, the Aztecs should have exploited the
fact that the battle was taking place on their territory. No reason existed for the Aztecs to consent to a
conventional battle, which heavily favored the Spanish. Motecuhzoma's forces should have thought
outside the box and allowed Cortes into the city, only to subsequently use hundreds of thousands of
ghters to prevent / escape and proceed in surprise "door-to-door" combat. With this type of battle,
the Aztecs would have largely thwarted Spanish technological supremacy. However, in the end, the
superior weaponry of the Spanish, the pent-up resentment of Aztec rivals, the failure of Aztec
diplomacy, and the lack of an unconventional Aztec war plan led to one of the most surprising military
outcomes in the past one thousand years.
The passage is sequentially organized in which of the following ways?
Introduce an enigma...
5.
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
B
A
No error
C
6.
His suit of armor made the knight __ to his enemy’s attack, and he was able to escape safely to his
castle
imprudent
churlish
vulnerable
static
invulnerable
7.
Among many reasons for his defeat in the election was his arrogant assumption that his
constituents were incapable of understanding economic conditions, and his unwarranted attack on
his chief opponent.
were his arrogant assumption that his constituents would be incapable of understanding
economics
were his arrogant assumptions that his constituents were incapable of understanding economical
conditions
was his arrogant assumption that his constituents were incapable of understanding economic
conditions
were his arrogant assumption that his constituents were incapable of understanding economic
conditions
was the arrogant assumption was /......
8.
Improve the sentence by selecting the correct alternative to the italicized part of the sentence As per
the weather prediction, it will rain heavily for the next one week
Report
Observation
Forecast
News
9.
On the surface, the conquest of the Aztec empire by Herman Cortes is one of the most amazing
military accomplishments in history. With a small fighting force numbering in the hundreds, Cortes led
the Spanish explorers into victory against an Aztec population that many believe topped 21 million. In
light of such a seemingly impossible victory, the obvious question is: how did a small group of foreign
fighters manage to topple one of the world's strongest, wealthiest, and most successful military
empires? Several factors led to Cortes' success. First, the Spanish exploited animosity toward the
Aztecs among rival groups and convinced thousands of locals to ght. In one account of a battle, it is
recorded that at least 200,000 natives fought with Cortes. Next, the Spanish possessed superior
military equipment in the form of European cannons, guns, and crossbows, leading to effective and
efficient disposal of Aztec defenses. For example, Spanish cannons quickly defeated large Aztec walls
that had protected the empire against big and less technically advanced armies. Despite the Spanish
advantages, the Aztecs probably could have succeeded in defending their capital city of Tenochtitlan
had they leveraged their incredible population base to increase their army's size and ensured that no
rogue cities would ally with Cortes. In order to accomplish this latter goal, Aztec leader Motecuhzoma
needed to send envoys to neighboring cities telling their inhabitants about the horrors of Spanish
conquest and the inevitability of Spanish betrayal. In addition, the Aztecs should have exploited the
fact that the battle was taking place on their territory. No reason existed for the Aztecs to consent to a
conventional battle, which heavily favored the Spanish. Motecuhzoma's forces should have thought
outside the box and allowed Cortes into the city, only to subsequently use hundreds of thousands of
ghters to prevent escape and proceed in surprise "door-to-door" combat. With this type of battle, the
Aztecs would have largely thwarted Spanish technological supremacy. However, in the end, the superior
weaponry of the Spanish, the pent-up resentment of Aztec rivals, the failure of Aztec diplomacy, and
the lack of an unconventional Aztec war plan led to one of the most surprising military outcomes in the
past one thousand years.
Which of the following best characterizes the main point the author is trying to convey in the passage?
spanish victory....
10.
Bombast is when high sounding words for effect, not suitability, are used.
is when you use high-sounding words for effect rather than for suitability.
is where high-sounding words are used for effect not suitability
is when high sounding words for effect, not suitability, are used.
is the using of high-sounding words for effect only.
is the use of high-sounding words for effect rather than for suitability
11.
Among the litany of threats that many Israelis face, the potential for a nuclear-armed Iran is perhaps
the more scary as this scenario could engulf the region in a violent war. This would likely result in
historically unseen amounts of destruction, even for a region whose history is marred by perennial
violenc
Possibly the great
perhaps the most
perhaps the more
Possibly the greatest
possibly, perhaps the most
12.
Improve the sentence by selecting the correct alternatives to the italicized part of the sentence. I said
to my teacher that I was not well and wanted to leave early
I said to my teacher that I am not
I told my teacher that I was not
No improvement needed
I told my teacher that I am no
13.
On the surface, the conquest of the Aztec empire by Herman Cortes is one of the most amazing
military accomplishments in history. With a small fighting force numbering in the hundreds, Cortes led
the Spanish explorers into victory against an Aztec population that many believe topped 21 million. In
light of such a seemingly impossible victory, the obvious question is: how did a small group of foreign
fighters manage to topple one of the world's strongest, wealthiest, and most successful military
empires? Several factors led to Cortes' success. First, the Spanish exploited animosity toward the
Aztecs among rival groups and convinced thousands of locals to ght. In one account of a battle, it is
recorded that at least 200,000 natives fought with Cortes. Next, the Spanish possessed superior
military equipment in the form of European cannons, guns, and crossbows, leading to effective and
efcient disposal of Aztec defenses. For example, Spanish cannons quickly defeated large Aztec walls
that had protected the empire against big and less technically advanced armies. Despite the Spanish
advantages, the Aztecs probably could have succeeded in defending their capital city of Tenochtitlan
had they leveraged their incredible population base to increase their army's size and ensured that no
rogue cities would ally with Cortes. In order to accomplish this later goal, Aztec leader Motecuhzoma
needed to send envoys to neighboring cities telling their inhabitants about the horrors of Spanish
conquest and the inevitability of Spanish betrayal. In addition, the Aztecs should have exploited the
fact that the battle was taking place on their territory. No reason existed for the Aztecs to consent to a
conventional battle, which heavily favored the Spanish. Motecuhzoma's forces should have thought
outside the box and allowed Cortes into the city, only to subsequently use hundreds of thousands of
ghters to prevent escape and proceed in surprise "door-to-door" combat. With this type of battle, the
Aztecs would have largely thwarted Spanish technological supremacy. However, in the end, the superior
weaponry of the Spanish, the pent-up resentment of Aztec rivals, the failure of Aztec diplomacy, and
the lack of an unconventional Aztec war plan led to one of the most surprising military outcomes in the
past one thousand years.
The author implies which of the following about the nature of Aztec regional influence and power?
Engendered some anger
14.
A. The two neighbours never fought each other.
B. Fights involving three male ddler crabs have been recorded, but the status of the participants was
unknown.
C. They pushed or grappled only with the intruder.
D. We recorded 17 cases in which a resident that was fighting an intruder was joined by an immediate
neighbour, an ally.
E. We therefore tracked 268 intruder males until we saw them ghting a resident male.
DEBAC
BEDAC
BCEDA
BDCAE
15.
On the surface, the conquest of the Aztec empire by Herman Cortes is one of the most amazing
military accomplishments in history. With a small ghting force numbering in the hundreds, Cortes led
the Spanish explorers into victory against an Aztec population that many believe topped 21 million. In
light of such a seemingly impossible victory, the obvious question is: how did a small group of foreign
ghters manage to topple one of the world's strongest, wealthiest, and most successful military
empires? Several factors led to Cortes' success. First, the Spanish exploited animosity toward the
Aztecs among rival groups and convinced thousands of locals to ght. In one account of a battle, it is
recorded that at least 200,000 natives fought with Cortes. Next, the Spanish possessed superior
military equipment in the form of European cannons, guns, and crossbows, leading to effective and
efcient disposal of Aztec defenses. For example, Spanish cannons quickly defeated large Aztec walls
that had protected the / empire against big and less technically advanced armies. Despite the Spanish
advantages, the Aztecs probably could have succeeded in defending their capital city of Tenochtitlan
had they leveraged their incredible population base to increase their army's size and ensured that no
rogue cities would ally with Cortes. In order to accomplish this later goal, Aztec leader Motecuhzoma
needed to send envoys to neighboring cities telling their inhabitants about the horrors of Spanish
conquest and the inevitability of Spanish betrayal. In addition, the Aztecs should have exploited the
fact that the battle was taking place on their territory. No reason existed for the Aztecs to consent to a
conventional battle, which heavily favored the Spanish. Motecuhzoma's forces should have thought
outside the box and allowed Cortes into the city, only to subsequently use hundreds of thousands of
ghters to prevent escape and proceed in surprise "door-to-door" combat. With this type of battle, the
Aztecs would have largely thwarted Spanish technological supremacy. However, in the end, the superior
weaponry of the Spanish, the pent-up resentment of Aztec rivals, the failure of Aztec diplomacy, and
the lack of an unconventional Aztec war plan led to one of the most surprising military outcomes in the
past one thousand years.
The author's tone can best be described as ?
Analytical
16.
If you will not do your work of your own __, I have no choice but to penalize you if it is not done on time.
infusion
coercion
predilection
volition
excursion
17.
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 rst time in fty years.
Decision.
Judgment
Chaos
Orde
18.
When this happens, each moment becomes a celebration of you; there is a rush of energy that comes
with feeling completely immersed in doing what you love most.
b. INFERENCE
a. FACT
c. JUDGEMENT
19.
Improve the sentence by selecting the correct alternative to the italicized part of the sentence.
Surprisingly Manipur received scantly rainfall this year.
Heavy
Rare
Scattered
Little
20.
I have always admired Seymour’s __; I’ve never seen him rattled by anything
nostalgia
confluence
aplomb
compunction
propriety
21.
On the surface, the conquest of the Aztec empire by Herman Cortes is one of the most amazing
military accomplishments in history. With a small ghting force numbering in the hundreds, Cortes led
the Spanish explorers into victory against an Aztec / population that many believe topped 21 million. In
light of such a seemingly impossible victory, the obvious question is: how did a small group of foreign
ghters manage to topple one of the world's strongest, wealthiest, and most successful military
empires? Several factors led to Cortes' success. First, the Spanish exploited animosity toward the
Aztecs among rival groups and convinced thousands of locals to ght. In one account of a battle, it is
recorded that at least 200,000 natives fought with Cortes. Next, the Spanish possessed superior
military equipment in the form of European cannons, guns, and crossbows, leading to effective and
efcient disposal of Aztec defenses. For example, Spanish cannons quickly defeated large Aztec walls
that had protected the empire against big and less technically advanced armies. Despite the Spanish
advantages, the Aztecs probably could have succeeded in defending their capital city of Tenochtitlan
had they leveraged their incredible population base to increase their army's size and ensured that no
rogue cities would ally with Cortes. In order to accomplish this later goal, Aztec leader Motecuhzoma
needed to send envoys to neighboring cities telling their inhabitants about the horrors of Spanish
conquest and the inevitability of Spanish betrayal. In addition, the Aztecs should have exploited the
fact that the battle was taking place on their territory. No reason existed for the Aztecs to consent to a
conventional battle, which heavily favored the Spanish. Motecuhzoma's forces should have thought
outside the box and allowed Cortes into the city, only to subsequently use hundreds of thousands of
ghters to prevent escape and proceed in surprise "door-to-door" combat. With this type of battle, the
Aztecs would have largely thwarted Spanish technological supremacy. However, in the end, the superior
weaponry of the Spanish, the pent-up resentment of Aztec rivals, the failure of Aztec diplomacy, and
the lack of an unconventional Aztec war plan led to one of the most surprising military outcomes in the
past one thousand years.
According to the passage, all of the following led to Cortes success except:
Nimble militry force
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) We
all know that Shakespeare is /(B) the better novelist/(C) in the world
B
A
No error
C
--------------------------------------------------------------------------------------------------------------------
Post a Comment