DUET CSE 2017-2018 - Previous Year
Reading mode — untimed, no attempt is recorded01. (a) Write down a program in C language that takes three sides of a triangle as input and determine whether they from a valid triangle or not. [C language- এ একটি প্রোগ্রাম লিখ যা ত্রিভুজের তিনটি বাহু ইনপুট হিসাবে নিবে এবং ওই বাহু তিনটি দ্বারা সঠিক ত্রিভুজ গঠিত হবে কিনা তা নির্ধারণ করবে।] (08)
#include <stdio.h>
int main(void) {
double a, b, c;
if (scanf("%lf%lf%lf", &a, &b, &c) != 3) return 1;
int valid = a > 0 && b > 0 && c > 0
&& a + b > c && a + c > b && b + c > a;
puts(valid ? "Valid triangle" : "Invalid triangle");
return 0;
}
01. (b) Write down the difference between local and global variable in C language? [C language- এ লোকাল এবং গ্লোবাল ভেরিয়েবলের মধ্যকার পার্থক্য লিখ।] (06)
| Local | Global |
|---|---|
| Block/function-এর ভিতরে declared | Function-এর বাইরে file scope-এ declared |
| Scope enclosing block | Declaration visible এমন scope-এ ব্যবহারযোগ্য |
| Automatic local সাধারণত block শেষ হলে শেষ হয়; static local টিকে থাকে | Static storage duration: program চলাকালীন টিকে থাকে |
| Explicit initializer না থাকা automatic local-এর value indeterminate | Uninitialized global zero-initialized |
02. (a) Suppose a coin is flipped three times. What is the probability of getting a tail twice and a head once? [একটি মুদ্রাকে তিনবার নিক্ষেপ করা হল। দুই বার টেইল ও একবার হেড পাওয়ার সম্ভাবনা কত?] (07)
Fair ও independent coin toss ধরে favorable ফল HTT, THT, TTH।
\[P=\binom32(1/2)^3=\boxed{3/8}\]
(b) Define tautology. Prove that \(\left( \left( \mathbf{A}\mathbf{\rightarrow}\mathbf{B} \right)\mathbf{\land}\mathbf{A} \right)\mathbf{\rightarrow}\mathbf{B}\) is a tautology using a truth table. [Tautology এর সংজ্ঞা দাও। Truth table দ্বারা প্রমাণ কর যে, \(\left( \left( \mathbf{A}\mathbf{\rightarrow}\mathbf{B} \right)\mathbf{\land}\mathbf{A} \right)\mathbf{\rightarrow}\mathbf{B}\) একটি tautology।] (07)
সকল truth assignment-এ সত্য compound proposition হলো tautology।
| A | B | A → B | (A → B) ∧ A | ((A → B) ∧ A) → B |
|---|---|---|---|---|
| F | F | T | F | T |
| F | T | T | F | T |
| T | F | F | F | T |
| T | T | T | T | T |
03. (a) Briefly explain stack data structure with an example. [Stack ডাটা-স্ট্রাকচার উদাহরণসহ সংক্ষেপে ব্যাখ্যা কর।] (06)
Stack হলো LIFO data structure। Push top-এ যোগ করে, pop top থেকে সরায়। Recursion-এ প্রতিটি call-এর return address, arguments ও local context সংরক্ষিত হয়; সর্বশেষ call প্রথমে return করে।
push(10): [10]
push(20): [10, 20] <- top
pop(): returns 20; stack = [10]
(b) What are the advantages and disadvantages of binary search algorithm? [বাইনারি সার্চ অ্যালগরিদম এর সুবিধা- অসুবিধা গুলো কি কি?] (08)
Binary search sorted random-access sequence-এর search interval প্রতি ধাপে অর্ধেক করে।
- Average/worst-case time \(O(\log n)\); best case \(O(1)\)।
- Iterative implementation-এ extra space \(O(1)\)।
- ডেটা sorted রাখতে হয়; sorting/update-এর খরচ থাকে।
- Linked list-এ middle access সরাসরি হয় না, তাই array-এর মতো সুবিধা পাওয়া যায় না।
04. (a) Write down the SQL command to find a student named “Bob” and his mother’s name is “Alice” from the “Student Info” table. [“Student Info” টেবিল হতে একটি ছাত্র খুঁজে বের করার জন্য SQL কমান্ডটি লিখ যার নাম “Bob” এবং যার মায়ের নাম “Alice”।] (07)
Column নাম source-এ নির্দিষ্ট নেই; student_name ও mother_name ধরে standard SQL:
SELECT *
FROM "Student Info"
WHERE student_name = 'Bob'
AND mother_name = 'Alice';
(b) What are the advantages of relational database system over traditional file system? [গতানুগতিক ফাইল সিস্টেম অপেক্ষা রিলেশনাল ডাটাবেস সিস্টেমের সুবিধাগুলি কি কি?] (07)
- নিয়ন্ত্রিত redundancy ও consistency।
- Constraints দিয়ে data integrity।
- Authorization ও access control।
- Transactions ও concurrent access।
- Backup এবং crash recovery।
- Data independence ও SQL query।
05. (a) Mention the phases of SDLC. Which techniques are used for system design? [SDLC এর ধাপগুলো উল্লেখ কর। সিস্টেম ডিজাইনে কোন কোন টেকনিক ব্যবহৃত হয়?] (08)
SDLC = System Development Life Cycle।
- Planning ও feasibility
- Requirements analysis
- Design
- Implementation
- Testing
- Deployment
- Maintenance
System-design techniques: structured design/DFD, ER modelling, UML class/sequence diagrams, modular design এবং prototyping।
(b) Define and classify the feasibility study. [ফিজিবিলিটি স্টাডি এর সংজ্ঞা এবং শ্রেণিভেদ লিখ।] (06)
Feasibility study নির্ধারণ করে প্রকল্পটি বাস্তবায়নযোগ্য ও উপযোগী কি না।
| Type | প্রশ্ন |
|---|---|
| Technical | প্রয়োজনীয় technology/skills আছে? |
| Economic | Benefit কি cost justify করে? |
| Operational | Users/organisation গ্রহণ ও চালাতে পারবে? |
| Schedule | সময়সীমায় করা যাবে? |
| Legal | আইন ও contractual requirements পূরণ করবে? |
06. (a) What is throughput, turnaround time, waiting time, and response time? [Throughput, turnaround time, waiting time এবং response time বলতে কি বুঝ?] (08)
| Metric | সংজ্ঞা |
|---|---|
| Throughput | প্রতি unit time-এ completed process সংখ্যা |
| Turnaround time | Completion time − arrival time |
| Waiting time | Ready queue-এ মোট অপেক্ষা |
| Response time | প্রথম CPU service/response time − arrival time |
06. (b) Write down the data structure of Process Control Block (PCB). [প্রসেস কন্ট্রোল ব্লক (PCB)-এর ডাটা স্ট্রাকচার লিখ।] (06)
- Process identifier (PID)
- Process state
- Program counter
- CPU registers ও saved context
- Scheduling information: priority, queue links
- Memory information: page/segment tables
- I/O status ও open files
- Accounting ও ownership information
07. (a) What is cache memory? What do you understand by dual core processor? [Cache memory কি? Dual core processor বলতে কি বুঝ?] (06)
Cache হলো CPU-এর কাছে থাকা ছোট ও দ্রুত memory, যেখানে সম্প্রতি/ঘন ঘন ব্যবহৃত data এবং instruction রাখা হয়; এতে average memory-access time কমে।
Dual-core processor-এ একই chip/package-এ দুটি processing core থাকে। Parallel task execution সম্ভব; single-thread program স্বয়ংক্রিয়ভাবে দ্বিগুণ দ্রুত হয় না।
(b) Briefly describe the flag register of 8086 processor. [সংক্ষেপে 8086 প্রসেসর এর ফ্ল্যাগ রেজিস্টারগুলো বর্ণনা কর।] (08)
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 হলে হ্রাস |
08. (a) Briefly describe two well known data transport protocols provided by the internet transport layer, and indicate what type of application might use that service. [Internet transport layer এর বহুল প্রচলিত দুটি data transport protocol- এর সংক্ষিপ্ত বিবরণ দাও এবং তা কোন ধরণের application- এ ব্যবহৃত হয়ে থাকে, তা লিখ।] (08)
| 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 |
(b) What are the topologies used in computer networking? [কম্পিউটার নেটওয়ার্কে কি কি টপোলজি ব্যবহৃত হয়?] (06)
- Bus: shared backbone।
- Star: central switch/hub-এর সঙ্গে পৃথক link।
- Ring: cyclic neighbour connection।
- Mesh: একাধিক/সব node pair-এর connection।
- Tree: hierarchical structure।
- Hybrid: একাধিক topology-এর সমন্বয়।
09. (a) Express the Boolean function F = A + B'C as a standard sum of minterms. [ $F = A + B'C$ Boolean function- টি standard sum of minterm- এ প্রকাশ কর।] (06)
\[F=A+\bar BC=\bar A\bar BC+A\bar B\bar C+A\bar BC+AB\bar C+ABC\]
\[\boxed{F=\sum m(1,4,5,6,7)}\]
Variable order A,B,C; A most significant bit।
(b) A 200V d.c. shunt motor running at 1000 rpm takes an armature current of 17.5A. It is required to reduce the speed to 600 rpm. What must be the value of resistance to be inserted in the armature circuit if the original armature resistance is 0.4$\Omega$? Take armature current to be constant during this process. [1000 rpm এ চলন্ত একটি 200V d.c. সান্ট মোটর 17.5 A আর্মেচার কারেন্ট গ্রহণ করে। এটির গতি কমিয়ে 600 rpm করতে হবে। যদি মূল আর্মেচার রেজিস্ট্যান্স 0.4Ωহয় তবে আর্মেচার সার্কিটে অতিরিক্ত কত রেজিস্ট্যান্স যুক্ত করতে হবে? এই প্রক্রিয়া চলাকালীন সময়ে আর্মেচার কারেন্ট constant থাকবে।] (08)
\[E_1=200-17.5(0.4)=193\,\mathrm V,\quad E_2=193(600/1000)=115.8\,\mathrm V\]
\[R_{total}=\frac{200-115.8}{17.5}=4.81143\,\Omega,\quad R_{added}=\boxed{4.41143\,\Omega}\]
Shunt flux ও armature current অপরিবর্তিত ধরে।
i) What will be the value of x after executing the following statements? [নিম্নলিখিত statement সমূহ execute করার পরে x এর মান কি হবে?] int x = 25, y = 13; x = (x < y) ? (x + y) : (x - y);
- a. 25
- b. 38
- c. 12
- d. 13
25 < 13 false; x = 25 - 13 = 12।
ii) When you pass an array as an argument to a function, what is actually passed? [যখন তুমি কোন array- কে ফাংশনের argument হিসাবে pass করবে, তখন প্রকৃতপক্ষে কি pass হবে?]
- a. All the elements of the array
- b. The first element of the array
- c. Address of the first element of the array
- d. Address of the last element of the array
সাধারণ array argument first element-এর pointer-এ convert হয়।
iii) In how many steps would the binary search algorithm be halted if it were to search for the value 17, in the set S = {2, 3, 5, 7, 11, 13, 17, 19, 23}? [Binary search algorithm কতগুলি ধাপে শেষ হবে যদি 17- এর জন্য S সেটে অনুসন্ধান করা হয়, যেখানে সেট S = {2, 3, 5, 7, 11, 13, 17, 19, 23}?]
- a. one
- b. two
- c. three
- d. four
11 তারপর 17: 2 comparison।
iv) A graph G is called a ______, if it is a connected acyclic graph. [একটি গ্রাফ G যদি সংযুক্ত ও এসাইক্লিক হয় তবে তাকে ______ বলে?]
- a. cyclic graph
- b. regular graph
- c. tree
- d. planar graph
Connected acyclic undirected graph হলো tree।
v) The term ______ is used to refer to a table row. [টেবিলের row চিহ্নিত করার জন্য ______ ব্যবহৃত হয়।]
- a. attribute
- b. tuple
- c. field
- d. instance
Tuple হলো relation-এর row।
vi) Which model shows the sequence of activities in the process along with their inputs, outputs, and dependencies? [কোন মডেলটি ইনপুট, আউটপুট, এবং ডিপেন্ডেন্সিস এর সাথে তার প্রসেসে ধারা প্রদর্শন করে?]
- a. Data flow model
- b. Workflow model
- c. Role/Action model
- d. Activity model
Workflow model activities-এর sequence এবং dependencies দেখায়; data-flow model মূলত data movement দেখায়।
vii) Physical memory is broken into fixed-sized blocks called ______. [Physical মেমোরীর নির্দিষ্ট আকারের বিভক্ত ব্লককে ______ বলে।]
- a. frames
- b. pages
- c. backing store
- d. none of these
Physical frame, logical page।
viii) With paging there is no ______ fragmentation. [Paging এ কোন ______ fragmentation নেই।]
- a. internal
- b. external
- c. either type of
- d. none of these
Paging external fragmentation দূর করে; internal fragmentation থাকতে পারে।
ix) Which of the following instructions is not valid? [নিম্নের কোন ইন্সট্রাকশন টি সঠিক নয়?]
- a. MOV AX, BX
- b. MOV DS, 5000H
- c. MOV AX, 5000H
- d. PUSH AX
Segment register-এ immediate সরাসরি MOV করা যায় না; আগে general register-এ নিতে হয়।
x) ______ Which layer of OSI model perform the encryption/decryption? [OSI model এর কোন layer-টি encryption বা decryption করে?]
- a. Network layer
- b. Presentation layer
- c. Application layer
- d. Data Link layer
OSI presentation layer data representation/encryption-এর দায়িত্ব বর্ণনা করে।
xi) ______ is used to store BIOS programs? [BIOS প্রোগ্রাম সংরক্ষণ করতে ______ ব্যবহৃত হয়।]
- a. ROM chips
- b. CMOS storage
- c. Hard disk
- d. MOSFET
BIOS firmware nonvolatile ROM/flash memory-তে থাকে।
xii) Two resistance of 100 Ω and zero Ω are connected in parallel. The overall resistance will be ______. [100 Ω এবং zero $\Omega$ এর দুটি রেজিস্টেন্স সমান্তরালে সংযুক্ত থাকলে মোট রেজিস্টেন্স ______ হবে।]
- a. 100 Ω
- b. 50Ω
- c. 25 Ω
- d. zero Ω
Ideal zero-ohm parallel branch short circuit তৈরি করে; equivalent resistance zero।