46th BCS Technical, Written (CSE-971), Time: 4 hours, Full Marks: 200, Exam 2025 — Question Solution | বিসিএস নিয়োগ পরীক্ষা ২০২৫ — প্রশ্ন সমাধান
- BCS
- 2025
- 9 questions · 0 MCQ, 9 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The 46th BCS Technical, Written (CSE-971), Time: 4 hours, Full Marks: 200, exam was held in 2025. The paper had 9 written questions. The subjects asked most were Algorithms (1), Data Structures (1) and Database (1). This page lists every question, with 2 answered and explained; the rest of the answers open with a free ARBS Academy account, where the paper can also be practised as a timed test.
বিসিএস নিয়োগ পরীক্ষার (২০২৫) এই প্রশ্নপত্রে ৯টি প্রশ্ন ছিল, বেশিরভাগ অ্যালগরিদম ও ডেটা স্ট্রাকচার থেকে। এখানে ২টি প্রশ্নের ব্যাখ্যাসহ উত্তর দেওয়া আছে; বাকিগুলো ফ্রি অ্যাকাউন্টে খোলে।
- Organisation
- BCS
- Exam date
- 2025
- Questions
- 9 (0 MCQ, 9 written)
- Exam guide
- BCS (ICT and CSE cadre) · বিসিএস (আইসিটি ও সিএসই ক্যাডার)
(a) Mention two basic differences between 'call by value' and 'call by Reference'. Write a program in c/c++ Programming language to swap two integer values using 'call by Reference'.
(b) Consider the following code snippet in a C like Programming language-
int a = 5, b = 18, c = 27;
a = b++ +++c;
b = a++ C--;
C=a++ + b--;
What will be the output of a, b, and c after execution of the above statements? Explain your answer.
(c) What is polymorphism? Write a Java program to demonstrate the compile time and run time polymorphisms.
(d) What is Just In Time (JIT) compiler? How does it support machine independent programming?
Model answer
(a) Call by value vs call by reference
| Aspect | Call by value | Call by reference |
|---|---|---|
| What is passed | A copy of the argument's value | The address (or an alias) of the actual variable |
| Effect on caller | Changes inside the function do not affect the original | Changes made through the reference do change the original |
| Memory | A separate copy is created | The same memory location is shared |
Swap using call by reference (C, pointers):
#include <stdio.h>
void swap(int *a, int *b) { /* a, b hold the ADDRESSES of x, y */
int temp = *a;
*a = *b;
*b = temp;
}
int main(void) {
int x = 5, y = 10;
printf("Before swap: x = %d, y = %d\n", x, y);
swap(&x, &y); /* pass addresses */
printf("After swap : x = %d, y = %d\n", x, y);
return 0;
}
Output
Before swap: x = 5, y = 10
After swap : x = 10, y = 5
swap works on *a and *b, which are x and y themselves, so the exchange survives the return. (In C++ the same is written void swap(int &a, int &b) and called swap(x, y).)
(b) Values of a, b and c
As printed, the snippet does not compile in C:
b++ +++c: the compiler takes the longest possible token each time (maximal munch), so it readsb ++ ++ + c, that is(b++)++ + c.b++produces a value, not a variable, so applying++to it is an error ("lvalue required as increment operand").a++ C--: there is no operator between the two operands, which is a syntax error.C(capital) is undeclared: C is case-sensitive, and onlycexists.
The intended statements are a = b++ + ++c;, b = a++ − c--; and c = a++ + b--; (the operator in line 2 is missing in print; the minus reading is used below, and the plus reading is given after the table).
Rules: x++ / x-- (postfix) use the old value, then change x; ++x (prefix) changes x first and uses the new value. Each statement changes each variable only once, so the behaviour is well defined.
| Statement | Working | a | b | c |
|---|---|---|---|---|
| start | 5 | 18 | 27 | |
a = b++ + ++c; |
18 + 28 = 46; then b → 19 (c already 28) | 46 | 19 | 28 |
b = a++ − c--; |
46 − 28 = 18; then a → 47, c → 27 | 47 | 18 | 27 |
c = a++ + b--; |
47 + 18 = 65; then a → 48, b → 17 | 48 | 17 | 65 |
Output: a = 48, b = 17, c = 65.
If the missing operator in line 2 is +: b = 46 + 28 = 74 (a → 47, c → 27), then c = 47 + 74 = 121 with a → 48 and b → 73, giving a = 48, b = 73, c = 121.
(c) Polymorphism in Java
Polymorphism means one name or interface taking many forms.
- Compile-time (static) polymorphism = method overloading: same method name, different parameter lists; the compiler chooses the version.
- Run-time (dynamic) polymorphism = method overriding: a subclass redefines a superclass method with the same signature; the JVM chooses the version from the actual object (dynamic method dispatch).
class Printer { // compile-time polymorphism
void show(int a) { System.out.println("int: " + a); }
void show(double a) { System.out.println("double: " + a); }
void show(String s, int n) { System.out.println("String+int: " + s + " " + n); }
}
class Animal { // run-time polymorphism
void sound() { System.out.println("Animal makes a sound"); }
}
class Dog extends Animal {
@Override void sound() { System.out.println("Dog barks"); }
}
class Cat extends Animal {
@Override void sound() { System.out.println("Cat meows"); }
}
public class PolyDemo {
public static void main(String[] args) {
Printer p = new Printer();
p.show(10); // chosen by compiler
p.show(2.5);
p.show("Total", 3);
Animal a; // superclass reference
a = new Dog(); a.sound(); // chosen by JVM at run time
a = new Cat(); a.sound();
}
}
Output
int: 10
double: 2.5
String+int: Total 3
Dog barks
Cat meows
(d) Just-In-Time (JIT) compiler
A JIT compiler is part of a runtime such as the JVM (or .NET CLR) that translates intermediate bytecode into native machine code while the program is running, usually for frequently executed ("hot") methods, and caches that code so later calls run at native speed.
graph LR
S["Source (.java)"] --> C[javac]
C --> B["Bytecode (.class) - same for all machines"]
B --> J1["JVM + JIT on Windows x86-64"]
B --> J2["JVM + JIT on Linux ARM"]
J1 --> N1[Native x86-64 code]
J2 --> N2[Native ARM code]
How it supports machine-independent programming
- The program is compiled once into machine-independent bytecode ("write once, run anywhere").
- Each platform has its own JVM; its JIT does the machine-specific translation at run time, so the same
.classfile runs anywhere without recompiling. - The JIT avoids the slowness of pure interpretation and can optimise for the actual CPU and observed run-time behaviour (inlining hot methods, for example).
Exam tip: postfix means "use, then change" and prefix means "change, then use"; overloading is compile-time and overriding is run-time polymorphism; bytecode gives portability and the JIT gives speed.
(a) Convert the numbers (16A.6)₁₆ and (72.3)₈ in binary format and show their summation in Hexadecimal format.
(b) Explain properties of universal gates. How an XOR gate can be implemented using NAND gates? Explain with the appropriate figures.
(c) Simplify the following circuit: F=A'B'C + AB'C + ABC' + ABC
(d) Draw the circuit diagram of a mod-12 ripple counter and explain its operation.
(a) Consider you are given two sets- A= {2, 3, 5, 9}, B = {5, 7, 9, 11}; What will be the output for the following set operations?
(i) A∪B
(ii) A∩B
(iii) A-B
(b) What is interpolation? Why it is required in engineering?
(c) What are absolute error and relative error? Describe them with an example.
(d) Solve the following system using Gauss-Jordan method:
2X₁ + 4X₂ − 6X₃ = −8
X₁ + 3X₂ + X₃ = 10
2X₁ − 4X₂ − 2X₃ = −12
(e) Consider that a bakery produces 10 different types of cookies. If you want to make boxes with 6 different types of cookies, in how many ways, you can make such boxes?
Sign up free to see the model answers to written questions 2–3 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
(a) Differentiate between linear and non-linear data structures. Explain their use cases.
(b) Consider a 2-D array, A stored with row-major organization. If its base address starts with value 1000, and every element of that array requires 4 bytes of space, answer the following questions:
(i) Write a formula to calculate the address of the element A[i][j], where i is row and j is column.
(ii) What will be the address of the element if i = 2 and j = 3 in a 5 x 8 array.
(iii) Transform the equation if the array is organized in the column-major way.
(c) Construct an expression tree for the following expression: (a+b)/(a*b-c)+d
(d) Construct a min-heap for the following array of numbers.
| 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| 7 | 2 | 9 | 4 | 5 | 3 |
Model answer
(a) Linear vs non-linear data structures
A linear data structure stores elements in a sequence: every element except the first and last has exactly one predecessor and one successor. A non-linear data structure stores elements in a hierarchy or network: an element can be connected to several others.
| Aspect | Linear | Non-linear |
|---|---|---|
| Arrangement | sequential, single level | hierarchical or network, many levels |
| Neighbours | one predecessor, one successor | one parent, many children (tree); many neighbours (graph) |
| Traversal | all elements in one run | needs special orders (pre/in/postorder, BFS, DFS) |
| Memory | often contiguous (array) or a simple chain | linked nodes with several pointers |
| Implementation | simple | more complex |
| Examples | array, linked list, stack, queue | tree, binary search tree, heap, graph |
Use cases
- Linear: array for marks of a class or a lookup table; stack for function calls, undo and expression evaluation; queue for print jobs and CPU scheduling; linked list for playlists and dynamic records.
- Non-linear: tree for file systems, organisation charts and database indexes (B-tree); heap for priority queues; graph for road maps, computer networks, social networks and shortest-route finding.
(b) Address calculation, base B = 1000, w = 4 bytes
Let the array have m rows and n columns, with indices starting at 0.
(i) Row-major (rows stored one after another; i full rows of n elements come before row i):
Address(A[i][j]) = B + w × (i × n + j)
General form, when the first row index is lr and the first column index is lc:
Address(A[i][j]) = B + w × [(i − lr) × n + (j − lc)]
(ii) 5 × 8 array, so m = 5, n = 8; i = 2, j = 3:
Address(A[2][3]) = 1000 + 4 × (2 × 8 + 3) = 1000 + 4 × 19 = 1000 + 76 = 1076
(If rows and columns are numbered from 1: 1000 + 4 × [(2 − 1) × 8 + (3 − 1)] = 1000 + 4 × 10 = 1040.)
(iii) Column-major (columns stored one after another; j full columns of m elements come before column j):
Address(A[i][j]) = B + w × (j × m + i)
General form: Address(A[i][j]) = B + w × [(j − lc) × m + (i − lr)]
For the same element: 1000 + 4 × (3 × 5 + 2) = 1000 + 68 = 1068.
(c) Expression tree for (a+b)/(a*b-c)+d
The operator applied last becomes the root. Here the outer + (adding d) is applied last; its left operand is (a+b)/(a*b−c), whose root is /; the left child of / is (a+b) and the right child is (ab−c), whose root is − with children ab and c.
graph TD
r(("+")) --> dv(("/"))
r --> d((d))
dv --> p(("+"))
dv --> m(("-"))
p --> a1((a))
p --> b1((b))
m --> t(("*"))
m --> c((c))
t --> a2((a))
t --> b2((b))
Check: postorder of the tree = a b + a b * c - / d +; preorder = + / + a b - * a b c d; inorder with brackets gives back the original expression.
(d) Min-heap for 7, 2, 9, 4, 5, 3
Insert each value at the next free position (level by level, left to right) and swap it with its parent while it is smaller than the parent.
| Insert | Swaps | Heap (array) |
|---|---|---|
| 7 | none | 7 |
| 2 | 2 ↔ 7 | 2, 7 |
| 9 | none (9 > 2) | 2, 7, 9 |
| 4 | 4 ↔ 7; 4 > 2 stop | 2, 4, 9, 7 |
| 5 | none (5 > 4) | 2, 4, 9, 7, 5 |
| 3 | 3 ↔ 9; 3 > 2 stop | 2, 4, 3, 7, 5, 9 |
graph TD
h2((2)) --> h4((4))
h2 --> h3((3))
h4 --> h7((7))
h4 --> h5((5))
h3 --> h9((9))
Final min-heap array: [2, 4, 3, 7, 5, 9] (children of index k are at 2k + 1 and 2k + 2). Bottom-up heapify of the same array gives the same heap here.
Exam tip: in row-major the row index is multiplied by the number of columns; in column-major the column index is multiplied by the number of rows.
(a) Differentiate between microprocessor and microcontroller.
(b) What is an addressing mode? Describe the following addressing modes:
(i) Immediate (ii) Direct (iii) Indirect (iv) Register (v) Indexed
(c) Draw the organization of the cache memory in a microprocessor system. Explain how it speeds up the execution process of instructions of a computer program.
(d) Compare and contrast among lexical analysis, syntax analysis and semantic analysis.
(a) Analyze the time and space complexity of the following code snippet:
for i in N:
for j in M:
print (i,j)
(b) What are the required properties to apply dynamic programming? Consider you are given a set of coins of different denominations and an amount in integer. Write an algorithm using dynamic programming that calculates how many coins can make the given amount? If you can not make the amount, the algorithm outputs -1. for example - Coins = {1, 2, 5}, Amount = 11, Output = 3, Explanation: Coin 5+5+1 can make 11.
(c) Find the minimum spanning tree of the following graph using Prim's algorithm:
graph LR
a((a)) -- 4 --- b((b))
a -- 8 --- h((h))
b -- 8 --- c((c))
b -- 11 --- h
c -- 7 --- d((d))
d -- 9 --- e((e))
d -- 14 --- f((f))
e -- 10 --- f
h -- 7 --- i((i))
i -- 6 --- g((g))
h -- 1 --- g
g -- 2 --- f
(a) Differentiate between process and thread.
(b) Draw and explain the process state transition diagram of an operating system.
(c) What is deadlock in an operating system? What are the four necessary and sufficient conditions behind a deadlock?
(d) Consider that the following processes appeared according to the table below:
| Process | Burst time (ms) | Priority |
|---|---|---|
| P₁ | 10 | 3 |
| P₂ | 5 | 3 |
| P₃ | 3 | 4 |
| P₄ | 2 | 1 |
| P₅ | 1 | 2 |
Considering the given information, produce Gantt charts for the following schedules –
(i) FCFS (ii) Non-preemptive (low value means higher priority) (iii) RR (Quantum value = 1)
(a) What is a DBMS? Explain the advantages and disadvantages of DBMS.
(b) Why do we use a trigger? Write a trigger that inserts the timestamp in another table as soon as an insert or update is done in a table.
(c) Consider the schema -
employee (id, name, salary),
equipment (id, name, price),
hire (employee-id, equipment-id),
(i) Draw the ER diagram for the above.
(ii) Write the SQL query to show the name of the employee who hired the maximum number of equipment.
(d) Compare and contrast among the following normalization: 2NF, 3NF and BCNF.
(a) Describe the TCP/IP model.
(b) Given IP address: 172.16.128.120/25, what is the subnet mask, network address, broadcast address and total useable hosts in this network?
(c) Differentiate between Switch and Router. If you need to block a particular site in your network, which device can be used for this purpose?
(d) What is SDLC? List the stages involved in the SDLC process. Which stage ensures the user acceptance of the system?
Sign up free to see the model answers to written questions 5–9 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
7 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ৭টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 8 syllabus chapters; OSI & TCP/IP Models, ER Model & Design and Functions & Recursion lead, with 1 each. OSI & TCP/IP Models is asked in 112 other papers too (2012–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- OSI & TCP/IP Models Networking · 112 other papers, 2012–20261
- ER Model & Design Database · 101 other papers, 2015–20261
- Functions & Recursion Programming · 60 other papers, 2016–20261
- Number Systems & Codes Digital Logic · 55 other papers, 2015–20261
- Processes & Threads Operating Systems · 55 other papers, 2011–20261
- 8085/8086 Architecture Microprocessor · 36 other papers, 2011–20251
From our own past papers: each question filed under one syllabus chapter. Practice and held questions are not counted.
Questions about this paper · সাধারণ প্রশ্ন
- How many questions were in the 46th BCS Technical, Written (CSE-971), Time: 4 hours, Full Marks: 200, exam (2025)?
- 9 written questions.
- Which subjects were asked most in the 46th BCS Technical, Written (CSE-971), Time: 4 hours, Full Marks: 200, exam (2025)?
- Algorithms (1), Data Structures (1) and Database (1), out of 9 questions.
- When was the 46th BCS Technical, Written (CSE-971), Time: 4 hours, Full Marks: 200, exam held?
- In 2025. The exact day isn't in our records.
- Where can I find the 46th BCS Technical, Written (CSE-971), Time: 4 hours, Full Marks: 200, exam (2025) question solution?
- On this page: 2 of the 9 questions are shown with worked answers. The rest of the answers open with a free ARBS Academy account, where the paper can also be practised as a timed test.
Question text is from the public recruitment exam; answers and explanations are written by ARBS Academy. All past papers