Your next chapter starts hereExplore admission guide

DUET CSE 2015-2016 - Previous Year

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

1. (a) What is token? List different types of token in C++. [টোকেন কি? C++ এর বিভিন্ন প্রকার টোকেন এর তালিকা দাও।] (07)

Solution

Token হলো source program-এর ক্ষুদ্রতম meaningful lexical unit। C++ token-এর প্রধান ধরন: keywords, identifiers, literals, operators ও punctuators।

int count = 10;
// int: keyword; count: identifier; 10: literal; =: operator; ;: punctuator
Question 1b Programming

(b) What is polymorphism? Differentiate between method overriding and method overloading? [Polymorphism কি? method overriding এবং method overloading এর মধ্যে পার্থক্য কর।] (07)

Solution

Polymorphism হলো একই interface দিয়ে বিভিন্ন ধরনের object-এর উপযুক্ত আচরণ পাওয়া।

  1. Compile-time: function/operator overloading।
  2. Run-time: virtual function overriding; base pointer/reference দিয়ে derived implementation চালানো।
  3. সুবিধা: পুনর্ব্যবহার, সহজ extension এবং কম coupling।
OverloadingOverriding
একই নাম, ভিন্ন parameter listDerived class-এ matching virtual function-এর implementation
Compile-time overload resolutionVirtual dispatch-এ run-time selection
Return type একা বদলে overload হয় নাC++-এ override লিখলে signature compiler যাচাই করে
Question 2 Programming

2. Write a program in C language to make a SWAP operation. In the program you have to take two inputs in x and y variable and show the x and y output first; and then SWAP the x and y variable values and show the output for new x and y values. [C ল্যাঙ্গুয়েজ এ একটি প্রোগ্রাম লিখ যা SWAP অপারেশন করতে পারে। উক্ত প্রোগ্রামে X ও Y দুইটি ভেরিয়েবলে প্রথমে দুইটি মান ইনপুট হিসেবে নিবে এবং x ও y এর মান আউটপুট এ দেখাবে; পরবর্তীতে x ও y এর মধ্যে SWAP করার পর x ও y এর নতুন মান আউটপুটে দেখাবে।] (14)

Solution
#include <stdio.h>

int main(void) {
    int x, y;
    if (scanf("%d%d", &x, &y) != 2) return 1;
    printf("Before: x=%d y=%d\n", x, y);
    int temp = x;
    x = y;
    y = temp;
    printf("After: x=%d y=%d\n", x, y);
    return 0;
}
Question 3 Historical: Discrete Mathematics

3. The king, queen and jack of clubs are removed from a deck of 52 playing cards and then shuffled. A card is drawn from the remaining cards. Find the probability of getting. [ক্লাবস এর রাজা, রানী এবং জ্যাক 52 কার্ড থেকে সরানো হলো এবং তারপর কার্ডটি (Shuffle) হলো, যদি একটি কার্ড থেকে টানা হয়। তাহলে নিম্নলিখিত বিষয়ের সম্ভাব্যতা বের কর।] (14)

(i) a heart (ii) '9' of red color

Solution

Club-এর king, queen, jack সরানোর পর card সংখ্যা 49। Heart থাকে 13টি এবং red 9 থাকে 2টি।

\[P(\text{heart})=\frac{13}{49},\qquad P(\text{red nine})=\frac{2}{49}\]

Question 4a Data Structure

4. (a) What are the advantages of linked list over array (static data structure)? [Array এর সুবিধাগুলো কি কি?] (07)

Solution
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 বদলানো যায়

Linked list-এর insertion/deletion সুবিধা node/predecessor আগে থেকে জানা থাকলে প্রযোজ্য; search cost বাদ দেওয়া যাবে না।

Question 4b Data Structure

4. (b) Define and draw binary tree. Find the preorder and postorder traversal of the following tree: [ছবিসহ binary tree এর সংজ্ঞা দাও। নিচে প্রদত্ত tree-টির preorder ও postorder traversal বের কর ।] (07)

