Your next chapter starts hereExplore admission guide

DUET CSE 2019-2020 - Previous Year

Reading mode — untimed, no attempt is recorded
Back
Question 1 Programming

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

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' : ' ');
    }
}
Question 2 Programming

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)

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';
}
Question 3 Data Structure

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)

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\]

ArrayLinked list
Contiguous elementsNodes 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 localityPointer overhead; size incrementally বদলানো যায়
Question 4 Database Management

4. What are the different phases of SDLC? Classify mapping cardinalities for a binary relationship set with examples. [SDLC এর বিভিন্ন ফেজগুলো কি কি? উদাহরণ সহকারে একটি বাইনারি রিলেশনশিপ সেটের ম্যাপিং কার্ডিনালিটি শ্রেণিভুক্ত কর।] (6+8)

Solution

SDLC = System Development Life Cycle।

  1. Planning ও feasibility
  2. Requirements analysis
  3. Design
  4. Implementation
  5. Testing
  6. Deployment
  7. Maintenance
Typeউদাহরণ
One-to-oneএক country-এর একটি capital, model-এর assumptions সাপেক্ষে
One-to-manyএক department-এ বহু employee
Many-to-oneবহু employee-এর একটি department
Many-to-manyবহু student বহু course নেয়
Question 5 Operating System

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)

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-termProcess suspend/resume বা swap
Short-termReady process থেকে পরবর্তী CPU owner নির্বাচন
Question 6 Microprocessor & Microcomputer

6. Mention five data transfer instructions in 8086 microprocessor with their meaning. Describe the flag register of 8086 microprocessor. [8086 মাইক্রোপ্রসেসরের পাঁচটি ডাটা ট্রান্সফার ইনস্ট্রাকশন অর্থসহ উল্লেখ কর। 8086 মাইক্রোপ্রসেসরের ফ্ল্যাগ রেজিস্টার বর্ণনা কর।] (5+9)

Solution
8086 instructionকাজ
MOVSource থেকে destination-এ byte/word copy
PUSHWord stack-এ রাখা
POPStack থেকে word নেওয়া
XCHGদুই operand-এর value exchange
LEAMemory operand-এর effective offset address নেওয়া

8086-এ একটি 16-bit FLAGS register আছে; এর 9টি flag সক্রিয়।

Flagকাজ
CFUnsigned carry/borrow
PFফলাফলের নিচের 8 বিটে even parity
AFBit 3 থেকে bit 4-এ carry/borrow
ZFফলাফল শূন্য
SFফলাফলের sign bit
OFSigned arithmetic overflow
TFSingle-step execution
IFMaskable interrupt enable
DFString operation-এর দিক: 0 হলে বৃদ্ধি, 1 হলে হ্রাস
Question 7 Data Communication & Computer Network

7. What are the characteristics of LAN, MAN and WAN? Distinguish between TCP and UDP protocols, [LAN, MAN ও WAN এর বৈশিষ্ট্যগুলো কি কি? TCP এবং UDP প্রোটোকলের মধ্যকার পার্থক্য লিখ।] (7+7)

Solution
Networkপরিসর
LANবাড়ি, office, campus-এর local area
MANশহর/metropolitan area
WANবড় geographic area; interconnected networks
TCPUDP
Connection-oriented byte streamConnectionless datagrams
Reliable, ordered deliveryDelivery/order guarantee নেই
Retransmission, flow ও congestion controlকম protocol overhead; application প্রয়োজনমতো reliability যোগ করে
File transfer, reliable application trafficDNS queries, real-time media, games
Question 8 Digital Electronics

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}\]

Solution
LatchFlip-flop
Level-sensitiveEdge-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-এর ওই ধাপটি ভুল ছিল।

Question 9 Basic Electricity

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)

Question diagram

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 নির্ণয় করা যায় না।

Question 10.1 Programming Source ambiguity: see solution note

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);
}
  1. 84 128
  2. 85 132
  3. 86 130
  4. 87 129
Solution

C-তে এবং C++17-এর আগে unsequenced modification: নির্দিষ্ট output নেই। C++17 বা পরে সংশোধিত int main/header ধরে output 85 130; কোনো option মেলে না।

Question 10.2 Programming

ii) A constructor in an object-oriented programming is a special type of ......... [Object-oriented programming এ constructor হলো একটি বিশেষ ধরনের .........।]

  • a. Class
  • b. Field
  • c. method
  • d. property
Solution

Constructor হলো object initialization-এর বিশেষ member function।

Question 10.3 Data Structure

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 মান বের করার বাইনারি সার্চ অ্যালগরিদম এর কয়টি ধাপ প্রয়োজন হয়।]

  • a. One
  • b. Two
  • c. Three
  • d. Four
Solution

প্রথম middle 11; ডান অংশের middle 17: মোট 2 comparison।

Question 10.4 Data Structure

