DUET CSE 2009-2010 - Previous Year
Reading mode — untimed, no attempt is recorded1. (a) Write the content and purpose of the following header files [নিম্নোক্ত হেডার ফাইলগুলোর কনটেন্ট এবং উদ্দেশ্যগুলি লিখ ।]
(i) <iostream.h> (ii) <stdlib.h> (iii) <math.h> (iv) <string.h>
| Header | Content ও purpose |
|---|---|
| iostream.h | পুরোনো non-standard C++ stream header; standard C++-এ <iostream>, std::cin/std::cout |
| stdlib.h | malloc/free, numeric conversion, exit, qsort ইত্যাদি |
| math.h | sqrt, pow, sin ইত্যাদি mathematical function declaration |
| string.h | strlen, strcmp, strcpy, memcpy ইত্যাদি string/memory operation declaration |
1. (b) Using recursion write a program in “C” Language to calculate the factorial of any integer. [রিকারসন ব্যবহার করে যে কোন পূর্ণ সংখ্যার ফ্যাক্টরিয়াল গণনা করার জন্য “C” ভাষায় একটি প্রোগ্রাম লিখ।] (06)
কোনো function নিজেকে call করলে তাকে recursion বলে। Base case recursion থামায়।
\[0!=1,\qquad n!=n(n-1)!\quad(n\ge1)\]
#include <stdio.h>
unsigned long long factorial(unsigned int n) {
return n < 2 ? 1 : n * factorial(n - 1);
}
int main(void) {
int n;
if (scanf("%d", &n) != 1 || n < 0 || n > 20) {
puts("Enter an integer from 0 to 20.");
return 1;
}
printf("%llu\n", factorial((unsigned int)n));
return 0;
}
3. (a) Construct a truth table for the following compound proposition [নিম্নলিখিত কম্পাউন্ড প্রোপজিশনের ট্রুথ টেবিল তৈরী কর] $(p \oplus q) \wedge (p \oplus \neg q)$ (03)
| p | q | p XOR q | p XOR NOT q | AND |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 |
দুটি XOR complementary, তাই compound proposition সর্বদা false (contradiction)।
2. (b) A die is rolled and a coin is tossed, find the probability that the die shows an odd number and the coin shows a head. [একটি ডাইকে গড়াইয়া এবং একটি কয়েনকে ছুড়িয়া দেওয়া হইল, ডাইটি একটি বেজোড় সংখ্যা এবং কয়েনটি একটি হেড প্রদর্শন করিবার সম্ভাব্যতা বের কর।] (07)
\[P(\text{odd and head})=\frac36\times\frac12=\boxed{\frac14}\]
Fair die ও fair coin এবং independent outcomes ধরে।
3. (a) Prepare a Binary search tree for the following data: 8,10,26,2,78,102,115 [নিম্নোক্ত ডাটাতগুলি ব্যবহার করে একটি binary search tree তৈরি কর।] (8,10,26,2,78,102,115) (04)
Insertion order অনুসারে 8 root; 2 তার left child; 10 right child। এরপর 26 → 78 → 102 → 115 ক্রমাগত right child।
Inorder: 2, 8, 10, 26, 78, 102, 115।
3.(b) If $A = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix}$ and $B = \begin{bmatrix} 2 & 0 & -4 \\ 3 & 2 & 6 \end{bmatrix}$ derive the Matrix multiplication of A and B. [যদি $A = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix}$ and $B = \begin{bmatrix} 2 & 0 & -4 \\ 3 & 2 & 6 \end{bmatrix}$ হয়, তাহলে A এবং B ম্যাট্রিক্সের গুণফল বের কর।] (06)
\[AB=\begin{bmatrix}1(2)+3(3)&1(0)+3(2)&1(-4)+3(6)\\2(2)+4(3)&2(0)+4(2)&2(-4)+4(6)\end{bmatrix}=\boxed{\begin{bmatrix}11&6&14\\16&8&16\end{bmatrix}}\]
4. (a) What is data abstraction? Mention the levels of data abstraction. [ডাটা অবস্ট্রাকশন বলতে কি বুঝায়? ডাটা অবস্ট্রাকশনের বিভিন্ন স্তর গুলোর নাম লিখ।] (06)
Data abstraction ব্যবহারকারীকে অপ্রয়োজনীয় storage details থেকে আলাদা রাখে।
| Level | অর্থ |
|---|---|
| Physical | ডেটা কীভাবে disk-এ সংরক্ষিত |
| Logical | কোন data, structure ও relationship আছে |
| View/external | নির্দিষ্ট ব্যবহারকারীর দেখা অংশ |
4. (b) What mapping cardinality? What are the types of it? [ম্যাপিং কার্ডিনালিটি বলতে কি বুঝায়? ইহা কত ধরনের?]
SQL = Structured Query Language। Mapping cardinality বোঝায় একটি entity-এর সঙ্গে অপর set-এর কত entity সম্পর্কিত হতে পারে।
| Type | উদাহরণ |
|---|---|
| One-to-one | এক country-এর একটি capital, model-এর assumptions সাপেক্ষে |
| One-to-many | এক department-এ বহু employee |
| Many-to-one | বহু employee-এর একটি department |
| Many-to-many | বহু student বহু course নেয় |
5. (a) What is encryption of data? Write the name of recovery techniques. [ডাটা এনক্রিপশন বলতে কি বুঝায়? রিকভারী কৌশলগুলোর নাম লিখ] (05)
Encryption key ও algorithm ব্যবহার করে plaintext-কে ciphertext-এ রূপান্তর করে যাতে অননুমোদিত ব্যক্তি data পড়তে না পারে। এটি backup/recovery-এর বিকল্প নয়।
- Log-based recovery: undo/redo।
- Checkpointing।
- Shadow paging।
- Backup restore এবং transaction-log replay।
5. (b) Compare and contrast between unique key and foreign key in a database system [ডাটাবেস সিস্টেমের ইউনিক কি এবং ফরেন কি এর মধ্যে তুলনামূলক পার্থক্য ও বৈসাদৃশ্য বর্ণনা কর।] (05)
| Unique key | Foreign key |
|---|---|
| Column set-এর uniqueness enforce করে | Referenced primary/unique key-এর সঙ্গে referential integrity enforce করে |
| এক table-এ একাধিক unique constraint সম্ভব | এক table-এ একাধিক foreign key সম্ভব |
| NULL handling DBMS অনুযায়ী ভিন্ন | Nullable হলে NULL reference অনুমোদিত হতে পারে |
| নিজ table-এর duplicate value নিয়ন্ত্রণ | Parent-child relation বজায় রাখে; নিজে uniqueness বোঝায় না |
6. (a) What is the disadvantage of SDLC (System Development Life Cycle)? How can it be removed [SDLC এর অসুবিধাগুলো কি কি এগুলো কিভাবে দূর করা যায়?] (05)
SDLC নিজে একটি lifecycle ধারণা; সব SDLC model-এর একই সীমাবদ্ধতা নয়। Strict waterfall-এ requirements বদলানো ব্যয়বহুল, user feedback ও working software দেরিতে আসে এবং বড় risk দেরিতে ধরা পড়ে।
Iterative/incremental delivery, prototyping, early testing এবং নিয়মিত stakeholder feedback দিয়ে এই সমস্যাগুলো কমানো যায়।
6. (b) How is beta testing performed in software development. [সফটওয়্যার ডেভেলপমেন্টে বেটা টেস্টিং কিভাবে করা হয়।] (05)
- Internal/alpha testing শেষে নির্বাচিত external users-কে release candidate দেওয়া হয়।
- Users নিজেদের বাস্তব environment-এ স্বাভাবিক কাজ করেন।
- Bug, usability ও compatibility feedback সংগ্রহ করা হয়।
- Issue triage, fix ও regression test শেষে final release প্রস্তুত হয়।
7. What types of tests are performed during unit testing of software development [সফটওয়্যার ডেভেলপমেন্টের ক্ষেত্রে ইউনিট টেস্টিং এ কি কি টেস্ট করা হয়।] (10)
- Module interface ও parameter validation।
- Normal, boundary ও invalid input cases।
- Independent control-flow path/branch।
- Local data structures ও state transitions।
- Error/exception handling ও resource cleanup।
Dependencies প্রয়োজনে stub/mock করা হয়; unit testing পুরো system integration test নয়।
8. Define Through put, Turnaround time, Waiting time and Response time in respect of operating system. [অপারেটিং সিস্টেমের ক্ষেত্রে Throughput, Turnaround time, Waiting time এবং Response time এর সংজ্ঞা লিখ ।] (10)
| Metric | সংজ্ঞা |
|---|---|
| Throughput | প্রতি unit time-এ completed process সংখ্যা |
| Turnaround time | Completion time − arrival time |
| Waiting time | Ready queue-এ মোট অপেক্ষা |
| Response time | প্রথম CPU service/response time − arrival time |
9. (a) What are the functions of ‘Kernel’ in the operating system. [অপারেটিং সিস্টেমের কার্নেলের কাজ কি?] (04)
Operating system হলো system software যা hardware resource পরিচালনা করে এবং application-এর জন্য service দেয়।
- Process/CPU scheduling ও process coordination।
- Memory allocation, protection ও virtual memory।
- File, storage ও I/O device management।
- User authentication, access control ও system-call interface।
9. (b) What is the important of File Management of the Operating system. [অপারেটিং সিস্টেমের ফাইল ব্যবস্থাপনার গুরুত্ব কি ।] (06)
- File/directory creation, reading, writing ও deletion।
- Storage allocation ও free-space tracking।
- Naming, metadata ও directory organisation।
- Permission এবং access control।
- Concurrent access, consistency ও recovery support।
10. Explain ‘write’ operation of Programmable Interval Timer (PIT) or 8253. [Programmable Interval Time (PTT) or 8253 এর “Write” operation ব্যাখ্যা কর ।] (10)
- CS low, RD high এবং A1A0 = 11 দিয়ে control-word register নির্বাচন করো।
- WR pulse-এর মাধ্যমে counter number, byte order, mode এবং binary/BCD format লেখো।
- A1A0 = 00/01/10 দিয়ে counter 0/1/2 নির্বাচন করো।
- নির্বাচিত format অনুযায়ী count লেখো: LSB only, MSB only, অথবা প্রথমে LSB তারপর MSB।
- Clock ও GATE এবং নির্বাচিত mode অনুযায়ী counting/output চলে।
উদাহরণ: counter 0, binary, mode 3, LSB-then-MSB-এর control word = 36H। Count 1000 = 03E8H হলে E8H তারপর 03H লেখো।
11. Identify the several layers of OSI reference model and write the main task of data link layer. [OSI reference মডেলের বিভিন্ন লেয়ারগুলি চিহ্নিত কর এবং ডাটা লিংক লেয়ারের প্রধান কার্যাবলী লিখ। ] (10)
| OSI (উপর থেকে নিচে) | মূল কাজ |
|---|---|
| Application | Application-level network service |
| Presentation | Data representation, encoding, encryption |
| Session | Session/dialog coordination |
| Transport | End-to-end process delivery, ports |
| Network | Logical addressing ও routing |
| Data link | Framing, MAC addressing, media access, error detection |
| Physical | Medium-এ bits/signals পাঠানো |
12. Explain simplex, Half-Duplex and Full Duplex data transmission. [সিমপ্লেক্স, হাফ-ডুপ্লেক্স এবং ফুল-ডুপ্লেক্স ডাটা ট্রান্সমিশন ব্যাখ্যা কর] (10)
| Mode | দিক | উদাহরণ |
|---|---|---|
| Simplex | শুধু এক দিকে | Broadcast television |
| Half-duplex | দুই দিকে, তবে একই সময়ে নয় | Walkie-talkie |
| Full-duplex | দুই দিকে একই সময়ে | Telephone conversation |
13. Design full adder circuit using only NAND gate. [শুধুমাত্র ন্যান্ড গেট এর সাহায্যে ফুল এডার সার্কিট ডিজাইন কর।] (10)
\[S=A\oplus B\oplus C_{in},\qquad C_{out}=AB+C_{in}(A\oplus B)\]
| A | B | Cin | S | Cout |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
নিচের 9টি two-input NAND connection পূর্ণ circuit নির্ধারণ করে:
| Gate | Connection |
|---|---|
| n1 | NAND(A,B) |
| n2 | NAND(A,n1) |
| n3 | NAND(B,n1) |
| P | NAND(n2,n3) |
| n4 | NAND(P,Cin) |
| n5 | NAND(P,n4) |
| n6 | NAND(Cin,n4) |
| S | NAND(n5,n6) |
| Cout | NAND(n1,n4) |
14. For the emitter bias network of the following figure determine. [নিম্নের Emitter bias নেটওয়ার্ক থেকে বের কর]
(i) $I_B$, (ii) $I_C$, (iii) $V_{CE}$, (iv) $V_C$, (v) $V_{BC}$
(Circuit diagram showing an NPN transistor emitter-bias configuration with $+20\text{ V}$ Vcc, $2\text{ k}\Omega$ collector resistor, $430\text{ k}\Omega$ base resistor, $1\text{ k}\Omega$ emitter resistor, $\beta = 50$, and coupling capacitors $10\ \mu\text{F}$ and $40\ \mu\text{F}$)
Source-এর described emitter-bias circuit: VCC = 20 V, RB = 430 kΩ, RC = 2 kΩ, RE = 1 kΩ, β = 50; VBE = 0.7 V ধরে।
\[I_B=\frac{20-0.7}{430000+(50+1)1000}=\boxed{40.1247\,\mu\mathrm A}\]
\[I_C=50I_B=\boxed{2.00624\,\mathrm{mA}},\quad I_E=51I_B=2.04636\,\mathrm{mA}\]
\[V_C=20-I_C(2000)=\boxed{15.9875\,\mathrm V}\]
\[V_E=2.04636\,\mathrm V,\quad V_{CE}=V_C-V_E=\boxed{13.9412\,\mathrm V}\]
\[V_{BC}=V_E+0.7-V_C=\boxed{-13.2412\,\mathrm V}\]
15. (a) Write the formula for total capacitance connected in a parallel and series circuit? [প্যারালাল এবং সিরিজ সার্কিট এর Total capacitance এর সূত্র লিখ]
\[C_{parallel}=C_1+C_2+\cdots+C_n\]
\[\frac1{C_{series}}=\frac1{C_1}+\frac1{C_2}+\cdots+\frac1{C_n}\]
Parallel-এ voltage একই; series-এ প্রতিটি capacitor-এর charge-এর magnitude একই।
15. (b) If A parallel combination of $4\ \Omega$ and another unknown resistor are connected across a $12\text{ V}$ supply, where the total current is $5\text{ A}$. Determine the value of unknown resistor. [$4\ \Omega$ এর একটি এবং অজানা মানের আরেকটি রেজিস্ট্রী প্যারালাল সংযুক্ত করে $12\text{ V}$ সরবরাহের সাথে সংযোগ করা হলো সার্কিটে মোট $5\text{ A}$ কারেন্ট প্রবাহিত হয়। অজানা রেজিস্টারের মান নির্ণয় কর।] (05)
(Circuit diagram showing a $12\text{ V}$ DC source supplying $5\text{ A}$ total current to two parallel resistors, $R$ and $4\ \Omega$)
\[I_4=12/4=3\,\mathrm A,\quad I_R=5-3=2\,\mathrm A\]
\[R=12/2=\boxed{6\,\Omega}\]