Previous Year Questions
Admission syllabusComputer Science and Engineering
430 questions16. Department(DeptID, DeptName), Employees(Name, DeptID, Salary)
- সব department-এর average salary বের কর।
- Salary 50000-এর বেশি এমন employee-এর name ও department দেখাও।
Answer & solution / উত্তর ও সমাধান
সব department, এমনকি employee না থাকা department-ও দেখাতে LEFT JOIN ব্যবহার করা হয়েছে।
SELECT d.DeptID, d.DeptName, AVG(e.Salary) AS AverageSalary
FROM Department AS d
LEFT JOIN Employees AS e ON e.DeptID = d.DeptID
GROUP BY d.DeptID, d.DeptName;
SELECT e.Name, d.DeptName
FROM Employees AS e
JOIN Department AS d ON d.DeptID = e.DeptID
WHERE e.Salary > 50000;Employee না থাকলে average NULL; সেটি শূন্য salary বোঝায় না।
17. Decoder কী? NAND Gate ব্যবহার করে 2-input Decoder Design কর।
Answer & solution / উত্তর ও সমাধান
Decoder n-bit input থেকে সর্বোচ্চ \(2^n\)টি output নির্বাচন করে। NAND-only 2-to-4 decoder-এর output active-low।
\[\bar A=\operatorname{NAND}(A,A),\quad\bar B=\operatorname{NAND}(B,B)\]
\[Y_0=\overline{\bar A\bar B},\quad Y_1=\overline{\bar AB},\quad Y_2=\overline{A\bar B},\quad Y_3=\overline{AB}\]
| A | B | Y0 | Y1 | Y2 | Y3 |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 0 |
Active-high output চাইলে প্রতিটি output-কে আরেকটি tied-input NAND দিয়ে invert করতে হবে।
18. Circuit থেকে Rt, It, P, Vr2 বের কর

