NEW
Font size
Worksheets3 rd Year Placement Test-1
Total questions: 50
Worksheet time: 2hrs 40mins
#include <stdio.h>
int main()
{
int y = 10000;
int y = 34;
printf("Hello World! %d\n", y);
return 0;
}
a) Compile time error
b) Hello World! 34
c) Hello World! 1000
d) Hello World! followed by a junk value
2 . Find the value of A[1] after execution of the following program.
int[] A = {0,2,4,1,3};
for(int i = 0; i < a.length; i++)
{
a[i] = a[(a[i] + 3) % a.length];
}
a) 1
b) 2
c) 3
d) 4
3. #include <stdio.h>
int main()
{
int main = 3;
printf("%d", main);
return 0;
}
a) It will cause a compile-time error
b) It will cause a run-time error
c) It will run without any error and prints 3
d) It will experience infinite looping
4. #include <stdio.h>
int main()
{
short int i = 20;
char c = 97;
printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i));
return 0;
}
a) 2, 1, 2
b) 2, 1, 1
c) 2, 1, 4
d) 2, 2, 8
5. #include <stdio.h>
int main()
{
int i;
for(i=0;i<5;i++);
printf("%d\n", i);
return 0;
}
a) 0 1 2 3 4
b) 5
c)0 1 2 3 4 5
d) 4
6. #include <stdio.h>
int const print()
{
printf("PSNACET");
return 0;
}
void main()
{
print();
}
a) Error
b) TECANSP
c) PSNACET is printed infinite times
d) PSNACET
7. Identify the Missing line.
int fact(int n)
{
if(n=0)
return 1;
else
___________________
}
a) return n*fact(n/1);
b) return n*fact(n-1);
c) return n*fact(n*1);
d) return n*fact(n+1);
8. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted
9. What will be the value of the following Python expression?
4 + 3 % 5
a) 7
b) 2
c) 4
d) 1
10.x = ['XX', 'YY']
for i in a:
i.lower()
print(a)
a) ['XX', 'YY']
b) ['xx', 'yy']
c) [XX, yy]
d) None of these
11.Which keyword is used for function in Python language?
a) Function
b) def
c) Fun
d) Define
12. What will be the output of the following Python code?
i = 1
while True:
if i%3 == 0:
break
print(i)
i + = 1
a) 1 2 3
b) error
c) 1 2
d) none of the mentioned
13. What are the values of the following Python expressions?
2**(3**2)
(2**3)**2
2**3**2
a) 512, 64, 512
b) 512, 512, 512
c) 64, 512, 64
d) 64, 64, 64
14. Banker's algorithm is used?
a) To prevent deadlock
b) To deadlock recovery
c) To solve the deadlock
d) None of these
15. Which scheduling algorithm ensures that each process gets an equal amount of CPU time in a round-robin manner?
a) First-Come, First-Served (FCFS)
b) Shortest Job Next (SJN)
c) Round Robin (RR)
d) Priority Scheduling
16. Which technique is used to prevent multiple processes from accessing shared resources simultaneously?
a) Context Switching
b) Mutual Exclusion
c) Deadlock Detection
d) Disk Scheduling
17. Which memory management technique allows the operating system to allocate memory blocks of different sizes based on the process's requirements?
a) Paging
b) Segmentation
c) Swapping
d) Fragmentation
18. Which type of operating system allows multiple users to access and use the system simultaneously?
a) Single-User Operating System
b) Multi-User Operating System
c) Real-Time Operating System
d) Batch Operating System
19. Which mechanism is used to transform logical addresses into physical addresses in virtual memory management?
a) Address Translation
b) Page Replacement
c) Page Fault
d) Cache Memory
20. Which process scheduling algorithm selects the process with the highest priority for execution?
a) Shortest Job Next (SJN)
b) First-Come, First-Served (FCFS)
c) Priority Scheduling
d) Round Robin (RR)
21. Which deadlock avoidance algorithm requires information about the maximum number of resources each process may need to complete execution?
a) Banker's Algorithm
b) Round Robin Algorithm
c) First-Come, First-Served (FCFS) Algorithm
d) Least Recently Used (LRU) Algorithm
22. Which of the following data structures stores elements in a Last-In-First-Out (LIFO) order?
a) Queue
b) Stack
c) Tree
d) Hash Table
23. Which data structure allows efficient retrieval, insertion, and deletion of elements in logarithmic time complexity?
a) Array
b) Linked List
c) Heap
d) Binary Search Tree
24. In which data structure are elements stored in a sorted manner?
a) Queue
b) Stack
c) Heap
d) Binary Search Tree
25. Which data structure uses both the properties of an array and a linked list?
a) Stack
b) Queue
c) Hash Table
d) Doubly Linked List
26. Which one of the following is the overflow condition if linear queue is implemented using an array with a size MAX_SIZE?
a) rear = front
b) rear = front+1
c) rear=MAX_SIZE -1
d) rear = MAX_SIZE
27. The Worst case and Best case time complexity of Linear search algorithm is
a) O(n), Ω (log n)
b) O(log n), Ω (1)
c) O(n), Ω (1)
d) O(1), O (log n)
28. Which of the following is the infix expression?
a. A+B*C
b) +A*BC
c) ABC+*
d) None of the above
29. What is encapsulation in object-oriented programming?
a) Process of creating multiple instances of a class
b) Binding of data and methods into a single unit
c) Ability of an object to take multiple forms
d) Ability to create a new class from an existing class
30. Which OOP concept allows a class to inherit properties and behavior from another class?
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
31. What is the purpose of abstraction in object-oriented programming?
a) Hiding implementation details and showing only essential information
b) Defining multiple methods with the same name but different parameters
c) Combining data and methods into a single unit
d) Creating multiple instances of a class
32. Which OOP concept allows a class to have multiple methods with the same name but different parameters?
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
33. Which OOP concept defines the blueprint or template for creating objects?
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
34. Which OOP concept combines data and methods into a single unit?
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
35. Which type of key uniquely identifies each tuple (row) in a relational database table?
a) Primary Key
b) Foreign Key
c) Candidate Key
d) Super Key
36. Which SQL statement is used to retrieve data from a database table?
a) INSERT
b) DELETE
c) SELECT
d) UPDATE
37. Which normal form in database design eliminates functional dependencies on partial keys?
a) First Normal Form (1NF)
b) Second Normal Form (2NF)
c) Third Normal Form (3NF)
d) Boyce-Codd Normal Form (BCNF)
38.Which algorithmic paradigm is based on solving a problem by dividing it into smaller subproblems, solving each subproblem recursively, and combining the solutions?
a) Dynamic Programming
b) Greedy Algorithms
c) Divide and Conquer
d) Backtracking
39. Which sorting algorithm has an average-case time complexity of O(n log n) and works by repeatedly dividing the input into smaller subarrays?
a) Bubble Sort
b) Insertion Sort
c) Merge Sort
d) Quick Sort
40. Which algorithm is used to find the shortest path between nodes in a graph with non-negative edge weights?
a) Dijkstra's Algorithm
b) Bellman-Ford Algorithm
c) Depth-First Search (DFS)
d) Breadth-First Search (BFS)
41. Which sorting algorithm works by repeatedly selecting the smallest element from the unsorted portion of the array and moving it to the beginning?
a) Bubble Sort
b) Insertion Sort
c) Merge Sort
d) Selection Sort
42. A can do a work in 14 days and working together A and B can do the same work in 10 days. In what time can B alone do the work?
a. 25 days
b. 30 days
c. 23 days
d. 35 days
43. Manu, Manju and Maya can do a work in 90, 30 and 45 days respectively. If they work together, in how many days will they complete work?
a. 15
b. 10
c. 20
d. 25
44. A’s salary is 50% more than B’s. How much percent is B’s salary less than A’s?
a. 33(1/4)%
b. 33(1/3)%
c. 33(1/2)%
d. 33%
45. Ramesh’s salary was reduced by 10% and then the reduced salary was increased by 10%. What was his ultimate loss?
a. 0%
b. 10%
c. 1%
d. 5%
46. In a country 55% population is female. 80% of the male population is literate. How much of females are literate if total literacy is 58%?
a. 45%
b. 55%
c. 40%
d. 22%
47. SCD, TEF, UGH, ____, WKL
a.CMN
b.UJI
c.VIJ
d.IJT
48. Look at this series: 12, 11, 13, 12, 14, 13, … What number should come next?
A. 10
B. 16
C. 13
D. 15
49. Look at this series: 2, 1, (1/2), (1/4), … What number should come next?
A. (1/3)
B. (1/8)
C. (2/8)
D. (1/16)
50. Which word does NOT belong with the others?
A. index
B. glossary
C. chapter
D. book
