0% found this document useful (0 votes)
2 views

Capgemini Questions 5

The document contains a series of questions and problems related to computer science concepts, including applications of strings, binary search trees, climate change, and pseudocode outputs. It covers topics such as sorting algorithms, IP address conversions, and data structures. The questions are designed to test knowledge in various areas of programming, networking, and environmental science.

Uploaded by

hackersai47
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Capgemini Questions 5

The document contains a series of questions and problems related to computer science concepts, including applications of strings, binary search trees, climate change, and pseudocode outputs. It covers topics such as sorting algorithms, IP address conversions, and data structures. The questions are designed to test knowledge in various areas of programming, networking, and environmental science.

Uploaded by

hackersai47
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

1.

Which of the following are the application of strings


a. Spam email detection
b. Plagiarism detection
c. Spell checkers
2. If we draw a binary search tree by inserting th given numbers from left to right then what would
be the height of BST
463, 421, 456, 450, 454, 466, 461
a. 4
b. 3
c. 5
d. 6
3. Directions: Select the word or the phrase which is closer to the opposite in meaning of the
underlined word or phrase
He is showing signs of senility
a.Virility
b. Maturity
c. Laziness
d. Exhaustion

4. Directions: Select the word or the phrase which is closer to the opposite in meaning of the
underlined word or phrase

Iaconic
a. Uncivilized
b. Takative
c. Erudite
d. Liyid
4. Solve the given post fix expression
84/32^*5–
a. 15
b. 16
c. 13
d. 18
5. Find out the number of swappings required for sorting the given numbers in ascending order if
you are using bubble sort for sorting
78, 72, 75, 77, 79, 73
a. 6
b. 8
c. 10
d. 7
6. Find out the address of the element A[10][12] in a 2D array A[15][16] whose base address is 256
and elements are arranged in order .
**Assume 2 words per memory cell

a. 632
b. 612
c. 636
d. 600
7. Find out the number of vertices in a simple graph, if there are 24 edges , 3 vertices of degree 6, 6
vertices of degree 4, and all others of degree 3.
A.11
B.12
C.10
D.13

8. Identify the real-life applications of the Binary Search Tree.

1. D Game Engine.

2. Computer Graphics Rendering.

3. Routing Table.

A. 1 & 2 only

B. 1 & 3only

C. All 1,2 & 3

D. 2 & 3 only

9. Find out the array representation of the given min heap, if the value 163 is deleted from it.

148,154,153,164,175,163,172

A. 148,164,153,154,175,172
B. 148, 154, 153, 164, 175, 172
C. 148, 154, 164, 153, 175, 172
D. 148, 164, 154, 153, 175, 172

10. Which of the following sorting algorithms meets the minimum number of swaps

a. quick sort

b. selection sort

c. bubble sort

d. merge sort
11. which of the following is main distinguishable characteristic of binomial heap from a binary heap?

A. It allows union operations very efficiently

B. the location of child node is not fixed i.e child nodes could be at level (h-2) or (h-3), where it is height
of heap and

c. the heap structure is not similar to complete binary tree.

d. it does not allow union operations that could easily be implemented in binary heap.

12. Which of the following OSI model layer is also known as end-to-end layer?

A. Session layer

B. Presentation layer

C. Transport layer

D. Network layer