Answer & solution / উত্তর ও সমাধান
\[R_a=2\parallel3=\frac{2\times3}{2+3}=\frac65\,\Omega\]
\[R_b=4+R_a=\frac{26}{5}\,\Omega,\qquad R_p=2\parallel R_b=\frac{13}{9}\,\Omega\]
\[R_t=4+R_p=\boxed{\frac{49}{9}\,\Omega\approx5.444\,\Omega}\]
\[I_t=\frac{12}{49/9}=\boxed{\frac{108}{49}\,\mathrm A\approx2.204\,\mathrm A}\]
\[P=12I_t=\boxed{26.449\,\mathrm W},\quad V_{R_2}=I_tR_p=\boxed{\frac{156}{49}\,\mathrm V\approx3.184\,\mathrm V}\]
1. What are the advantages of using inheritance in C++ programming? Write a program in C/C++ to print the following number pattern: [C++ programming এ inheritance এর সুবিধাগুলো কি কি? C/C++ এ একটি প্রোগ্রাম লিখো যা নীচের নম্বর প্যাটার্ন প্রিন্ট করবে।] (4+10)
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Answer & solution / উত্তর ও সমাধান
Inheritance existing class-এর reusable behavior, extension এবং substitutable derived types তৈরি করতে সাহায্য করে।
#include <iostream>
int main() {
for (int i = 1; i <= 5; ++i) {
for (int j = 1; j <= i; ++j)
std::cout << j << (j == i ? '\n' : ' ');
}
}
2. What is the relationship between a class and an object? Distinguish between modifier and accessor in C++ language with an example. [Class এবং object এর মধ্যে সম্পর্ক কি? উদাহরণ সহকারে modifier এবং accessor এর মধ্যকার পার্থক্য C++ ল্যাংগুয়েজের সাপেক্ষে বর্ণনা কর।] (6+8)
Answer & solution / উত্তর ও সমাধান
Class হলো user-defined type/blueprint; object হলো সেই class-এর instance। Modifier object-এর state বদলায়; accessor state পড়ে, সাধারণত const member function হয়।
#include <iostream>
class Student {
int marks = 0;
public:
void setMarks(int value) { marks = value; }
int getMarks() const { return marks; }
};
int main() {
Student s;
s.setMarks(85);
std::cout << s.getMarks() << '\n';
}
3. What is the power set of S = {a,b,c}? Compare between linked list and array. [সেট S = {a,b,c} এর পাওয়ার সেট কি? Linked list ও array এর মধ্যকার তুলনা কর।] (6+8)
Answer & solution / উত্তর ও সমাধান
\[\mathcal P(\{a,b,c\})=\{\varnothing,\{a\},\{b\},\{c\},\{a,b\},\{a,c\},\{b,c\},\{a,b,c\}\}\]
\[|\mathcal P(S)|=2^3=8\]
| Array | Linked list |
|---|---|
| Contiguous elements | Nodes linked by pointers |
| Random access \(O(1)\) | Index access \(O(n)\) |
| Middle insertion/deletion often \(O(n)\) | Known predecessor/node থাকলে link update \(O(1)\); node খুঁজতে সময় লাগে |
| কম per-element overhead ও ভালো cache locality | Pointer overhead; size incrementally বদলানো যায় |
4. What are the different phases of SDLC? Classify mapping cardinalities for a binary relationship set with examples. [SDLC এর বিভিন্ন ফেজগুলো কি কি? উদাহরণ সহকারে একটি বাইনারি রিলেশনশিপ সেটের ম্যাপিং কার্ডিনালিটি শ্রেণিভুক্ত কর।] (6+8)
Answer & solution / উত্তর ও সমাধান
SDLC = System Development Life Cycle।
- Planning ও feasibility
- Requirements analysis
- Design
- Implementation
- Testing
- Deployment
- Maintenance
| Type | উদাহরণ |
|---|---|
| One-to-one | এক country-এর একটি capital, model-এর assumptions সাপেক্ষে |
| One-to-many | এক department-এ বহু employee |
| Many-to-one | বহু employee-এর একটি department |
| Many-to-many | বহু student বহু course নেয় |
5. What is the difference between 32-bit and 64-bit operating systems? Distinguish among short-term, medium-term, and long-term scheduling. [32-bit এবং 64-bit operating systems এর মধ্যে পার্থক্য কি? Short-term, medium-term এবং long-term scheduling এর মধ্যে পার্থক্য বর্ণনা কর।] (6+8)
Answer & solution / উত্তর ও সমাধান
32-bit OS সাধারণত 32-bit virtual address ব্যবহার করে; একটি flat address space সর্বোচ্চ \(2^{32}\) bytes। 64-bit OS বৃহত্তর address space সমর্থন করে, তবে hardware/OS-এর বাস্তব limit 64-bit-এর theoretical maximum-এর চেয়ে কম। 32-bit OS-এ PAE থাকলে physical memory 4 GiB ছাড়াতে পারে।
| Scheduler | কাজ |
|---|---|
| Long-term | কোন jobs system/ready pool-এ admit হবে; multiprogramming degree নিয়ন্ত্রণ |
| Medium-term | Process suspend/resume বা swap |
| Short-term | Ready process থেকে পরবর্তী CPU owner নির্বাচন |
6. Mention five data transfer instructions in 8086 microprocessor with their meaning. Describe the flag register of 8086 microprocessor. [8086 মাইক্রোপ্রসেসরের পাঁচটি ডাটা ট্রান্সফার ইনস্ট্রাকশন অর্থসহ উল্লেখ কর। 8086 মাইক্রোপ্রসেসরের ফ্ল্যাগ রেজিস্টার বর্ণনা কর।] (5+9)
Answer & solution / উত্তর ও সমাধান
| 8086 instruction | কাজ |
|---|---|
| MOV | Source থেকে destination-এ byte/word copy |
| PUSH | Word stack-এ রাখা |
| POP | Stack থেকে word নেওয়া |
| XCHG | দুই operand-এর value exchange |
| LEA | Memory operand-এর effective offset address নেওয়া |
8086-এ একটি 16-bit FLAGS register আছে; এর 9টি flag সক্রিয়।
| Flag | কাজ |
|---|---|
| CF | Unsigned carry/borrow |
| PF | ফলাফলের নিচের 8 বিটে even parity |
| AF | Bit 3 থেকে bit 4-এ carry/borrow |
| ZF | ফলাফল শূন্য |
| SF | ফলাফলের sign bit |
| OF | Signed arithmetic overflow |
| TF | Single-step execution |
| IF | Maskable interrupt enable |
| DF | String operation-এর দিক: 0 হলে বৃদ্ধি, 1 হলে হ্রাস |
7. What are the characteristics of LAN, MAN and WAN? Distinguish between TCP and UDP protocols, [LAN, MAN ও WAN এর বৈশিষ্ট্যগুলো কি কি? TCP এবং UDP প্রোটোকলের মধ্যকার পার্থক্য লিখ।] (7+7)
Answer & solution / উত্তর ও সমাধান
| Network | পরিসর |
|---|---|
| LAN | বাড়ি, office, campus-এর local area |
| MAN | শহর/metropolitan area |
| WAN | বড় geographic area; interconnected networks |
| TCP | UDP |
|---|---|
| Connection-oriented byte stream | Connectionless datagrams |
| Reliable, ordered delivery | Delivery/order guarantee নেই |
| Retransmission, flow ও congestion control | কম protocol overhead; application প্রয়োজনমতো reliability যোগ করে |
| File transfer, reliable application traffic | DNS queries, real-time media, games |
8. What is the difference between a flip-flop and a latch? Convert the following sum of product (SOP) expression to an equivalent product of sum (POS) expression. [Flip-flop এবং latch এর মধ্যকার পার্থক্য কি? নীচের sum of product expression (SOP) টিকে product of sum expression (POS) এ রূপান্তরিত কর।] (6+8)
\[\mathbf{ABC + A}\overline{\mathbf{B}}\overline{\mathbf{C}}\mathbf{+ A}\overline{\mathbf{B}}\mathbf{C + AB}\overline{\mathbf{C}}\mathbf{+}\overline{\mathbf{A}}\overline{\mathbf{B}}\mathbf{C}\]
Answer & solution / উত্তর ও সমাধান
| Latch | Flip-flop |
|---|---|
| Level-sensitive | Edge-triggered |
| Enable active থাকলে input পরিবর্তনে output বদলাতে পারে | Active clock edge-এ input sample করে |
Source-এর expression:
\[F=ABC+A\bar B\bar C+A\bar BC+AB\bar C+\bar A\bar BC\]
\[F=A+\bar BC=(A+\bar B)(A+C)\]
Canonical POS (variable order A,B,C):
\[F=\prod M(0,2,3)=(A+B+C)(A+\bar B+C)(A+\bar B+\bar C)\]
সম্পূর্ণ SOP-কে complement করলে F নয়, F-এর complement পাওয়া যায়; source-এর ওই ধাপটি ভুল ছিল।
9. Three light bulbs are connected to a 9V battery as shown in the following figure. Calculate (i) the total current supplied by the battery and (ii) the current through each bulb. [নীচের চিত্রে প্রদর্শিত তিনটি লাইট বাল্ব ব্যাটারির সাথে সংযুক্ত আছে। নির্ণয় কর: (i) ব্যাটারি হতে কি পরিমাণ বিদ্যুৎ প্রবাহিত হবে এবং (ii) প্রত্যেক বাল্বের মধ্যাদিয়ে কি পরিমাণ বিদ্যুৎ প্রবাহিত হবে।] (14)

