Cadet College Lecturer Exam 11 May 2025 — Question Solution | ক্যাডেট কলেজ প্রভাষক নিয়োগ পরীক্ষা ২০২৫ — প্রশ্ন সমাধান
- Cadet College
- Lecturer
- 11 May 2025
- 10 questions · 0 MCQ, 10 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The Cadet College Lecturer exam was held on 11 May 2025. The paper had 10 written questions. The subjects asked most were Programming (3), Digital Logic (2) and Operating Systems (2). 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
- Cadet College
- Post
- Lecturer
- Exam date
- 11 May 2025
- Questions
- 10 (0 MCQ, 10 written)
- Exam guide
- ICT teaching posts (NTRCA) · আইসিটি শিক্ষক পদ (এনটিআরসিএ)
(a) An organization wants to divide its LAN IP address 192.168.0.0/24 into 4 subnets according to buildings. The buildings' IP address criteria are given below.
| Building block | Hosts need |
|---|---|
| A | 110 |
| B | 50 |
| C | 20 |
| D | 8 |
Calculate the network and broadcast address of this network for each building block.
(b) Explain the TCP/IP protocol suite layers.
Write a C++ program with a class 'student' that has three attributes: name, roll, and marks. Use a get method to input data for two objects. Then, find the student with the highest marks and print that student's name.
Find out the output of this program.
for (int i= 5; i>=1; i--) {
for (int j=1; j<=i; j++) {
printf("%3d", j);
}
}
(a) Design a full adder circuit and draw the diagram.
(b) Draw the X-OR and X-NOR gate truth table diagram.
Sign up free to see the model answers to written questions 1–4 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
(a) Define RDBMS. Explain the different keys in DBMS: primary key, candidate key, super key and foreign key.
(b) Draw the 8-3 encoder logic diagram.
Model answer
(a) RDBMS and keys
RDBMS (Relational Database Management System) is software that stores data as relations (tables) of rows (tuples) and columns (attributes), links tables through keys, lets users define and manipulate data with SQL, and enforces integrity constraints and ACID transactions. Examples: MySQL, Oracle, PostgreSQL, SQL Server.
A key is an attribute or set of attributes used to identify rows uniquely or to relate one table to another.
Example table: Student(roll, name, email, nid, dept_id) where roll, email and nid are each unique.
| Key | Definition | Example |
|---|---|---|
| Super key | Any set of attributes whose values uniquely identify each row; it may contain extra attributes | {roll}, {roll, name}, {email, dept_id} |
| Candidate key | A minimal super key: no attribute can be removed without losing uniqueness | {roll}, {email}, {nid} |
| Primary key | The one candidate key chosen as the main identifier; unique and NOT NULL; only one per table | roll |
| Alternate key | A candidate key not chosen as primary key | email, nid |
| Foreign key | Attribute(s) in one table that refer to the primary (or a unique) key of another table, enforcing referential integrity; may repeat and may be NULL | Student.dept_id → Department.dept_id |
| Composite key | A key made of two or more attributes | (roll, course_code) in Enrollment |
Relationship: Primary key ⊆ Candidate keys ⊆ Super keys. Every candidate key is a super key, but not every super key is a candidate key.
erDiagram
DEPARTMENT ||--o{ STUDENT : "has"
DEPARTMENT {
int dept_id PK
string dept_name
}
STUDENT {
int roll PK
string name
string email
string nid
int dept_id FK
}
(b) 8-to-3 encoder (octal-to-binary)
An encoder has 2ⁿ inputs and n outputs; exactly one input is HIGH at a time and the outputs give its binary code. Inputs: D0–D7; outputs: A2 A1 A0.
Truth table
| Active input | A2 | A1 | A0 |
|---|---|---|---|
| D0 | 0 | 0 | 0 |
| D1 | 0 | 0 | 1 |
| D2 | 0 | 1 | 0 |
| D3 | 0 | 1 | 1 |
| D4 | 1 | 0 | 0 |
| D5 | 1 | 0 | 1 |
| D6 | 1 | 1 | 0 |
| D7 | 1 | 1 | 1 |
Output equations (an output is 1 for every input whose code has a 1 in that bit):
- A2 = D4 + D5 + D6 + D7
- A1 = D2 + D3 + D6 + D7
- A0 = D1 + D3 + D5 + D7
Logic diagram: three 4-input OR gates; D0 is not connected, because it produces 000.
flowchart LR
D1([D1]) --> G0
D3([D3]) --> G0
D5([D5]) --> G0
D7([D7]) --> G0
D2([D2]) --> G1
D3 --> G1
D6([D6]) --> G1
D7 --> G1
D4([D4]) --> G2
D5 --> G2
D6 --> G2
D7 --> G2
G0["4-input OR"] --> A0((A0))
G1["4-input OR"] --> A1((A1))
G2["4-input OR"] --> A2((A2))
D0(["D0: not connected"])
Check: D5 = 1 → A2 = 1, A1 = 0, A0 = 1 → 101₂ = 5. ✓
Limitations: if two inputs are HIGH together the output is wrong (D3 + D5 gives 111), and D0 = 1 cannot be told apart from "no input". A priority encoder adds input priority and a valid-output bit to solve this.
Exam tip: write the OR equations from the truth table first; the diagram is simply one OR gate per output bit.
(a) Define operating system. Why is a resource allocation graph used for deadlock detection?
(b) Define network topology and classify it.
Difference between a while loop and do-while loop.
Consider the set of 3 processes whose arrival time and burst time are given below-
| Process | AT | BT |
|---|---|---|
| P1 | 0 | 5 |
| P2 | 1 | 4 |
| P3 | 2 | 2 |
If the CPU scheduling policy is round robin with time quantum=2, find out the completion time, turnaround time, waiting time, and response time.
(a) Convert the following number:
i. Decimal number 9 to binary number.
ii. Octal number 2671 to decimal number.
iii. Octal number 756 to hexadecimal number.
(b) Write down the selection sort algorithm. Find out the best case, average case, and worst case time complexity.
Sign up free to see the model answers to written questions 6–9 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explain the push and pop operations of the stack.
Model answer
A stack is a linear data structure in which insertion and deletion take place at one end only, called the top. The element pushed last is the first one popped, so a stack follows LIFO (Last-In-First-Out). In a 0-based array of size MAX, an integer top stores the index of the top element: top = -1 means the stack is empty and top = MAX - 1 means it is full.
Push(x): insert x on top
- If
top == MAX - 1, report Overflow and stop (no free slot). top = top + 1.stack[top] = x.
Pop(): remove and return the top element
- If
top == -1, report Underflow and stop (nothing to remove). x = stack[top].top = top - 1, then return x.
flowchart TD
subgraph PUSH ["Push(x)"]
A1{"top == MAX - 1 ?"} -->|"Yes"| A2["Overflow"]
A1 -->|"No"| A3["top = top + 1"] --> A4["stack[top] = x"]
end
subgraph POP ["Pop()"]
B1{"top == -1 ?"} -->|"Yes"| B2["Underflow"]
B1 -->|"No"| B3["x = stack[top]"] --> B4["top = top - 1, return x"]
end
Program (C), with a capacity of 3 so that both error cases appear:
#include <stdio.h>
#define MAX 3 /* small capacity so that overflow can be shown */
int stack[MAX];
int top = -1; /* -1 means the stack is empty */
/* Push x; returns 1 on success, 0 on overflow */
int push(int x) {
if (top == MAX - 1) { /* every slot is already used */
printf("push(%d): Overflow\n", x);
return 0;
}
stack[++top] = x; /* move top up first, then store */
printf("push(%d): top = %d\n", x, top);
return 1;
}
/* Pop into *out; returns 1 on success, 0 on underflow */
int pop(int *out) {
if (top == -1) { /* nothing to remove */
printf("pop(): Underflow\n");
return 0;
}
*out = stack[top--]; /* read the top first, then move top down */
printf("pop(): %d removed, top = %d\n", *out, top);
return 1;
}
int main(void) {
int v;
pop(&v); /* empty stack */
push(7);
push(18);
push(25);
push(31); /* stack is full */
pop(&v);
pop(&v);
push(42); /* reuses the freed slot 1 */
printf("Stack (bottom to top):");
for (int i = 0; i <= top; i++)
printf(" %d", stack[i]);
printf("\n");
return 0;
}
Output
pop(): Underflow
push(7): top = 0
push(18): top = 1
push(25): top = 2
push(31): Overflow
pop(): 25 removed, top = 1
pop(): 18 removed, top = 0
push(42): top = 1
Stack (bottom to top): 7 42
Trace
| Operation | Result | top | Stack (bottom → top) |
|---|---|---|---|
| pop() | Underflow | −1 | empty |
| push(7) | stored | 0 | 7 |
| push(18) | stored | 1 | 7, 18 |
| push(25) | stored | 2 | 7, 18, 25 |
| push(31) | Overflow | 2 | 7, 18, 25 |
| pop() | returns 25 | 1 | 7, 18 |
| pop() | returns 18 | 0 | 7 |
| push(42) | stored in slot 1 | 1 | 7, 42 |
Complexity: push and pop are both O(1), because only top changes and no other element is shifted; the array needs O(MAX) space.
Linked-list version: push inserts a new node at the head and pop deletes the head node, both O(1). Underflow occurs when head == NULL; there is no fixed-size overflow (only when memory allocation fails).
Uses: function calls and recursion, undo in editors, infix-to-postfix conversion and postfix evaluation, bracket matching, backtracking (DFS).
Exam tip: with top = -1 for an empty stack, push is "check overflow → ++top → store" and pop is "check underflow → read → top--"; storing before incrementing would write to stack[-1].
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
8 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ৮টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 10 syllabus chapters; Language Basics & Syntax, OSI & TCP/IP Models and ER Model & Design lead, with 1 each. Language Basics & Syntax is asked in 122 other papers too (2015–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- Language Basics & Syntax Programming · 122 other papers, 2015–20261
- OSI & TCP/IP Models Networking · 112 other papers, 2012–20261
- ER Model & Design Database · 101 other papers, 2015–20261
- Object-Oriented Programming Programming · 88 other papers, 2015–20261
- Control Flow & Loops Programming · 76 other papers, 2015–20261
- Number Systems & Codes Digital Logic · 55 other papers, 2015–20261
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 Cadet College Lecturer exam (2025)?
- 10 written questions.
- Which subjects were asked most in the Cadet College Lecturer exam (2025)?
- Programming (3), Digital Logic (2) and Operating Systems (2), out of 10 questions.
- When was the Cadet College Lecturer exam held?
- On 11 May 2025.
- Where can I find the Cadet College Lecturer exam (2025) question solution?
- On this page: 2 of the 10 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