0% found this document useful (0 votes)
11 views21 pages

Software Engineer Trainee Prep Guide

The document is a preparation guide for trainee software engineers, consisting of 100 multiple-choice questions covering topics such as data structures, algorithms, SQL, and networking. Key concepts include FIFO order in queues, time complexity of binary search, method overloading, encapsulation, and properties of ACID. It also addresses SQL functions and joins, as well as basic arithmetic and logic problems.

Uploaded by

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

Software Engineer Trainee Prep Guide

The document is a preparation guide for trainee software engineers, consisting of 100 multiple-choice questions covering topics such as data structures, algorithms, SQL, and networking. Key concepts include FIFO order in queues, time complexity of binary search, method overloading, encapsulation, and properties of ACID. It also addresses SQL functions and joins, as well as basic arithmetic and logic problems.

Uploaded by

aktermonalisa624
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

WellDev WCPS - Trainee Software Engineer Preparation Guide

Generated on June 09, 2025

Part A: 100 Multiple-Choice Questions

1. Which data structure uses FIFO order?

A) Stack

B) Queue

C) Tree

D) Graph

Answer: Queue

2. Which of the following is a linear data structure?

A) Tree

B) Graph

C) Array

D) Trie

Answer: Array

3. Which data structure is used in recursion?

A) Queue

B) Heap

C) Stack

D) Graph

Answer: Stack

4. What is the time complexity of binary search?

A) O(n)

B) O(log n)

C) O(n log n)

D) O(1)

Answer: O(log n)

5. Which of the following is a linear data structure?

A) Tree

B) Graph
C) Array

D) Trie

Answer: Array

6. Which data structure is used in recursion?

A) Queue

B) Heap

C) Stack

D) Graph

Answer: Stack

7. Which data structure uses FIFO order?

A) Stack

B) Queue

C) Tree

D) Graph

Answer: Queue

8. Which data structure is used in recursion?

A) Queue

B) Heap

C) Stack

D) Graph

Answer: Stack

9. Which sorting algorithm has the best average-case performance?

A) Bubble Sort

B) Insertion Sort

C) Merge Sort

D) Selection Sort

Answer: Merge Sort

10. What is the time complexity of binary search?

A) O(n)

B) O(log n)

C) O(n log n)

D) O(1)
Answer: O(log n)

11. What is the time complexity of binary search?

A) O(n)

B) O(log n)

C) O(n log n)

D) O(1)

Answer: O(log n)

12. Which data structure is used in recursion?

A) Queue

B) Heap

C) Stack

D) Graph

Answer: Stack

13. Which data structure is used in recursion?

A) Queue

B) Heap

C) Stack

D) Graph

Answer: Stack

14. What is the time complexity of binary search?

A) O(n)

B) O(log n)

C) O(n log n)

D) O(1)

Answer: O(log n)

15. Which data structure is used in recursion?

A) Queue

B) Heap

C) Stack

D) Graph

Answer: Stack

16. What is the time complexity of binary search?


A) O(n)

B) O(log n)

C) O(n log n)

D) O(1)

Answer: O(log n)

17. Which of the following is a linear data structure?

A) Tree

B) Graph

C) Array

D) Trie

Answer: Array

18. Which sorting algorithm has the best average-case performance?

A) Bubble Sort

B) Insertion Sort

C) Merge Sort

D) Selection Sort

Answer: Merge Sort

19. Which data structure is used in recursion?

A) Queue

B) Heap

C) Stack

D) Graph

Answer: Stack

20. Which data structure is used in recursion?

A) Queue

B) Heap

C) Stack

D) Graph

Answer: Stack

21. What is the time complexity of binary search?

A) O(n)

B) O(log n)
C) O(n log n)

D) O(1)

Answer: O(log n)

22. What is the time complexity of binary search?

A) O(n)

B) O(log n)

C) O(n log n)

D) O(1)

Answer: O(log n)

23. Which of the following is a linear data structure?

A) Tree

B) Graph

C) Array

D) Trie

Answer: Array

24. Which of the following is a linear data structure?

A) Tree

B) Graph

C) Array

D) Trie

Answer: Array

25. Which sorting algorithm has the best average-case performance?

A) Bubble Sort