13. `Which of the following is the capacity to change the internal schema without having to change the
conceptual schema?

a. Logical data independence

b. physical data abstraction

c. physical data independence

d. logical data abstraction

14.Which of the following properties ensures that each transaction appears to execute in sepration from
other transaction

a. consistency

b. durability

c. isolation

d. atomicity

15. Solve the given postfix expression.

6 3/ 2 6 3 /- * 5 +

a. 6
b. 5
c. 11
d. 3

Climate change is a significant issue that impacts the environment in various ways it refers to long term
changes in temperature and weather patterns caused by human activities such as burning fossil fuels
deforestation and industrial processes. These activities increase the concentration of green house gases
in atmosphere which leads to global warming.

One of the most noticeable effects of climate change is the rise in global temperatures. Over the past
century, the Earth's average temperature has increased, causing more frequent and severe heatwaves.
This warming affects not only human health but also disrupts ecosystems, pushing many plant and
animal species towards the brink of extinction. For example, polar bears are struggling to ______ rely on
melts. as the ice they

In addition to rising temperatures, climate change leads to more extreme weather events. Hurricanes,
droughts, floods, and wildfires are becoming more common and intense. These natural disasters cause
widespread destruction, displacing communities and causing billions of dollars in damage. For instance,
hurricanes are now stronger and more destructive, affecting coastal areas more severely than before.

Furthermore, climate change is causing sea levels to rise. Melting polar ice caps and glaciers, along with
the thermal expansion of seawater, contribute to higher sea levels. This poses a significant threat to
coastal regions, leading to increased flooding and erosion. Many low-lying areas face the risk of
becoming uninhabitable, forcing people to relocate and resulting in the loss of valuable land and
resources.

In conclusion, climate change has profound and far-reaching effects on the environment. It disrupts
weather patterns, endangers ecosystems, and threatens human communities. Addressing this global
challenge requires urgent and coordinated efforts to reduce greenhouse gas emissions and adapt to the
changes that are already underway. By taking action now, we can work towards a more sustainable and
resilient future for all.

16. State whether the following statement is true or false.

Climate change does not lead to more extreme weather events.

a. True

b. False

c. Cannot be determined.

17. Choose the apt title

a. save environment

b.climate change and its effect on environment


c. environmental hazards

d. global warming

18. choose the word closest to meaning to the word endanger given in the passage.

a. guard

b. expose

c. venture

d.chance

19. Which of the following best fit the blank in the above passage

a. bear

b. revive

c. survive

d. suffer

20. which part of the sentence given below has errors

They played/ soccer for/ the park/ yesterday

a. They played
b. Soccer for
c. The park
d. Yesterday

21. which part of the sentence given below has errors

A sun/ sets in the/ west every/ evening

a. Sets in the
b. A sun
c. West every
d. Evening

22. which part of the sentence given below has errors

She reads / a book/before going/ for bed

a. She reads
b. Before going
c. A book
d. For bed

23. Convert the following binary notation IP addresses into the dotted decimal IP addresses

10000000.00001010.00000000.00000001

a. 127.10.0.10
b. 128.10.0.1
c. 128.10.0.10
d. 127.10.0.1

24. Which of the following statements is correcr for class C IP address?

1. The network ID is 24 bits long.

2. The host ID is 8 bits long

3. The default subnet mask is 255.255.255.x

a. 1 & 3 only

b. 2 & 3 only

c. 1, 2 & 3

d. 1 & 2 only

25. Convert the given binary notation IP address in the the dotted decimal IP addresses

01100001.11011101.10111111.11110111

a. 97.228.191.247
b. 92.221.191.247
c. 92.228.191.250
d. 97.221.191.247

26. Consider the following pseudocode:

1.

2. BEGIN procedure customOperation(nums)

3. IF length (nums) == 0 THEN RETURN O


4. DECLARE i = 0

5. FOR j = 1 TO length (nums) - 1 DO

6. IF nums[j] != nums THEN

7. i = i + 1

8. nums = nums[j]

9. RETURN + 1

10. END procedure

Input: nums = [1, 1, 2]

What will be the output of the procedure?

Ops:

A. 2

B.3

C. 1
d.0

27. IF you have developed an e-commerce website using shopify then which of the following cloud
services you should use to server?

a. AWS elastic beanstalk

b. Google cloud storage

c. Google compue engine

d. none

28. Arrange the following in chronological order as per 3-4-5 rule of cloud computing

1. cloud service models

2. Cloud deployement model

3. Clouds essential characterstics

a. 2-1-3

b. 2-3-1

c. 1-2-3

d. 1-3-2

29. What will be the output of the following pseudo code?

1. Integer p,q,r

2. Set p = 7 q = 2 r = 6

3. p = (r + p) ^ p

4. for (eacher from 3 to 5)

5. p = (12 ^ 1 * theta) + r
6. End for

7. p = (r + 4) + r

8. Print p+q

Note-^ is the bitwise exclusive OR operator that compares each bit of its first operand to the
corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the corresponding result bit
is set to 1. Otherwise, the corresponding result bit is set to 0.

Ops: A.38

B. 19

C. 11

E. 18

30.

2. Integer a, b, c

3. Set a = 3 , b = 5 c = 10
4. b = 2 + b

5.

6. for each c from 5 to 6 do

7. b = (a + c)^c

8. a = (a & b) + a

9. b = (c + 7) + c

10.

b = (a + 10) + a

11. End for

12.

13.

Print a b
What will be the output of the following pseudocode?

Ops: A. 22

B. 44

C. 15

D. 33

31. Which of teh following file organization techniques use some functions to calculate the address of
the page in which the record is to be stored, based on one or more fields in the record?

a. All

b. sequential file organization

c. Hashed file organization

d. Indexed sequential file organization

32. which of the following type of inferences rule is shown in the given figure

If X determines Y and X determines Z, then X must also determines Y and Z

a. Union rule
b. Transitive rule
c. Reflexive rule
d. Augumentation rule

33. which of the following constraints is specificed between 2 tables

a. referential integrity constraints

b. entity integrity constraints

c. Domain constraints

d.key constraints
34. Which of the following is a managed service mesh producr for load balancing, traffic management,
and observability for microservices architecture

a. cloud CDN

b. clod DNS

c. traffic director

d. Cloud interconnect

35. Which of the following are the functions of google’s networking product traffic director

a. load balancing

b. traffic management

c. observability for microservices architectures

36. Which of the following layers of the OSI model decides which physical path data will be?

1. physical

2. data link

3. network

4. transport

5. session

6. presentation

7. application

a. 5

b.4

c.3

d.2

37, which of the following is a data link later protocol?

a.SMTP

b. UDP

c.ARP
d. PPP

38. ____________ is a business intelligence tool that allows users to create interactive reports and
dashboards with data from various google services

a. dataflow

b. dataproc

c. Bigquery

d. data studio

39. 1.

2. BEGIN procedure customOperation(nums)

3. DECLARE maxProduct = nums [0]

4. DECLARE minEndingHere = nums [0]

5. DECLARE maxEndingHere = nums [0]

6. FOR i = 1 TO length(nums) - 1 DO

7. IF nums O THEN

8.

SWAP (minEndingHere, maxEndingHere)

9. minEndingHere = MIN(nums, minEndingHere * nums)


10.

max EndingHere = MAX(nums, maxEndingHere* nums)

11.

max Product = MAX(max Product, maxEndingHere)

12.

RETURN maxProduct

13. END procedure

Input: nums = [2, 3, -2, 4]

What will be the output of the procedure?

Ops:

A. 6

B. 0-2
C. 2

D. 4

Question 40:
What will be the output of the following pseudo code?

1.

2. Declare Integer a, b, c

3. Set a = 4, b = 6, c = 6

4. Set a = (b * c) + c

5. For each c from 3 to 6


6. Set b = b + c
7. Set b = c + a
8. Set b = b + a

6. End For

7. Set a = a & b

8. Display a + b

Options:
A. 12
B. 14
C. 18
D. 16

Q41.
What will be the output of the following pseudocode?

2. Integer a, b, c

3. Set a = 3, b = 5, c = 10

4. Set b = 2 + b

5.

6. For each c from 5 to 6 do


7. Set b = a + c
8. Set a = (a & b) + a
9. Set b = (c + 7) + c
10. Set b = (a + 10) + a
7. End For

8.

9. Print a, b

What will be the output of the above pseudocode?


Options:
A. 22
B. 44
C. 15
D. 33

Q42.
What will be the output of the following pseudo code?

1. Integer p, q, r

2. Set p = 3, q = 3, r = 5

3. For each r from 4 to 5


4. Set q = p + p
5. Set p = (q ^ p) * 8

4. End For

5. Set q = 5 + q

6. Print p + q

Note:

 &: Bitwise AND — compares each bit of the operands. If both are 1, result is 1; otherwise, 0.

 ^: Bitwise XOR — compares each bit of the operands. If bits differ, result is 1; otherwise, 0.

Options:
A. 64
B. 56
C. 88
D. 72
Q43.
What will be the output of the following pseudo code?

1. Integer p, q, r

2. Set p = 7, q = 2, r = 6

3. Set p = (r + p) ^ p

4. For each r from 3 to 5


5. Set p = (12 ^ 10) + r

5. End For

6. Set p = (r + 4) + r

7. Print p + q

Note:
^ is the bitwise exclusive OR (XOR) operator. It compares each bit of its operands. If one bit is 0 and the
other is 1, the result bit is 1. Otherwise, it is 0.

Options:
A. 38
B. 19
C. 011
D. 18

Q44.
Consider the following pseudocode:

1.

2. BEGIN procedure customOperation(nums)


3. IF length(nums) THEN RETURN
4. DECLARE i = 0
5. FOR j = 1 TO length(nums) - 1 DO
6. IF nums[j] ≠ nums[i] THEN
7. i=i+1
8. nums[i] = nums[j]
9. RETURN i + 1

3. END procedure

Input:nums = [1, 1, 2]
What will be the output of the procedure?

Options:
A. 02
B. 3
C. 01
D. 00

Q45.
What will be the output of the following pseudo code?

1. Integer p, q, r

2. Set p = 9, q = 8, r = 10

3. Set r = (q + r) + p

4. Set p = (r ^ q) + q

5. Set q = p & r

6. Print p + q + r

Note:

 &: Bitwise AND — compares each bit of the operands. If both bits are 1, the result bit is 1;
otherwise, 0.

 ^: Bitwise XOR — compares each bit of the operands. If bits differ, the result bit is 1; otherwise,
0.

Options:
A. 54
B. 44
C. 38
D. 50

Q46.
What will be the output of the following pseudocode?

1.

2. FUNCTION checkEvenOdd(num)
3. IF num % 2 == 0 THEN
4. RETURN "Even"
5. ELSE
6. RETURN "Odd"
7. END IF

3. END FUNCTION

4.

5. result = checkEvenOdd(7)
6. PRINT result

Options:
A. 07
B. Even
C. Error
D. Odd

Q47.
What will be the output of the following pseudocode?

2. Integer a, b, c

3. Set a = 6, b = 3, c = 4

4. Set y = (9 + 11) + b

5. If (1 > a || (c + 4) < a) then


6. Set b = c + b
7. If ((c + b) < (8 - c)) then
8. Set b = (a + 9) + b
9. End if

6. End if

7. Print a + b + c

Options:
A. 40
B. 35
C. 55
D. 33

Q48.
What will be the output of the following pseudocode?

1. Declare numbers as array [6, 7, 8, 9, 10]

2. Declare result = 0

3. For i from 0 to length of numbers - 1


4. If (numbers[i] AND 1) equals 1
5. result = result + numbers[i]
6. End If

4. End For

5. Display result

Note: AND 1 checks if the number is odd (bitwise AND with 1). Only odd numbers are added.
Options:
A. 16
B. 24
C. 26
D. 06

Q49.
What will be the output of the following pseudocode?

1. Declare numbers as array [6, 7, 8, 9, 10]

2. Declare result to 0

3. For i from 0 to length of numbers - 1


4. If (numbers[i] AND 1) equals 1
5. result = result + numbers[i]
6. End If

4. End For

5. Display result

Ops:
A. 16
B. 24
C. 26
D. 06

Q50.
What output sequence does the following program produce?

1. Function addValues(x as Integer, y as Integer)


2. Return x + y

2. End Function

3. Function addValues(x as Integer, y as Integer, z as Integer)


5. Return x + y + z

4. End Function

5. For j from 1 to 5
8. If j equals 2
9. Display addValues(j - 1, j)
10. Else
11. Display addValues(j, j + 1, j + 2)
12. End If

6. End For
Ops:
A. 6 3 12 15 18
B. 3 6 12 15 18
C. 3 6 9 12 15
D. 1 2 3 4 5

51. Find out the array representation of the given min heap, if the value 177 is deleted from it. 164, 169,
170, 177, 178

А. 164, 169, 170, 178

B. 164, 169, 170, 170

C. 154, 178, 170, 169

D..014, 178, 169, 170

52. 2. Declare class Base

3. Define virtual function show()

4.

5. End Define

Display "Base class"

6. End Declare
7.

8. Declare class A inherits Base

9. Override function show()

10.

Display "Class A"

11. End Define

12. End Declare

13.

14. Declare class B inherits Base

15.

16.

Override function show()


Display "Class B"

17. End Define

18. End Declare

19

20. Declare pointer pBase of type Base

21. Assign new A to pBase

22. pBase show()

23.

24. Assign new B to pBase

25 pBase show()

What output does the above pseudocode generate?

Ops:

A. O'Class A" followed by "Class 8"


B. Class B" followed by "Class A"

C. "Class A" followed by "Base class"

D. "Base class" followed by "Base dass"

53. 2. Define function recursiveFunction(n: integer)

3. If n equals e

4. Return 1

5. Else

6. Return n recursiveFunction(n-1)

7. End If

8. End function

9.

10. Define function memoryFunction(arr: pointer to integer, size: integer)

11. For 1 from a to size 1


12 Set arr to recursiveFunction(1)

13. End For

14. End function

15.

16. Start

17 Declare array arr of size 5

18. CALL memory Function(arr, 5)

19.

20For frowe to 4

22 End For

Display are

23. End

What will be the output when the above code is executed?


Ops:

A. 112 6 24

Β. 01234

C. 01111

D. 12 6 24 120

54. 02. Find out the array representation of the given min heap, if the value 177 is deleted from it. 164,
169, 170, 177, 178

Сре

А. 164, 169, 170, 178

E 0164, 169, 170, 170

C0154, 178, 170, 169

0.014, 178, 169, 170


55. Initialize array A with values [1, 4, 9, 16, 25]

3. Initialize variable P as 1

4. For i from a to length of A1 do

5. If A is a perfect square then

5. Multiply P by A

7. End If

8. End For

3. Return p

Ops:

01500

84300

14400

22500

57. Which of the following statements is/are correct for Hash tables?

1. Keys are unique


2. Collision resistance

1. Pre-image resistance

58. . FUNCTION f(x, y)

3. IF x == THEN

4. RETURN Y

5. ELSE

6. RETURN CALL f(x1, yx)

7. END IF

8. END FUNCTION

9.

10. FUNCTION g(a, b)

11. RETURN CALL f(a, b) + b

12. END FUNCTION


13.

14. DECLARE result AS INTEGER

15. SET result TO CALL g(4, 2)

58. 1.

2. Define function calculateResult(a, b, c)

3. If (a plus b) greater than c and (b minus c) less than a

4.

Return "Condition met"

5. Else

6.

Return "Condition not met"

7. End If

8. End Define
9.

10. Declare a to 20

11. Declare b to 30

12. Declare c to 10

13. Display calculateResult(a, b, c)

What will be displayed by this program?

Ops:

A 50

B. Condition not met

C. Condition met

D. 030

59. Q 22. What will be the output of the following pseudo code?

1.
2. Declare Integer a, b, c

3. Set a = 4 b = 6 c = 6

4. Seta a = (b ^ c) + c

5. For each c from 3 to 6

6. Set b = b + c

7. Set b = c + a

8. Set b = a + a

9. End For

10. Set a = ab

11. Display a b

Ops: A. 12

B. 14
C. 18

D. 16

60. 2. Integer a, b, c

3. Set a = 6 b = 3 c = 4

4. b = (9 + 11) + b

5. if (1>a|| (c + 4) < a ) then

6. b = c + b

7. if ((c + b) < (8 - c)) then

8. b = (a + 9) + b

9. End if

10.

End if

11.
Print a + b + c

What will be the output of the following pseudocode?

Ops:

Dar

A. 40

B. 35

C. 55

D. 33

61. Based on the pseudocode, what is the output when the input values for S are "rotate" and n is 3?

1.

2. BEGIN procedure customOperation (S, n)

3. SET n = n MOD length(S)

4. SET result = CONCAT(substring(S, length (S) substring(s, 0, length (S) - n)) n, length(S)),
5. PRINT result

6. END procedure

Ops:

A. "rotate"

B."aterot"

C. "tatero"

D. "terota

62,

You might also like