Infosys Pseudo-Code Questions and Answers 2023

Infosys Pseudo Code Questions

On this page, you can find Infosys Pseudo-code Questions and Answers for the year 2023. Algorithm code in C, C++, or any other language is typically represented as pseudo-code. There will be a total of 5 questions in the Pseudo Code round, and we will have ten minutes to respond and it’s mandatory, You can’t skip this. The paper’s difficulty ranges from moderate to high pseudo-Code is the same as an algorithm expressed in coding style; however, pseudo-code is not a machine-readable code. Visit our Infosys Dashboard for additional details on the Infosys Examination.

Check Infosys Syllabus

Infosys Pseudo-code Questions with Answers 2023

Company Infosys
Total Time Duration 10 minutes
Number of Question 5 Ques
Negative Marking No

Learn Pseudocode

Infosys Pseudo-Code Topics
Detailed Infosys Pseudo-Code Paper Pattern

Topics No. of questions in test Suggested Avg. Time Difficulty
C 1 Med Medium
C++ 2 Med Medium
OOPS 2 High Medium

Sample Questions:

Question 1: Which of these changes should make in the given code snippet to print “a” exactly 59 times?
int main()
{
      int i,x = 59;
      for(i = 0; i< x; i--)
            print("a");
      getchar();
}
  • Replace i by n in for all expressions in the loop
  • Replace ‘<‘ by ‘*’ in loop’s second expression.
  • Put ‘_’ before i in for loop’s second expression.
  • Replace x=59 by x = 60

Question 2: What will be the output of the given pseudo code, if n =10?

Read n
Initialize i to 5
while i<n, do:
Increase sun by i
increment end whe
end while
Write sum
  • 55.0
  • 45.0
  • 25.0
  • 35.0

Question 3: Consider the given problem statement

Problem Statement: Find the closest pair of points in an array of distinct points

Assume that you solve this problem by comparing all pairs of points. What will be the complexity of this approach?

  • O(N^2)
  • O(N)
  • O( N log N)
  • Cannot be determined

Question 4: 

What will be the number of *** printed by the given pseudo code when input is 25?

Write "Please enter a number"
Read input
Repeat while input>0

If (star 0 and star<= 10)
Write *
else if (star >10 and star<= 20)
Write **
else if (star>20 and star<= 30)
Write ***
input
end if
end while
  • 55.0
  • 35.0
  • 25.0
  • 45.0

Question 5: Predict the output of the given pseudo code

Read n
i = 0
while n%10!= 0
n = n+3
i++;
end while
n = n + i;
write n
  • 53.0
  • 50.0
  • 55.0
  • 45.0

 

PrepInsta Prime Trailer

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Get Prime