Answer & solution / উত্তর ও সমাধান
চিত্রে 15 W, 10 W ও 20 W-কে কার্যরত অবস্থার power ধরে:
\[I=\frac{15+10+20}{9}=5\,\mathrm A\]
\[I_1=\frac{20}{9}=2.222\,\mathrm A,\quad I_2=\frac{15+10}{9}=2.778\,\mathrm A\]
15 W ও 10 W bulb series-এ আছে, তাই উভয়ের current 2.778 A। কেবল nominal rating বোঝালে rated voltage ছাড়া প্রকৃত current নির্ণয় করা যায় না।
i) What will be the output of the following code segment? [নিম্নলিখিত code segment এর আউটপুট কি হবে?]
main () {
int x = 41, y = 43;
x = y++ + x++;
y = ++y + ++x;
printf ("%d %d", x, y);
}- 84 128
- 85 132
- 86 130
- 87 129
Source ambiguity
Answer & solution / উত্তর ও সমাধান
C-তে এবং C++17-এর আগে unsequenced modification: নির্দিষ্ট output নেই। C++17 বা পরে সংশোধিত int main/header ধরে output 85 130; কোনো option মেলে না।
ii) A constructor in an object-oriented programming is a special type of ......... [Object-oriented programming এ constructor হলো একটি বিশেষ ধরনের .........।]
Answer & solution / উত্তর ও সমাধান
Correct answer: c. method
Constructor হলো object initialization-এর বিশেষ member function।
iii) In how many steps would the binary search algorithm halt if it were to search for the value 17, in the set S = { 2, 3, 5, 7, 11, 13, 17, 19, 23 }? [সেট S = { 2, 3, 5, 7, 11, 13, 17, 19, 23 } হতে 17 মান বের করার বাইনারি সার্চ অ্যালগরিদম এর কয়টি ধাপ প্রয়োজন হয়।]
Answer & solution / উত্তর ও সমাধান
Correct answer: b. Two
প্রথম middle 11; ডান অংশের middle 17: মোট 2 comparison।