Question diagram

Binary Tree-এর সংজ্ঞা

Binary Tree হলো এমন একটি Tree Data Structure, যেখানে প্রতিটি Node-এর সর্বোচ্চ দুইটি child থাকতে পারে। এই দুইটি child-কে সাধারণত Left Child এবং Right Child বলা হয়।

Preorder Traversal

Rule: আগে Root, তারপর প্রতিটি Child left-to-right order-এ visit করতে হয়।

Preorder = L → K → A → B → J → C → I → H → E → D → F → G

Solution

Binary tree-তে প্রতিটি node-এর সর্বোচ্চ দুই child থাকে। Source-এর আঁকা tree-তে L ও H-এর তিনটি child আছে; তাই চিত্রটি general ordered tree। Left-to-right traversal অনুযায়ী:

Preorder:  L K A B J C I H E D F G
Postorder: B A C J K I D E F G H L
Question 5a Operating System

5. (a) Why is CPU scheduling used? Write down its criteria. [CPU scheduling কেন করা হয়? এর Criteria গুলো লিখ ।] (07)

Solution

CPU scheduling ready process-এর মধ্যে CPU বরাদ্দ করে। লক্ষ্য হলো CPU utilization ও throughput বাড়ানো, waiting/turnaround/response time কমানো এবং fairness বজায় রাখা।

Metricসংজ্ঞা
Throughputপ্রতি unit time-এ completed process সংখ্যা
Turnaround timeCompletion time − arrival time
Waiting timeReady queue-এ মোট অপেক্ষা
Response timeপ্রথম CPU service/response time − arrival time
Question 5b Operating System

(b) What are the function of "kernel" ["kernel" এর কাজ কি কি?] (07)

Solution

Operating system হলো system software যা hardware resource পরিচালনা করে এবং application-এর জন্য service দেয়।

  1. Process/CPU scheduling ও process coordination।
  2. Memory allocation, protection ও virtual memory।
  3. File, storage ও I/O device management।
  4. User authentication, access control ও system-call interface।
Question 6a Data Communication & Computer Network

(6) (a) What is MAC address? Write the major disadvantage of star topology? [MAC address কি? Star topology এর প্রধান সমস্যা কি?] (04)

Solution

MAC address network interface-এর link-layer identifier; Ethernet-এ সাধারণত 48-bit। এটি locally administered/spoofed হতে পারে, তাই সব পরিস্থিতিতে স্থায়ী global unique পরিচয় নয়।

Star topology-এর প্রধান দুর্বলতা: central switch/hub নষ্ট হলে তার সঙ্গে যুক্ত node-গুলোর communication বন্ধ হয়।

Question 6b Data Communication & Computer Network

(b) Write the elaborative forms of the following network terms: SMTP, POP, HTTP, DUP, ICMP, DNA, TCP, ARP, RFID and FTP. [নিম্নোক্ত networking terms গুলোর সম্প্রসারিত রূপ লিখঃ SMTP, POP, HTTP, UDP, ICMP, DNS, TCP, ARP, RFID এবং FTP ।] (10)

Solution
TermFull form
SMTPSimple Mail Transfer Protocol
POPPost Office Protocol
HTTPHypertext Transfer Protocol
UDPUser Datagram Protocol
ICMPInternet Control Message Protocol
DNSDomain Name System
TCPTransmission Control Protocol
ARPAddress Resolution Protocol
RFIDRadio-Frequency Identification
FTPFile Transfer Protocol

প্রশ্নের ইংরেজি অংশের DUP ও DNA বানানকে বাংলা অংশ অনুযায়ী UDP ও DNS হিসেবে সংশোধন করা হয়েছে।

Question 7a Database Management

7. (a) What is SQL? A database table is defined as Student (Student ID, Name, Date of Birth, CGPA, Department). Now, write SQL queries to get:

Solution

SQL হলো Structured Query Language।

SELECT * FROM Student WHERE Department = 'CSE';
SELECT * FROM Student WHERE CGPA > 3.0;
Question 7b Database Management

