Practice Questions & Answers :: AMCAT

AMCAT
Tot. Mock Test: 87+
Tot. Exam. Sec.: 4+
Total Practice Qs: 307+
301 / 307
Ravi has to add an strictly upper triangular (no elements at diagonal) and a strictly lower triangular square matrix (no elements at diagonal) and put the result in a third matrix. What is the time complexity of Ravi's algorithm? Assume that storing a value in a memory space takes negligible time, while each addition between values takes the dominating amount of time.
A&theta(n^2)
B&theta(n)
C&theta(1)
DNone of these
ENone of these
Answer: Option C
Explanation:Here is no explanation for this answer
Submit Your Solution
302 / 307
Ravi is writing a program in C++. C++ uses the 'for' keyword for loops. Due to distraction, Ravi writes 'gor' instead of 'for'. What will this result to?
AThe code will not compile
BThe code will give an error while in execution
CThe code may work for some inputs and not for others.
DIt will create no problems.
ENone of these
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
303 / 307
function g(int n)
{
if (n > 0) return 1;
else return -1;
}
function f(int a, int b)
{
if (a > b) return g(b-a); if (a < b) return g(-a+b); return 0;
}
If f(a,b) is called, what is returned?
AAlways +1
B-1 if a > b, 1 if a < b, 0 otherwise
C1 if a > b, -1 if a < b, 0 otherwise
D0 if a equals b, -1 otherwise
ENone of these
Answer: Option B
Explanation:Here is no explanation for this answer
Submit Your Solution
304 / 307
Gautam is given two codes, A and B, to solve a problem, which have complexity &theta(n) and &theta(n2) respectively. His client wants to solve a problem of size k, which Gautam does not know. Which code will Gautam deliver to the client, so that the execution is faster?
ACode A
BCode B
CGautam cannot determine
DBoth codes have the same execution time, so deliver any.
ENone of these
Answer: Option C
Explanation:Here is no explanation for this answer
Submit Your Solution
305 / 307
function g(int n)
{
if (n > 0) return 1;
else return -1;
}
function f(int a, int b)
{
if (a > b) return g(b-a);
if (a < b) return g(a-b); return 0;
}
If f(a,b) is called, what is returned?
AAlways -1
B1 if a > b, -1 if a < b, 0 otherwise
C0 if a equals b, -1 otherwise
D0 if a equals b, -1 otherwise
ENone of these
Answer: Option D
Explanation:Here is no explanation for this answer
Submit Your Solution
306 / 307
How many comparisons are needed to sort an array of length 5 if a straight selection sort is used and array is already in the opposite order?
A1
B10
C50
D20
ENone of these
Answer: Option B
Explanation:Here is no explanation for this answer
Submit Your Solution
307 / 307
Rajni wants to create a data-type for the number of books in her book case.
Her shelf can accommodate a maximum of 75 books. She allocates 7 bits to the datatype.
Later another shelf is added to her book-case. She realizes that she can still use the same data-type for storing the number of books in her book-case. What is the maximum possible capacity of her new added shelf?
A52
B127
C53
D75
ENone of these
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
Here is the list of questions asked in AMCAT Question Bank Page 31. Practice AMCAT Written Test Papers with Solutions and take Q4Interview AMCAT Online Test Questions to crack AMCAT written round test. Overall the level of the AMCAT Online Assessment Test is moderate. Only those candidates who clear the written exam will qualify for the next round, so practic all the questions here and take all the free tests before going for final selection process of AMCAT