Pattern : 26 MCQS + 2 DSA
DSA Problem
Q1: https://www.codinzhub.com/question/validate-binary-string-as-power-of-2
Q2:https://www.codinzhub.com/question/lexicographically-largest-special-binary-string
What will be the output of the following program?
static int a;
printf("%d", ++a);
return 0;
Answer Options:
Consider three processes p1, p2, p3 respectively with compute time bursts 2, 4 and 8 time units. All processes arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. What is the average turn around time? Answer Options:
void main() {
char buff[] = "NVIDIA";
printf("%s", buff);
}
Answer Options:
NVIDIAWhat is the output of the following program?
void main() {
char str1[] = "Hello";
char str2[] = "World";
str1 = str2;
printf("%s %s", str1, str2);
}
Answer Options:
QMS<int> *qms = new QMS<int>();
qms->PutSampleData(0);
cout << qms->GetSampleData(0.0);
return 0;
Answer Options:
In the worst case, how many copy operations are required to insert an element into a sorted array of length $N$ that is not yet full? Answer Options:
What will be the output of the following program?
main() {
unsigned int y = 2;
int x = -2;
if (x > y)
printf("X is greater than Y");
else
printf("Y is greater than X");
return 0;
}
Answer Options:
If a singly linked list is used to implement a queue, what is the best case time complexity for inserting an element into the queue (assuming it already has $N$ elements)? Answer Options:
What is the output of the following program?
main() {
unsigned char ch = 0;
int count = 0;
while (++ch < 255)
count++;
printf("%d", count);
}
Answer Options:
If the page size is 4KB and logical address is of 22 bits then number of entries in the page table will be: Answer Options:
What operation does this function perform?
int MyFunction(int a, int b) {
int k = 0;
while (a - k * b >= b) ++k;
return a - k * b;
}
Answer Options:
Given six distinct colors, in how many unique ways can a six faced cube be painted such that no two faces have the same color? Answer Options:
Rahul and Ram invests in a business in a ratio of 4:5. They donate 10% of total profit to charity. If Rahul's net profit is 10 lakhs, how much is the total profit? Answer Options:
ABC is a triangle with angle A equal to 90 degrees, and $BC = 25$. If the area of ABC is 84, find its perimeter. Answer Options:
Two men, A and B, are standing 100 km away from each other. At a certain time, A starts running towards B at 20 kmph. At the same time, B starts running away from A at 10 kmph. At the same time, a Bee sitting on the shoulder of A starts flying at the speed of 50 kmph towards B. It touches B, and starts flying back towards A. It touches A and starts flying back towards B. It does this until both A and B meet. How much is the distance traveled by the Bee? Answer Options:
A shopkeeper purchased a few apples at 10 rupees per apple. He sells half the apples at 14 rupees per apple. The remaining apples start to decay, so he sells them at only 8 rupees per apple. What is his profit/loss percentage in the overall transaction? Answer Options:
5 boys and 8 girls can complete a job in 4 days. 10 boys and 6 girls can complete the same job in 3 days. How many girls need to work with 5 boys to complete the same job in 2 days? Answer Options:
The number of different (unique, but need not make sense) words that can be formed from the letters of the word COCOONS is: Answer Options:
3 men can dig a trench 3 feet deep working for 3 hours a day in 3 days. How deep a trench can 6 men dig working for 6 hours a day for 6 days? Answer Options:
A person runs from A to B at 8 kmph and walks back from B to A at 2 kmph. The average speed of the person is: Answer Options:
There is a small virus in a large jar. The virus doubles itself every minute. The virus fills up the jar in 12 minutes. How many minutes did it take for the virus to fill up a quarter of the jar? Answer Options:
3 couples need to be seated around a circular table such that no two persons of the same gender sit next to each other and spouses do not sit next to each other. In how many different configurations is this possible? Answer Options:
The sum of two numbers is 30. The sum of the squares of the two numbers is 458. The square of the difference between the two numbers is: Answer Options:
There are 256 Tennis players, find out minimum number matches required to get the second best player among them. Condition is that if player A beats B and B beats C then A beats C. Answer Options:
A bag contains 25 coffee and 25 caramel flavoured chocolates. Alice picks one random chocolate and eats it. After that, Bob also picks one random chocolate and eats it. What is the probability that at least one of them ate a caramel chocolate? Answer Options:
There are two jars of the same size that are both half full. The first jar has 10% water and 90% milk. The second jar has 10% milk and 90% water. A person transfers half the contents of the first jar to the second jar. After mixing the contents of the second jar, the person transfers half the contents of the second jar to the first jar. What is the percentage of milk in the first jar? Answer Options:
Atlassian • Pending
Salesforce • Pending
Salesforce • Pending
Salesforce • Pending