(b) Describe the differences between the terms relation and relation schema [এর মধ্যে পার্থক্য ব্যাখ্যা কর:] (06)

Solution
RelationRelation schema
একটি নির্দিষ্ট সময়ে relation-এর tuples/dataRelation-এর নাম, attributes ও তাদের domains/structure
Insert/update/delete-এ বদলায়Design বদলালে schema বদলায়
Student table-এর বর্তমান rowsStudent(Student_ID, Name, Date_of_Birth, CGPA, Department)
Question 8 Digital Electronics

8. Draw a logic circuit that has three input and one output. If at last two inputs are 1 then the output is 1. [একটি লজিক সার্কিট অংকন কর যার তিনটি ইনপুট ও একটি আউটপুট আছে। যদি কমপক্ষে দুইটি ইনপুট এর মান 1 হয় তবে আউটপুট হয় 1।]

Solution

\[Y=AB+AC+BC\]

ABCY
0000
0010
0100
0111
1000
1011
1101
1111

AB, AC, BC-এর জন্য তিনটি AND gate এবং তাদের output যোগ করতে একটি OR gate ব্যবহার করো।

Question 9a Basic Electricity Incomplete source data

9.(a) What is short-circuit? How to make a short-circuit using the following electrical components? [Short-circuit কি? নিম্নোক্ত ইলেকট্রিক্যাল Component এ Short-circuit কিভাবে করা যাবে? (04)

Question diagram

Solution

Short circuit হলো দুই ভিন্ন potential point-এর মধ্যে খুব কম impedance-এর অনিচ্ছাকৃত path, যার ফলে বড় current হতে পারে। Ideal wire দিয়ে দুই terminal সরাসরি যুক্ত করলে ideal short হয়। প্রশ্নে component arrangement নির্দিষ্ট নয়; battery বাস্তবে short করা বিপজ্জনক।

Question 9b Basic Electricity

9. (b) A battery of unknown e.m.f is connected to a circuit as shown below. The voltage drop across the $8\ \Omega$ resistor is 20 V. What will be the current reading in the ammeter? [একটি অজানা e.m.f ব্যাটারি নিচের চিত্রানুযায়ী সংযুক্ত। $8\ \Omega$ রোধকের voltage drop হলো 20 V। Ammeter এর তড়িৎ প্রবাহ নির্ণয় কর।]

Question diagram

Solution

\[I=20/8=2.5\,\mathrm A\]

Ideal voltmeter ও ammeter ধরে, current 11 Ω এবং (15 + 13) Ω branch-এ ভাগ হয়।

\[I_A=2.5\frac{11}{11+15+13}=\boxed{0.70513\,\mathrm A}\]

Question 10.1 Programming Source ambiguity: see solution note

(i) What will be the output of the following? [নিম্নের প্রোগ্রামটির আউটপুট কি?]

main () {
int i = 1;
char c = 'a';
printf ("%d", i*c) ;
printf ("%d", i*(c+2)) ;
}
  1. A,C
  2. 65,67
  3. 1,3
  4. C,A
Solution

ASCII-তে 'a' = 97 এবং 'c' = 99। দুই printf-এর মধ্যে separator নেই, তাই output 9799; কোনো option সঠিক নয়।

Question 10.2 Programming

(ii) Find the error in the following C++ block of code. [নিম্নোক্ত C++ কোড ব্লকের ভুল নির্ণয় কর।]

if (x = 100)
cout << "x is 100";
  • a. 100 should be enclose in quotation
  • b. There is semicolon at the end of first line
  • c. Equals to operator mistake
  • d. Variable x should be inside quotation
Solution

Comparison-এর জন্য == দরকার; x = 100 একটি valid assignment, কিন্তু intended condition নয়।

Question 10.3 Programming Source ambiguity: see solution note

(iii) What will be the output of the following C program? [নিম্নোক্ত C প্রোগ্রামটির আউটপুট কি?]

main () { int i = 5; printf ("%d", i=++i==6); }
  1. 0
  2. 7
  3. 6
  4. 1
Solution

প্রদত্ত C expression i=++i==6 একই full expression-এ i দুইবার modify করে; C-তে undefined behavior, তাই 1 নিশ্চিত উত্তর নয়।

Question 10.4 Data Communication & Computer Network

(iv) Which class of IP address provides a maximum of only 254 host addresses per network ID? [IP address এর কোন class 254 টি host address প্রতিটি network এ জোগান দেয়?]

  • a. Class A
  • b. Class B
  • c. Class C
  • d. Class D
Solution

Classful Class C-তে /24 এবং 254 usable host address।

Question 10.5 Data Communication & Computer Network

(v) Which one is the feature for simplex transmission? [Simplex transmission এর বৈশিষ্ট্য কোনটি?]

  • a. Data format is simple
  • b. Data transmission is one way
  • c. Data can be transmitted to small distance only
  • d. None of the above
Solution

Simplex-এ data একদিকে যায়।

Question 10.6 Database Management

vi) A key represent relation between tables is called ----- [টেবিল সমূহের মধ্যে রিলেশন তৈরীর জন্য যে key ব্যবহার করা হয় তাকে বলে ----- ]

  • a. Primary key
  • b. Secondary key
  • c. Index key
  • d. Foreign key