iv) Which of the following sorting procedure is the slowest? [নীচের কোন sorting পদ্ধতিটি সবচেয়ে ধীরতম?]

  • a. Quick sort
  • b. Bubble sort
  • c. Heap sort
  • d. Shell sort
Solution

সাধারণ unsorted input-এ bubble sort-এর quadratic work-এর কারণে expected answer; নির্দিষ্ট input ছাড়া সব ক্ষেত্রে slowest বলা যায় না।

Question 10.5 Programming Source ambiguity: see solution note

v) ......... creates new data types to contain something different that is not limited to the values fundamental data types may take. [......... একটি নতুন ডাটা টাইপ তৈরি করে, যা ফান্ডামেন্টাল ডাটা টাইপ হতে ভিন্ন কিছু সংরক্ষণ করে।]

  1. Enumeration
  2. Union
  3. Structure
  4. Queue
Solution

বাক্যটি অস্পষ্ট: enum named integral constants নির্ধারণ করে; struct heterogeneous member-সহ নতুন type তৈরি করে। নির্দিষ্ট type-এর বৈশিষ্ট্য ছাড়া একক সঠিক option নিশ্চিত নয়।

Question 10.6 Database Management

vi) Considering the following set of relations, what is a correct SQL query to find all the employees whose departments are located in ‘Gazipur’ and salary is greater than Tk. 20,000? [নীচের Set of relations এর ভিত্তিতে সঠিক SQL query টি কি যা সব employee কে খুঁজে বের করবে যাদের ডিপার্টমেন্ট ‘Gazipur’ এ এবং salary Tk. 20,000 এর বেশি?] emp (emp_no, emp_name, dept_no, salary) dept (dept_no, dept_name, location)

  • a. Select emp_name from dept where dept_no and location = ‘Gazipur’;
  • b. Select emp_name from emp where salary > 20,000 and dept_no in (select dept_no from dept where location = ‘Gazipur’);
  • c. Select dept_no, count(emp_no) emp where salary > 20,000 group by dept_no = ‘Gazipur’;
  • d. update table emp where emp_name = ‘Gazipur’;
Solution

সঠিক syntax: SELECT emp_name FROM emp WHERE salary > 20000 AND dept_no IN (SELECT dept_no FROM dept WHERE location = 'Gazipur'); source-এর 20,000 SQL numeric literal নয়।

Question 10.7 Operating System

vii) Which module gives control of the CPU to the process selected by the short-term scheduler? [শর্ট-টার্ম সিডিউলার কোন মডিউল দিয়ে প্রসেস সমূহকে CPU তে প্রদান করে?]

  • a. Dispatcher
  • b. Interrupt
  • c. Scheduler
  • d. Job queue
Solution

Dispatcher নির্বাচিত process-কে CPU দেয়।

Question 10.8 Operating System

viii) Physical memory is broken into fixed sized blocks called ....... [Physical memory এর নির্দিষ্ট আকারের বিভক্ত ব্লককে বলে ........।]

  • a. Frames
  • b. pages
  • c. backing store
  • d. kernel
Solution

Physical memory-এর fixed-size blocks হলো frames; virtual memory-এর blocks pages।

Question 10.9 Data Communication & Computer Network

ix) Communication between a computer and a keyboard involves ....... transmission. [কম্পিউটার ও কি বোর্ডের মধ্যে যোগাযোগ হলো ......... ট্রান্সমিশন।]

  • a. automatic
  • b. half-duplex
  • c. full-duplex
  • d. simplex
Solution

প্রশ্নের সরল data-flow model-এ keyboard থেকে computer: simplex। বাস্তব USB/PS2 link bidirectional control-ও বহন করে।

Question 10.10 Data Communication & Computer Network

x) The 802.16 is a standard for ....... [802.16 হলো ......... এর স্ট্যান্ডার্ড।]

  • a. logical link control
  • b. wireless LAN
  • c. Broadband wireless
  • d. personal area networks (Bluetooth)
Solution

IEEE 802.16: broadband wireless access।

Question 10.11 Digital Electronics

xi) In 1-to-4 multiplexer, how many select lines are required? [1-to-4 multiplexer এর কয়টি সিলেক্ট লাইন প্রয়োজন?]

  • a. 2
  • b. 3
  • c. 4
  • d. 5
Solution

4টি line নির্বাচন করতে log2(4) = 2 select bit। 1-to-4 device-টির সঠিক নাম demultiplexer।

Question 10.12 Basic Electricity

xii) A 2 ohms resistor having 1 ampere current will dissipate the power of ...... [একটি 2 ohm রেজিস্টারে মধ্যে দিয়ে 1 ampere বিদ্যুৎ প্রবাহিত হলে ......... পাওয়ার নির্গত হবে।]

  • a. 2 watts
  • b. 2 joules
  • c. 1 watt
  • d. 1 joule
Solution

\(P=I^2R=1^2\times2=2\,\mathrm W\)।