![](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_227,h_146/https://codewindow.in/wp-content/uploads/2021/06/1540810007-7452-620x400.jpg)
Q1. What will be the output of the following pseudocode for a=6, b=3, c=4?
Integer funn(Integer a, Integer b, Integer c)
for(each c from 5 to 6)
b=(b+a)^a
End for
return a+b
a) 37
b) 23
c) 29
d) 25
Answer: d) 25
Explanation:
for c = 5
a = 6, b = 3
(b + a) ^ a = 9 ^ 6 = 15
b = 15
for c = 6
a = 6, b = 15
(b + a) ^ a = 21 ^ 6 = 19
b = 19
a + b = 6 + 19 = 25
Q2. What will be the output of the following pseudocode?
Integer a,b,c
set a=5, b=3, c=5
if((c+b+a)<(a+c))
a=(a+b)+a
End if
if((7+a-b)<(b+c))
c=(3+8)+c
End if
print a+b+c
a) 4
b) 23
c) 15
d) 13
Answer: d) 13
Explanation:
First if condition is false, so the block will not execute.
Second if condition is also false, so that block will also not execute.
a + b + c = 5 + 3 + 5 = 13
Q3. What will be the output of the following pseudocode?
Integer a,b,c
set a=5, b=7, c=8
if((c-9)<(9-c))
a=c^b
a=b+c
else
a=a+b
b=(b+5)+a
if(5>b)
c=(b+a)+c
a=c+a
End if
a=(b&5)+a
End if
print a+b+c
a) 32
b) 25
c) 30
d) 42
Answer: c) 30
Explanation:
First if condition is true.
a = c ^ b = 8 ^ 7 = 15
a = b + c = 7 + 8 = 15
a + b + c = 15 + 7 + 8 = 30
Q4. What will be the output of the following pseudocode?
Integer p,q,r
set p=2, q=8, r=9
for(each r from 5 to 9)
q=q+r
if((9&q)<r)
q=3^pa
q=5+q
Else
jump out of the loop
End if
p=5+r
End for
print p+q
a) 24
b) 20
c) 15
d) 10
Answer: c) 15
Explanation:
for r = 5
q = q + r = 8 + 5 = 13
if condition is false and jump out of the loop
p + q = 2 + 13 = 15
Also Read: Capgemini Sample Question Paper I
Q5. Post-order traversal of a BST, produces the following sequence of keys
28, 33, 47, 61, 55, 99, 82, 75, 41
Which one of the following sequences of keys can be the result of an in-order traversal of the same BST?
a) 28, 33, 41, 47, 55, 61, 75, 82, 99
b) 28, 33, 41, 55, 47, 61, 75, 82, 99
c) 28, 33, 47, 41, 55, 61, 75, 82, 99
d) 28, 33, 41, 47, 61, 55, 75, 82, 99
Answer: a) 28, 33, 41, 47, 55, 61, 75, 82, 99
Explanation:
POT is 28, 33, 47, 61, 55, 99, 82, 75, 41
So 41 is the root. 75 is the right children of 41, and as it is a BST 33 will the left children. 28 will be the only left children of 33.
47 has to be the left most child of 75. 61 or 55 has to be its parent but as 61 comes before 55, 55 is parent of 61. Same goes for 82 and 99.
41
/ \
33 75
/ / \
28 55 82
/ \ \
47 61 99
Q6. Which of the following data structure is used to convert the infix expression into prefix/postfix?
a) Stack
b) Queue
d) Tree
d) List
Answer: a) Stack
Q7. Which of the following data structure cannot be used to create a circular queue?
a) Stack
b) Array
c) Single linked list
d) Double linked list
Answer: a) Stack
Q8. If the base address of a two dimensional array A[100][300] is 10000, then find out the address of an element A[2][2] in the array.
**assume 4 words per memory cell and elements are arranged in column major order.
a) 10050
b) 10808
c) 18007
d) 17009
Answer: b) 10808
Explanation:
The address of A[2][2] = 10000 + (2 * 100 + 2) * 4 = 10808
Also Read: Infosys Sample Question Paper
Q9. If the base address of a two dimensional array A[200][300] is 20, then find out the address of an element A[2][4] in the array.
**assume 2 words per memory cell and elements are arranged in column major order.
a) 1258
b) 1828
c) 1228
d) 1624
Answer: d) 1624
Explanation:
The address of A[2][4] = 20 + (4 * 200 + 2) * 2 = 1624
Q10. Find out the sum of the degree of vertices in the pseudograph as shown in the image.
![](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_250,h_185/https://codewindow.in/wp-content/uploads/2021/09/Screenshot-2021-09-03-203559.png)
a) 26
b) 24
c) 12
d) 22
Answer: b) 24
Q11. Find out the pre order traversal sequence of the given BTS.
![](https://sp-ao.shortpixel.ai/client/to_webp,q_glossy,ret_img,w_420,h_146/https://codewindow.in/wp-content/uploads/2021/09/Screenshot-2021-09-03-211148.png)
a) 30, 20, 10, 15, 23, 25, 39, 35, 42
b) 30, 20, 10, 15, 25, 23, 35, 39, 42
c) 30, 20, 10, 25, 15, 23, 39, 35, 42
d) 30, 20, 10, 15, 25, 23, 39, 35, 42
Answer: d) 30, 20, 10, 15, 25, 23, 39, 35, 42
- Adobe
- Advanced Coading
- Advanced course
- Ajax
- Algorithm
- Amagi
- Amazon Interview Questions
- Angular JS
- Aptitude
- Aptitude tricks
- Automata Fixing
- Basic Coding
- big data
- Books
- Bridge2i
- C programming
- Campgemini Interview Questions
- Capgemini Coding Questions
- Capgemini Pseudocode
- Celebal Tech
- Cloud Computing
- code nation
- Coding Questions
- Cognizant Placement
- commvault Systems
- Computer Network
- CSS
- CTS
- Data Science
- Data Structure
- Data Structure and Algorithm
- DBMS
- De Show Interview Questions
- deloitte
- Deutsche Bank Interview questions
- Enhance Communication
- Epam Full Question Paper
- Extempore
- Exxon Mobil interview questions
- filpkart
- Fractal Analytics Interview Questions
- Genpact
- Grab
- GreyB Interview Questions
- Group Discussion
- Guidance for Accenture
- Gupshup
- Hackathon 2024
- HCL Interview Questions
- Hexaware
- HFCL
- HR Questions
- HTML5
- IBM Interview questions
- IBM Questions
- Incture Interview Questions
- Infineon Technologies Interview Questions
- Infosys
- Infosys Interview Questions
- Internship
- Interview Experience
- Interview Questions
- ITC Infotech
- itron
- JavaScript
- JECA
- Job Info
- JQuery
- Kantar Interview Questions
- Language Confusion
- language confussion
- Larsen & Turbo
- Latenview AnalyticsInterview questions
- Lexmark International Interview Questions
- Machine Learning
- Media.net
- Mindtree Interview Questions
- Miscellaneous
- Mock Test Series
- MongoDB
- Morgan Stanly Interview Questions
- nagarro
- navi
- NodeJS
- NTT Data Interview Questions
- NVDIA
- NVDIA interview questions
- Operating System
- Optum
- PayU
- Persistent INterview Questions
- PHP and MYSQL
- Previous Coding Questions
- Programming in C
- Programming in C++
- Programming in JAVA
- Programming in Python
- Pseudo Code
- pseudocode
- PWC Interview Questions
- Python
- Quiz
- Razorpay
- ReactJS
- Recruiting Companies
- Revature
- salesforce
- Samsung
- Schlumberger
- Seimens
- Slice
- Smart Cube
- Software Engineering
- Study Material
- Tally Solutions
- tata cliq
- TCS
- TCS NQT
- TCS NQT Coding Questions
- Tech Mahindra Coding Questions
- Tech Mahindra Questions
- Technical Preparation
- Teg Analytics
- Tejas Network Interview Questions
- Texas Instrument Interview Questions
- Tiger Analytics
- Uncategorized
- UnDosTres
- Unstop
- Verbal Ability
- Verbal Lesson
- Web Development
- wipro
- Wipro Coding Questions
- Wipro interview Questions
- Wipro NLTH
- WIpro NLTH Coding Solve
- Zenser
- Zoho Interview Questions