If you are preparing for Infosys and must go through pseudocode questions quickly, you’ve arrived at the perfect place. A good practice of the most often asked questions is what you require to ace the interview with Infosys coding questions.
After much brainstorming, we are here with 6 of the best pseudocode questions for Infosys that will help you shine and get hired.
What Do You Mean by Pseudocode?
Before moving to the questions, let us clarify our basics. PseudoCode is a simplified notation programming language that helps developers build algorithms and sharpen programming skills. Simply put, it is code that even humans can read, not just machines. This implies that even the Pseudocode questions for Infosys will be quite easy when it comes to the difficulty level, and one could learn them in a short span of time. With this in mind, let us move forward to the questions with a boost of confidence and adrenaline.
Is Pseudocode Important in Infosys coding questions?
Infosys has a multi-level test series that finalises the selection of any candidate during various interview rounds. The pseudocode test is the fourth level of the test series. The candidate is given ten minutes to solve five questions of pseudocode, making it pretty hard as the candidate only gets a maximum of two minutes per question. Keep in mind that only the candidate who passes all the levels is ultimately eligible for the puzzle-solving round. Finally, the job interview and the pseudocode test are very important.
6 Infosys Coding Questions on Pseudocode
It is always good to prepare with similar interview questions to clear the level easily and within the time frame. Solve as many questions as possible, and do not miss out on the 6 best pseudocode questions below for Infosys 2024.
1. Give Output to the following Code
//Learnprogramo – programming made simple
#include
int main()
{
typedef int num;
num bunk = 0.00;
printf(“%d”, bunk);
return 0;
}
Options:
- 0
- 0.0
- Error
- None of the above
Answer: The correct answer will be option a) 0. In the C language, %d denotes an integer array, and the integer part of 0.0 is 0. That is why from printf(“%d, bunk), only 0 will print.
2. What is the Possible Output of the Given Code?
//Learnprogramo – programming made simple
#include
int main()
{
int go = 5.0, num = 1*10;
do
{
num /= go;
} while(go–);
printf (“%d\n”, num);
return 0;
}
Options:
- No Output
- Compilation Error
- Floating Pointer Exception
- 5 10 15
Answer: The correct option is c) Floating Pointer Exception. This is because, while writing a code in C language, if an integer is divided with a float without any type casting, then it gives the error – “Floating Point Exception”.
3. What Will Be the Outcome of the Following Code?
//Learnprogramo – programming made simple
#include
int main()
{
int num = 987;
int rem;
while(num!=0)
{
rem = num % 4;
num = num / 10;
}
printf(“%d”,rem);
}
Options:
- 0
- 1
- 10
- 5
Answer: The correct option is b) 1. The explanation is quite simple. The first iteration, rem = 3(987 % 4) has num = 98. The second Iteration, rem = 2(98 % 4) has num = 9. Therefore the third Iteration, rem = 1(9 % 4) will give num = 1.
4. Give Output of the Following Program
//Learnprogramo – programming made simple
public class Main
{
public static void main(String[] args)
{
String names[] = new String[5];
for(int x=0; x
Options:
- Exception
- Null
- None
- Compilation Error
Answer: The correct option is b) Null. Since the value of args.length is 0, the loop will not run the time. Therefore, Null will get printed.
5. Predict the Output for the Given Code
//Learnprogramo – programming made simple
#include
Int main()
{
float x = 0.0;
long int y = 10;
printf(“%d”, sizeof(y) == sizeof(x+y));
return 0;
}
Options:
- 3
- 1
- 5
- 2
Answer: The correct option is b) 1. While coding in the C language, the size of variable x of type float is 4. The size of variable y that is long int is 8. On combining both, i.e., (x + y), the size results in a float, which is again 4. Since the question asks: the size of(y) == size of(x+y), which we know is 4 == 4. Then, the operator “==” returns either 0 or 1, so the correct answer is 1.
6. Predict the Output
//Learnprogramo – programming made simple
#include
int main()
{
int x;
for (x = 10; x >= 0; x–) {
int z = x & (x >> 1);
if (z)
printf(“%d “, x);
}
Options:
- 678
- 763
- 6 7 8
- 7 6 3
Answer: The correct option is d) 7 6 3. The value of z will be 1 for x = 7, 6, and 3 where z is non-zero. So, the values 7, 6, and 3 will print on the screen.
Conclusion
If you try to wade in too quickly and start coding on the whiteboard, you’ll find yourself struggling to implement a solution for a question you know little about. This may work for some knowledge questions where it’s not vital to have an understanding of why something works; however, this isn’t the case for the Infosys coding questions.
The exclusive free Software Engineering Bootcamp can help anyone looking for hands-on practice with a paid Internship. Their unique focus on internship helps the learner grasp and retain things fundamentally and for a long time. Also, visit their website to learn more about CodeQuotient, which is associated with colleges.