B) Insertion Sort

C) Merge Sort

D) Selection Sort

Answer: Merge Sort

26. What is method overloading?

A) Same method name with different parameters

B) Same method in parent and child

C) Runtime polymorphism

D) None
Answer: Same method name with different parameters

27. Constructors are used to?

A) Destroy objects

B) Initialize objects

C) Overload methods

D) Inherit classes

Answer: Initialize objects

28. Private members are accessible only within?

A) Package

B) Subclass

C) Class

D) Module

Answer: Class

29. Private members are accessible only within?

A) Package

B) Subclass

C) Class

D) Module

Answer: Class

30. Which concept allows different classes to be treated as instances of the same class?

A) Encapsulation

B) Inheritance

C) Polymorphism

D) Abstraction

Answer: Polymorphism

31. What is method overloading?

A) Same method name with different parameters

B) Same method in parent and child

C) Runtime polymorphism

D) None

Answer: Same method name with different parameters

32. Encapsulation helps in?


A) Code readability

B) Code complexity

C) Data hiding

D) Data redundancy

Answer: Data hiding

33. What is method overloading?

A) Same method name with different parameters

B) Same method in parent and child

C) Runtime polymorphism

D) None

Answer: Same method name with different parameters

34. Encapsulation helps in?

A) Code readability

B) Code complexity

C) Data hiding

D) Data redundancy

Answer: Data hiding

35. Which concept allows different classes to be treated as instances of the same class?

A) Encapsulation

B) Inheritance

C) Polymorphism

D) Abstraction

Answer: Polymorphism

36. Encapsulation helps in?

A) Code readability

B) Code complexity

C) Data hiding

D) Data redundancy

Answer: Data hiding

37. Which concept allows different classes to be treated as instances of the same class?

A) Encapsulation

B) Inheritance
C) Polymorphism

D) Abstraction

Answer: Polymorphism

38. Constructors are used to?

A) Destroy objects

B) Initialize objects

C) Overload methods

D) Inherit classes

Answer: Initialize objects

39. Private members are accessible only within?

A) Package

B) Subclass

C) Class

D) Module

Answer: Class

40. Which concept allows different classes to be treated as instances of the same class?

A) Encapsulation

B) Inheritance

C) Polymorphism

D) Abstraction

Answer: Polymorphism

41. Which concept allows different classes to be treated as instances of the same class?

A) Encapsulation

B) Inheritance

C) Polymorphism

D) Abstraction

Answer: Polymorphism

42. Constructors are used to?

A) Destroy objects

B) Initialize objects

C) Overload methods

D) Inherit classes
Answer: Initialize objects

43. Constructors are used to?

A) Destroy objects

B) Initialize objects

C) Overload methods

D) Inherit classes

Answer: Initialize objects

44. Encapsulation helps in?

A) Code readability

B) Code complexity

C) Data hiding

D) Data redundancy

Answer: Data hiding

45. Private members are accessible only within?

A) Package

B) Subclass

C) Class

D) Module

Answer: Class

46. Which property of ACID ensures no partial transaction?

A) Atomicity

B) Consistency

C) Isolation

D) Durability

Answer: Atomicity

47. To find the second highest salary, which SQL function can be used?

A) MIN

B) MAX

C) LIMIT

D) Subquery with MAX

Answer: Subquery with MAX

48. Which SQL clause is used to filter results?


A) WHERE

B) GROUP BY

C) ORDER BY

D) HAVING

Answer: WHERE

49. Which SQL clause is used to filter results?

A) WHERE

B) GROUP BY

C) ORDER BY

D) HAVING

Answer: WHERE

50. Which SQL clause is used to filter results?

A) WHERE

B) GROUP BY

C) ORDER BY

D) HAVING

Answer: WHERE

51. Which diagram shows entity relationships?

A) UML

B) ER

C) DFD

D) Class

Answer: ER

52. Which property of ACID ensures no partial transaction?

A) Atomicity

B) Consistency

C) Isolation

D) Durability

Answer: Atomicity

53. Which property of ACID ensures no partial transaction?

A) Atomicity

B) Consistency
C) Isolation

D) Durability

Answer: Atomicity

54. To find the second highest salary, which SQL function can be used?

