1.
A man ate 100 bananas in five days,
each day eating 6 more than the previous day. How many bananas
did he eat on the first day?
Correct Answer
C. 8
Explanation
The man ate 100 bananas in five days, with each day eating 6 more than the previous day. To find out how many bananas he ate on the first day, we can work backwards. On the fifth day, he ate 100 bananas, so on the fourth day, he ate 100 - 6 = 94 bananas. Following the same pattern, on the third day, he ate 94 - 6 = 88 bananas. On the second day, he ate 88 - 6 = 82 bananas. Finally, on the first day, he must have eaten 82 - 6 = 76 bananas. Therefore, the correct answer is 8.
2.
If there are 1024*1280 pixels on a
screen and each pixel can have around 16 million colors, how much memory do we need to store this?
Correct Answer
B. 4 MB
Explanation
To calculate the memory needed to store the given number of pixels, we multiply the number of pixels by the number of colors each pixel can have. In this case, there are 1024*1280 pixels, which equals 1,310,720 pixels. Each pixel can have around 16 million colors. Multiplying these two numbers together gives us 20,971,520,000 bits. To convert this to megabytes, we divide by 8 and then divide by 1 million, resulting in approximately 2.621440 MB. Since this is closer to 4 MB than any other option, the correct answer is 4 MB.
3.
20% of a 6 litre solution and 60%
of 4 litre solution are mixed. What percentage of the mixture of
solution?
Correct Answer
D. 36%
Explanation
To find the percentage of the mixture of the solution, we need to calculate the total amount of solution after mixing.
First, we find 20% of 6 liters, which is 1.2 liters.
Then, we find 60% of 4 liters, which is 2.4 liters.
Adding these amounts together, we get a total of 3.6 liters.
To find the percentage of the mixture, we divide the total amount of solution (3.6 liters) by the total volume of the mixture (6 + 4 = 10 liters) and multiply by 100.
(3.6/10) * 100 = 36%
Therefore, the percentage of the mixture of the solution is 36%.
4.
If x=y=2z and xyz=256, what is the value of x?
Correct Answer
C. 8
Explanation
Given that x = y = 2z, we can substitute y with 2z in the equation. This gives us x * 2z * z = 256. Simplifying further, we have 2xz^2 = 256. Since we are looking for the value of x, we can divide both sides of the equation by 2z^2. This gives us x = 256 / (2z^2). Since we are not given the value of z, we cannot determine the exact value of x. Therefore, the answer is not available.
5.
In C what would be the value of result after the following snippetint result = 4 << 2;
Correct Answer
C. 16
Explanation
The given code snippet performs a left shift operation on the value 4 by 2 positions. In C, the left shift operator (
6.
X provides a concise and flexible means for matching strings oftext, such as particular characters, words, or patterns of characters. What is X?
Correct Answer
A. Regular expressions
Explanation
Regular expressions provide a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. They allow for pattern matching and searching within text, making it easier to find specific strings or patterns of interest. Regular expressions are commonly used in programming, text processing, and data validation tasks. They provide a powerful tool for manipulating and analyzing text data.
7.
Int z,x=5,y=-10,a=4,b=2; z = x++ - --y * b / a;What number will z in the sample code above contain?
Correct Answer
C. 10
Explanation
In the given code, the value of x is initially 5 and the value of y is initially -10. The expression x++ means that the value of x is used in the calculation first and then incremented by 1. The expression --y means that the value of y is decremented by 1 and then used in the calculation. The expression y * b / a means that the value of y is multiplied by b and then divided by a. Finally, the expression x++ - --y * b / a is evaluated. So, the value of z will be 10.
8.
Char* myFunc (char *ptr){ ptr += 3; return (ptr);} int main(){ char *x, *y; x = "HELLO"; y = myFunc (x);
printf ("y = %s \n", y); return 0;}
Correct Answer
D. LO
Explanation
The function `myFunc` takes a pointer to a character as an argument and increments the pointer by 3. Then, it returns the updated pointer. In the `main` function, the variable `x` is assigned the string "HELLO". When `myFunc` is called with `x` as the argument, the pointer `ptr` inside `myFunc` points to the fourth character of the string "HELLO". This pointer is then returned and assigned to the variable `y`. When `printf` is called, it prints the string starting from the character pointed to by `y`, which is "LO".
9.
What is the return type of a constructor?
Correct Answer
E. Same class as constructor
Explanation
The return type of a constructor is the same class as the constructor itself. In other words, a constructor does not have a return type. The purpose of a constructor is to initialize an object of a class, and it is automatically called when an object is created. Therefore, it does not need to return anything.
10.
What is the mean and median of the following set of numbers?1,1,2,3,5,8,13
Correct Answer
A. Mean = 16.5, median = 3
Explanation
The mean is the average of a set of numbers, calculated by adding up all the numbers and dividing by the total count. In this case, the sum of the numbers is 33 (1+1+2+3+5+8+13=33) and there are 7 numbers in the set, so the mean is 33/7 = 4.71. However, none of the given options have a mean of 4.71, so the mean is not included in any of the options. The median is the middle value in a set of numbers when they are arranged in order. In this case, when the numbers are arranged in ascending order, the middle value is 3. Therefore, the correct answer is mean = 16.5, median = 3.
11.
Which of the following does not maintain the order of elements?
Correct Answer
C. Set
Explanation
A Set does not maintain the order of elements. Unlike Queue, Stack, Linked List, and Circular Queue, which all have a specific order in which elements are added and retrieved, a Set does not guarantee any particular order. The elements in a Set are typically stored in a way that allows for efficient retrieval and searching, but the order in which they were added is not preserved. Therefore, a Set is the correct answer as it does not maintain the order of elements.
12.
What kind of index will you use if you are designing a search engine?
Correct Answer
D. Inverted Index
Explanation
Inverted Index is the most suitable kind of index for designing a search engine. Unlike other types of indexes, the Inverted Index stores a list of documents for each unique word in the search engine's database. This allows for efficient and fast retrieval of relevant documents when a user enters a search query. By using the Inverted Index, the search engine can quickly identify and retrieve documents that contain the search terms, providing accurate and relevant search results to the user.
13.
Apple iPhone uses a powereful processor but underclocks it to lower speed. Why?
Correct Answer
C. Improves battery life.
Explanation
Underclocking the powerful processor in an Apple iPhone improves battery life. By reducing the speed at which the processor operates, the phone consumes less power, allowing the battery to last longer. This is a common strategy employed by smartphone manufacturers to balance performance and battery efficiency.
14.
Why does the heatsink of a processor have large number of fins?
Correct Answer
B. Increases the surface area
Explanation
The heatsink of a processor has a large number of fins in order to increase the surface area. By increasing the surface area, the heatsink is able to dissipate heat more efficiently. This is because a larger surface area allows for more contact with the surrounding air, which helps to transfer the heat away from the processor. Increasing the surface area also allows for better airflow and can help to prevent overheating.
15.
If a computer has 4 bits on its address bus, how many locations can it address?
Correct Answer
C. 16
Explanation
A computer with 4 bits on its address bus can address a total of 16 locations. This is because each bit in the address bus can represent 2 different states (0 or 1), and with 4 bits, there are 2^4 = 16 possible combinations. Each combination corresponds to a unique memory location that can be addressed by the computer. Therefore, the computer can address 16 different locations.
16.
What is the purpose of DNS ?
Correct Answer
E. It maps domain name to IP address.
Explanation
The purpose of DNS (Domain Name System) is to map domain names to IP addresses. This allows users to access websites and other resources on the internet using easy-to-remember domain names, rather than having to remember the numerical IP addresses associated with each website. DNS acts as a directory service, translating human-readable domain names into the corresponding IP addresses that computers use to communicate with each other on the internet.
17.
What is the angle (in degrees) subtended by the clock hands when the time is 5:15 ?
Correct Answer
D. 60
Explanation
When the time is 5:15, the minute hand is at the 3 position and the hour hand is at the 5 position. The hour hand moves 30 degrees per hour, so in 15 minutes it would have moved 7.5 degrees. The minute hand moves 6 degrees per minute, so in 15 minutes it would have moved 90 degrees. The angle between the hour and minute hand is the difference between their positions, which is 90 - 7.5 = 82.5 degrees. However, since the question asks for the angle subtended by the clock hands, we take the smaller angle between them, which is 360 - 82.5 = 277.5 degrees. Since the question asks for the angle in degrees, the correct answer is 60.
18.
If 10 people were writing this interview, how many ways can 4 candidates be chosen?
Correct Answer
C. 210
Explanation
The question is asking for the number of ways 4 candidates can be chosen out of 10 people. This can be calculated using the combination formula, which is nCr = n! / (r!(n-r)!), where n is the total number of people and r is the number of candidates to be chosen. Plugging in the values, we get 10C4 = 10! / (4!(10-4)!) = 210. Therefore, the correct answer is 210.
19.
What is the latest version of HTML specification that has been released by W3C?
Correct Answer
D. 4
Explanation
The latest version of HTML specification released by W3C is version 4.
20.
Write a few sentences to explain a topic of your interest.