Solution

Foreign key referential relationship প্রতিষ্ঠা করে।

Question 10.7 Operating System

(vii) If which scheduling is time quantum defined? [কোন Scheduling এ সময় কোয়ান্টাম ব্যবহৃত হয়?]

  • a. Shortest job first scheduling
  • b. Round robin scheduling
  • c. Priority scheduling
  • d. Multi-level scheduling
Solution

Round-robin scheduling-এ time quantum থাকে।

Question 10.8 Data Structure

(viii) If every $u$ in G is adjacent to every other node $v$ in G, the graph is said to be : [যদি কোন graph G এর প্রতিটি নোড $u$ অন্য সব নোড $v$ এর সাথে সংযুক্ত থাকে তবে তাকে বলেঃ]

  • a. Isolated
  • b. Complete
  • c. Finite
  • d. strongly connected
Solution

সব পৃথক vertex pair adjacent হলে complete graph।

Question 10.9 Microprocessor & Microcomputer

(ix) The microprocessor 8086 has -----. [8086 microprocessor এ আছে -----.]

  • a. 8-bit Data Bus and 8-bit Address Bus
  • b. 8-bit Data Bus and 16-bit Address Bus
  • c. 8-bit Data Bus and 20-bit Address Bus
  • d. 16-bit Data Bus and 20-bit Address Bus
Solution

8086: 16-bit data bus ও 20-bit address bus।

Question 10.10 Digital Electronics

(x) In what state is a silicon diode if voltage drop across it is about 0.7 V? [একটি সিলিকন diode-এ যদি 0.7V ড্রপ হয় তাহলে তার state কি হবে?]

  • a. No bias
  • b. Forward bias
  • c. Reverse
  • d. Zener region
Solution

Silicon diode forward conduction-এ প্রায় 0.7 V model ব্যবহার করা হয়।

Question 10.11 Basic Electricity

(xi) Which consists of two plates separated by a dielectric and can store a charge? [নিচের কোনটি একটি dielectric দ্বারা আলাদাভৃত দুটি প্লেট দ্বারা গঠিত এবং charge সংরক্ষণ করতে পারে?]

  • a. Inductor
  • b. Capacitor
  • c. Transistor
  • d. Relay
Solution

Capacitor dielectric দিয়ে পৃথক conducting plate-এ charge সঞ্চয় করে।

Question 10.12 Digital Electronics

(xii) Which is not MOSFET terminal? [কোনটি MOSFET terminal নয়।]

  • a. Base
  • b. Gate
  • c. Drain
  • d. Source
Solution

MOSFET-এর terminal gate, drain, source এবং body; base BJT-এর terminal।