Commvault Aptitude Questions and Answers for Freshers
1 / 40
#include <stdio.h>
typedef int CommVault;
typedef CommVault CommVaultindia;
void main () {
CommVaultindia val= 234;
printf("%d ", val);
}
ACompilation error: typedef cannot be outside a function scope
BCompilation error: undefined variable val
C234
DCompilation error: cannot typedef based on another typedef
Answer: Option C
Explanation:Here is no explanation for this answer
Submit Your Solution
2 / 40
What is output or the error in the program if the command line data is?
CornmVault India
#include
int main(int argc, char *argv[]) {
printf(" %d", printf("%s", argv[1]));
return 0;
}
ACommvault
BIndia 5
CIndia 9
DCommVault 9
Answer: Option D
Explanation:Here is no explanation for this answer
Submit Your Solution
3 / 40
What is the output of the program on a 32 bit Operating System?
#include
#include
void main () {
double val = 12.34;
double *dp = &val;
char *cp;
cp = (char*)malloc(sizeof(char) * 20);
sprintf (cp, "hello world");
printf("%d %d %d", sizeof(cp), sizeof(dp), sizeof(val));
}
A4 4 8
B20 8 8
C11 8 8
D20 4 8
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
4 / 40
Match the following?
i) Software Interrupt mechanism (l)Deadlock
ii) Passing data from one process to another process (2)Signals
iii) A situation wherein two or more competing actions (3)Preemptive multitasking
are waiting for the other to finish, and thus
neither ever does
iv) Allows the computer system to more reliably guarantee each process a regular slice of operating time (4)Pipe
Ai-4, ii-3, iii-2, iv-1
Bi-4, ii-3, iii-2, iv-1
Ci-2, ii-4, iii-1, iv-3
Di-4, ii-2, iii-1, iv-3
Answer: Option B
Explanation:Here is no explanation for this answer
Submit Your Solution
5 / 40
#include<stdio.h>
int main () {
int ( *Commprintf) (const char*, ... ) = printf;
Commprintf ( "Hello World");
return 0;
}
ANo output
BUndefined symbol Commprintf
CCompile Error: Prototype mismatch
DHello World
Answer: Option D
Explanation:Here is no explanation for this answer
Submit Your Solution
6 / 40
What is output or the error in the program?
#include
void main () {
const char* cptr = "Hello";
printf ("%c", (*++cptr)++);
}
Al-value specifies const object
BNo error, output is e
CNo error, output is H
DNo error, output is 1
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
7 / 40
#include <stdio.h>
void main () {
struct {
float c ,
union p {
char c;
char *cp;
short s;
} uvar[5);
} svar [6];
printf("%d %d", &svar[2], &svar[5]);
}
A1244784 1244976
B1244944 1245016
C1244784 1244932
D1244944 1244992
Answer: Option B
Explanation:Here is no explanation for this answer
Submit Your Solution
8 / 40
#include <iostream>
using namespace std;
void fun(int a, int b, int &c,int &d)
{
c += a + b;
d += a - b;
}
int main () {
int vl = 5, v2 = 10, v3 = 2, v4 = 3;
fun(vl, v2, v3, v4);
cout << v3 << " "<< v4 ;
return 0;
}
A15 -5
B2 3
C17 -2
DNone of the above
Answer: Option C
Explanation:Here is no explanation for this answer
Submit Your Solution
9 / 40
#include <iostream>
using namespace std;
class test {
float x, y;
public:
test(float a = 1.0, float b = 2.0)
{
x = a;
y = b;
}
test operator + (test & obj) {
return test(this->x + obj.x, y + obj.y);
}
operator float () {
return (x + y) ;
}
};
int main () {
test obj1(1.23, 4.56), obj2;
obj2 = obj1 + obj2;
cout << obj2;
return 0;
}
A8.79
B5.79
C3
DCompilation error: binary '<<': no operator found which takes a right-hand operand of type 'test'
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
10 / 40
What is the signature of the assignment operator in C++, if chain of assignments need to be performed for an object of class test?
Atest & operator = (const test&);
Bvoid & operator =(const test&);
Ctest & operator = ();
Dvoid & operator = (const test);
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
Here is the list of questions asked in Commvault Aptitude Questions and Answers for Freshers - Q4Interview. Practice Commvault Written Test Papers with Solutions and take Q4Interview Commvault Online Test Questions to crack Commvault written round test. Overall the level of the Commvault 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 Commvault