A) MIN

B) MAX

C) LIMIT

D) Subquery with MAX

Answer: Subquery with MAX

55. Which diagram shows entity relationships?

A) UML

B) ER

C) DFD

D) Class

Answer: ER

56. To find the second highest salary, which SQL function can be used?

A) MIN

B) MAX

C) LIMIT

D) Subquery with MAX

Answer: Subquery with MAX

57. To find the second highest salary, which SQL function can be used?

A) MIN

B) MAX

C) LIMIT

D) Subquery with MAX

Answer: Subquery with MAX

58. Which SQL clause is used to filter results?

A) WHERE

B) GROUP BY

C) ORDER BY

D) HAVING
Answer: WHERE

59. Which SQL clause is used to filter results?

A) WHERE

B) GROUP BY

C) ORDER BY

D) HAVING

Answer: WHERE

60. To find the second highest salary, which SQL function can be used?

A) MIN

B) MAX

C) LIMIT

D) Subquery with MAX

Answer: Subquery with MAX

61. Which property of ACID ensures no partial transaction?

A) Atomicity

B) Consistency

C) Isolation

D) Durability

Answer: Atomicity

62. Which join returns unmatched rows from the left table?

A) INNER JOIN

B) RIGHT JOIN

C) LEFT JOIN

D) FULL JOIN

Answer: LEFT JOIN

63. Which join returns unmatched rows from the left table?

A) INNER JOIN

B) RIGHT JOIN

C) LEFT JOIN

D) FULL JOIN

Answer: LEFT JOIN

64. Which join returns unmatched rows from the left table?
A) INNER JOIN

B) RIGHT JOIN

C) LEFT JOIN

D) FULL JOIN

Answer: LEFT JOIN

65. Which property of ACID ensures no partial transaction?

A) Atomicity

B) Consistency

C) Isolation

D) Durability

Answer: Atomicity

66. If a:b = 3:4 and b:c = 2:5, find a:c

A) 3:10

B) 3:5

C) 6:5

D) 2:5

Answer: 3:10

67. If a:b = 3:4 and b:c = 2:5, find a:c

A) 3:10

B) 3:5

C) 6:5

D) 2:5

Answer: 3:10

68. If a:b = 3:4 and b:c = 2:5, find a:c

A) 3:10

B) 3:5

C) 6:5

D) 2:5

Answer: 3:10

69. If a train moves at 60 km/hr for 2 hours, distance is?

A) 100 km

B) 120 km
C) 140 km

D) 160 km

Answer: 120 km

70. What is the next number in the sequence: 2, 4, 8, 16, ?

A) 24

B) 30

C) 32

D) 36

Answer: 32

71. If 5x = 20, then x = ?

A) 2

B) 3

C) 4

D) 5

Answer: 4

72. If 5x = 20, then x = ?

A) 2

B) 3

C) 4

D) 5

Answer: 4

73. If a train moves at 60 km/hr for 2 hours, distance is?

A) 100 km

B) 120 km

C) 140 km

D) 160 km

Answer: 120 km

74. If a train moves at 60 km/hr for 2 hours, distance is?

A) 100 km

B) 120 km

C) 140 km

D) 160 km
Answer: 120 km

75. Simplify: 25% of 80?

A) 15

B) 18

C) 20

D) 25

Answer: 20

76. Simplify: 25% of 80?

A) 15

B) 18

C) 20

D) 25

Answer: 20

77. If a train moves at 60 km/hr for 2 hours, distance is?

A) 100 km

B) 120 km

C) 140 km

D) 160 km

Answer: 120 km

78. Simplify: 25% of 80?

A) 15

B) 18

C) 20

D) 25

Answer: 20

79. If a train moves at 60 km/hr for 2 hours, distance is?

A) 100 km

B) 120 km

C) 140 km

D) 160 km

Answer: 120 km

80. If 5x = 20, then x = ?


A) 2

B) 3

C) 4

D) 5

Answer: 4

81. If a:b = 3:4 and b:c = 2:5, find a:c

A) 3:10

B) 3:5

C) 6:5

D) 2:5

Answer: 3:10

82. If a:b = 3:4 and b:c = 2:5, find a:c

