DUET CSE 2015-2016 - Previous Year
Reading mode — untimed, no attempt is recorded1. (a) What is token? List different types of token in C++. [টোকেন কি? C++ এর বিভিন্ন প্রকার টোকেন এর তালিকা দাও।] (07)
Token হলো source program-এর ক্ষুদ্রতম meaningful lexical unit। C++ token-এর প্রধান ধরন: keywords, identifiers, literals, operators ও punctuators।
int count = 10;
// int: keyword; count: identifier; 10: literal; =: operator; ;: punctuator
(b) What is polymorphism? Differentiate between method overriding and method overloading? [Polymorphism কি? method overriding এবং method overloading এর মধ্যে পার্থক্য কর।] (07)
Polymorphism হলো একই interface দিয়ে বিভিন্ন ধরনের object-এর উপযুক্ত আচরণ পাওয়া।
- Compile-time: function/operator overloading।
- Run-time: virtual function overriding; base pointer/reference দিয়ে derived implementation চালানো।
- সুবিধা: পুনর্ব্যবহার, সহজ extension এবং কম coupling।
| Overloading | Overriding |
|---|---|
| একই নাম, ভিন্ন parameter list | Derived class-এ matching virtual function-এর implementation |
| Compile-time overload resolution | Virtual dispatch-এ run-time selection |
| Return type একা বদলে overload হয় না | C++-এ override লিখলে signature compiler যাচাই করে |
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)
#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;
}
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
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}\]
4. (a) What are the advantages of linked list over array (static data structure)? [Array এর সুবিধাগুলো কি কি?] (07)
| 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 বদলানো যায় |
Linked list-এর insertion/deletion সুবিধা node/predecessor আগে থেকে জানা থাকলে প্রযোজ্য; search cost বাদ দেওয়া যাবে না।
4. (b) Define and draw binary tree. Find the preorder and postorder traversal of the following tree: [ছবিসহ binary tree এর সংজ্ঞা দাও। নিচে প্রদত্ত tree-টির preorder ও postorder traversal বের কর ।] (07)

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
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
5. (a) Why is CPU scheduling used? Write down its criteria. [CPU scheduling কেন করা হয়? এর Criteria গুলো লিখ ।] (07)
CPU scheduling ready process-এর মধ্যে CPU বরাদ্দ করে। লক্ষ্য হলো CPU utilization ও throughput বাড়ানো, waiting/turnaround/response time কমানো এবং fairness বজায় রাখা।
| Metric | সংজ্ঞা |
|---|---|
| Throughput | প্রতি unit time-এ completed process সংখ্যা |
| Turnaround time | Completion time − arrival time |
| Waiting time | Ready queue-এ মোট অপেক্ষা |
| Response time | প্রথম CPU service/response time − arrival time |
(b) What are the function of "kernel" ["kernel" এর কাজ কি কি?] (07)
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।
(6) (a) What is MAC address? Write the major disadvantage of star topology? [MAC address কি? Star topology এর প্রধান সমস্যা কি?] (04)
MAC address network interface-এর link-layer identifier; Ethernet-এ সাধারণত 48-bit। এটি locally administered/spoofed হতে পারে, তাই সব পরিস্থিতিতে স্থায়ী global unique পরিচয় নয়।
Star topology-এর প্রধান দুর্বলতা: central switch/hub নষ্ট হলে তার সঙ্গে যুক্ত node-গুলোর communication বন্ধ হয়।
(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)
| Term | Full form |
|---|---|
| SMTP | Simple Mail Transfer Protocol |
| POP | Post Office Protocol |
| HTTP | Hypertext Transfer Protocol |
| UDP | User Datagram Protocol |
| ICMP | Internet Control Message Protocol |
| DNS | Domain Name System |
| TCP | Transmission Control Protocol |
| ARP | Address Resolution Protocol |
| RFID | Radio-Frequency Identification |
| FTP | File Transfer Protocol |
প্রশ্নের ইংরেজি অংশের DUP ও DNA বানানকে বাংলা অংশ অনুযায়ী UDP ও DNS হিসেবে সংশোধন করা হয়েছে।
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:
SQL হলো Structured Query Language।
SELECT * FROM Student WHERE Department = 'CSE';
SELECT * FROM Student WHERE CGPA > 3.0;
(b) Describe the differences between the terms relation and relation schema [এর মধ্যে পার্থক্য ব্যাখ্যা কর:] (06)
| Relation | Relation schema |
|---|---|
| একটি নির্দিষ্ট সময়ে relation-এর tuples/data | Relation-এর নাম, attributes ও তাদের domains/structure |
| Insert/update/delete-এ বদলায় | Design বদলালে schema বদলায় |
| Student table-এর বর্তমান rows | Student(Student_ID, Name, Date_of_Birth, CGPA, Department) |
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।]
\[Y=AB+AC+BC\]
| A | B | C | Y |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
AB, AC, BC-এর জন্য তিনটি AND gate এবং তাদের output যোগ করতে একটি OR gate ব্যবহার করো।
9.(a) What is short-circuit? How to make a short-circuit using the following electrical components? [Short-circuit কি? নিম্নোক্ত ইলেকট্রিক্যাল Component এ Short-circuit কিভাবে করা যাবে? (04)

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

\[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}\]
(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)) ;
}- A,C
- 65,67
- 1,3
- C,A
ASCII-তে 'a' = 97 এবং 'c' = 99। দুই printf-এর মধ্যে separator নেই, তাই output 9799; কোনো option সঠিক নয়।
(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
Comparison-এর জন্য == দরকার; x = 100 একটি valid assignment, কিন্তু intended condition নয়।
(iii) What will be the output of the following C program? [নিম্নোক্ত C প্রোগ্রামটির আউটপুট কি?]
main () { int i = 5; printf ("%d", i=++i==6); }- 0
- 7
- 6
- 1
প্রদত্ত C expression i=++i==6 একই full expression-এ i দুইবার modify করে; C-তে undefined behavior, তাই 1 নিশ্চিত উত্তর নয়।
(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
Classful Class C-তে /24 এবং 254 usable host address।
(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
Simplex-এ data একদিকে যায়।
vi) A key represent relation between tables is called ----- [টেবিল সমূহের মধ্যে রিলেশন তৈরীর জন্য যে key ব্যবহার করা হয় তাকে বলে ----- ]
- a. Primary key
- b. Secondary key
- c. Index key
- d. Foreign key
Foreign key referential relationship প্রতিষ্ঠা করে।
(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
Round-robin scheduling-এ time quantum থাকে।
(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
সব পৃথক vertex pair adjacent হলে complete graph।
(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
8086: 16-bit data bus ও 20-bit address bus।
(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
Silicon diode forward conduction-এ প্রায় 0.7 V model ব্যবহার করা হয়।
(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
Capacitor dielectric দিয়ে পৃথক conducting plate-এ charge সঞ্চয় করে।
(xii) Which is not MOSFET terminal? [কোনটি MOSFET terminal নয়।]
- a. Base
- b. Gate
- c. Drain
- d. Source
MOSFET-এর terminal gate, drain, source এবং body; base BJT-এর terminal।