A) 3:10

B) 3:5

C) 6:5

D) 2:5

Answer: 3:10

83. If 5x = 20, then x = ?

A) 2

B) 3

C) 4

D) 5

Answer: 4

84. If a train moves at 60 km/hr for 2 hours, distance is?

A) 100 km

B) 120 km

C) 140 km

D) 160 km

Answer: 120 km

85. Simplify: 25% of 80?

A) 15

B) 18
C) 20

D) 25

Answer: 20

86. Which device forwards packets between networks?

A) Switch

B) Hub

C) Router

D) Repeater

Answer: Router

87. What does IP stand for?

A) Internet Protocol

B) Internet Program

C) Initial Protocol

D) Internal Path

Answer: Internet Protocol

88. Which protocol is used to send email?

A) HTTP

B) SMTP

C) FTP

D) SSH

Answer: SMTP

89. Which device forwards packets between networks?

A) Switch

B) Hub

C) Router

D) Repeater

Answer: Router

90. GET and POST are types of?

A) API

B) HTTP Methods

C) Protocols

D) Encodings
Answer: HTTP Methods

91. GET and POST are types of?

A) API

B) HTTP Methods

C) Protocols

D) Encodings

Answer: HTTP Methods

92. Which layer is responsible for routing?

A) Application

B) Transport

C) Network

D) Data Link

Answer: Network

93. What does IP stand for?

A) Internet Protocol

B) Internet Program

C) Initial Protocol

D) Internal Path

Answer: Internet Protocol

94. Which device forwards packets between networks?

A) Switch

B) Hub

C) Router

D) Repeater

Answer: Router

95. What does IP stand for?

A) Internet Protocol

B) Internet Program

C) Initial Protocol

D) Internal Path

Answer: Internet Protocol

96. Which device forwards packets between networks?


A) Switch

B) Hub

C) Router

D) Repeater

Answer: Router

97. Which device forwards packets between networks?

A) Switch

B) Hub

C) Router

D) Repeater

Answer: Router

98. GET and POST are types of?

A) API

B) HTTP Methods

C) Protocols

D) Encodings

Answer: HTTP Methods

99. What does IP stand for?

A) Internet Protocol

B) Internet Program

C) Initial Protocol

D) Internal Path

Answer: Internet Protocol

100. Which layer is responsible for routing?

A) Application

B) Transport

C) Network

D) Data Link

Answer: Network
Part B: 10 Coding Problems with Solutions

1. Move all zeros to the end of an array


def move_zeros(arr):
non_zeros = [x for x in arr if x != 0]
return non_zeros + [0] * (len(arr) - len(non_zeros))

2. Find cumulative sum of an array


def cumulative_sum(arr):
for i in range(1, len(arr)):
arr[i] += arr[i - 1]
return arr

3. Check if two strings are anagrams


def is_anagram(s1, s2):
return sorted(s1) == sorted(s2)

4. Find second highest number in an array


def second_highest(arr):
return sorted(set(arr))[-2]

5. Reverse a linked list


class Node:
def __init__(self, val):
[Link] = val
[Link] = None

def reverse_list(head):
prev = None
current = head
while current:
nxt = [Link]
[Link] = prev
prev = current
current = nxt
return prev

6. Find factorial using recursion


def factorial(n):
return 1 if n == 0 else n * factorial(n-1)

7. Check for palindrome string


def is_palindrome(s):
return s == s[::-1]
8. Fibonacci number using memoization
fib_cache = {}
def fib(n):
if n in fib_cache:
return fib_cache[n]
if n <= 1:
result = n
else:
result = fib(n-1) + fib(n-2)
fib_cache[n] = result
return result

9. Zero mover problem


def zero_mover(arr):
j = 0
for i in range(len(arr)):
if arr[i] != 0:
arr[i], arr[j] = arr[j], arr[i]
j += 1
return arr

10. Find max area in histogram


def largestRectangleArea(heights):
stack, max_area = [], 0
[Link](0)
for i, h in enumerate(heights):
while stack and heights[stack[-1]] > h:
height = heights[[Link]()]
width = i if not stack else i - stack[-1] - 1
max_area = max(max_area, height * width)
[Link](i)
return max_area

You might also like