Your next chapter starts hereExplore admission guide

DUET CSE 2016-2017 - Previous Year

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

1. (a) How is a member function of a class defined? [class এর member function এর সংজ্ঞা দাও।] (04)

Solution

Class-এর member function class-এর ভিতরে define করা যায় অথবা বাইরে scope-resolution operator :: দিয়ে define করা যায়।

#include <iostream>

class Counter {
    int value = 0;
public:
    void increment();
    int get() const { return value; }
};
void Counter::increment() { ++value; }
int main() {
    Counter c;
    c.increment();
    std::cout << c.get() << '\n';
}
Question 1b Programming

(b) Consider that a palindrome is a number that displays the same number while showing it either in forward or backward approach. As an example of palindrome: 12321. Write a program in C that takes a 5 digit number as an input and determines whether the input is a palindrome or not. [ধর, palindrome এমন একটি সংখ্যা যা কি না একই রকম দেখায় যখন সোজা/উল্টো যেভাবেই দেখা হোক না কেন। উদাহরণ হিসেবে একটি সংখ্যা হলো : 12321। C ল্যাঙ্গুয়েজ একটি প্রোগ্রাম লিখ যা কিনা 5 ডিজিটের একটি সংখ্যা ইনপুট হিসেবে নিবে এবং ইনপুটটি palindrome কিনা বের করবে।] (10)

Solution
#include <stdio.h>

int main(void) {
    int n, reversed = 0;
    if (scanf("%d", &n) != 1 || n < 10000 || n > 99999) return 1;
    for (int t = n; t != 0; t /= 10)
        reversed = reversed * 10 + t % 10;
    puts(n == reversed ? "Palindrome" : "Not palindrome");
    return 0;
}
Question 2a Historical: Discrete Mathematics

2. (a) The blood groups of 200 people are distributed as follows: 50 have type A blood, 65 have type B blood, 70 have type AB blood, and 15 have type O blood. If a person from this group is selected at random, what is the probability that this person has type O blood? [200 জন লোকের রক্তের গ্রুপ এরকম : 50 জন A গ্রুপের, 65 জন B গ্রুপের, 70 জন AB গ্রুপের এবং 15 জন O গ্রুপের। এদের মধ্যে দৈবভাবে একজনকে নির্বাচন করলে তার রক্তের গ্রুপ O হওয়ার সম্ভাবনা কত?] (06)

Solution

\[P(O)=15/200=\boxed{3/40=0.075}\]

Question 2b Historical: Discrete Mathematics

2. (b) Suppose A & B are two sets and |A| = 140, |B| = 90.

(i) Find \(\mathbf{\text{A\ }}\mathbf{\cup}\mathbf{B}\) when it is given that \(\left| \mathbf{A}\mathbf{\cap}\mathbf{B} \right|\mathbf{= 36}\)

(ii) Find \(\mathbf{\text{A\ }}\mathbf{\cap}\mathbf{B}\) when it is given that \(\left| \mathbf{A}\mathbf{\cup}\mathbf{B} \right|\mathbf{= 150}\)

[মনে কর, A ও B দুইটি সেট এবং \(\left| A \right| = 140,\left| B \right| = 90\); যদি \(\left| A \cap B \right| = 36\) হয়, তবে \(\left| A \cup B \right|\) বের কর। যদি \(\left| A \cup B \right| = 150\) হয়, তবে \(\left| \text{A } \cap \text{ B} \right|\) বের কর।] (08)

Solution

\[|A\cup B|=|A|+|B|-|A\cap B|\]

\[\text{(i)}\quad|A\cup B|=140+90-36=194\]

\[\text{(ii)}\quad|A\cap B|=140+90-150=80\]

Question 3a Data Structure

3. (a) How does dynamic memory allocation help in managing data? [ডাটা ব্যবস্থাপনায় dynamic memory allocation কিভাবে সাহায্য করে?] (06)

Solution

Dynamic memory allocation runtime-এ প্রয়োজনমতো heap memory নেয় এবং কাজ শেষে release করে। Variable-size arrays ও linked structures তৈরি করা যায়।

C-তে malloc/calloc/realloc এবং free ব্যবহার হয়। Allocation failure পরীক্ষা এবং ownership সঠিকভাবে পরিচালনা না করলে leak বা dangling pointer হতে পারে।

Question 3b Data Structure

3. (b) Which data structure does use recursion with LIFO operation? Convert the infix expression ((A + B * C - (D - E) ∧ (F + G)) to equivalent prefix and postfix expressions. [কোন data structure recursion এর সাথে LIFO অপারেশন ব্যবহার করে? প্রদত্ত infix expression ((A + B * C - (D - E) (F + G)) এর prefix এবং postfix expression বের কর।] (08)

Solution

Recursion-এর call/return context stack-এ LIFO order-এ থাকে। Source-এ একটি অতিরিক্ত opening parenthesis আছে; intended expression \(A+B*C-(D-E)^{(F+G)}\) ধরে:

Postfix: A B C * + D E - F G + ^ -
Prefix:  - + A * B C ^ - D E + F G

Multiplication addition-এর আগে হয়। এখানে ^ exponent বোঝাচ্ছে; C-তে ^ হলো bitwise XOR।

Question 4a Database Management

4. (a) What is relational algebra? [Relational algebra কী?] (05)

Solution

Relational algebra হলো relation-এর ওপর operations দিয়ে query প্রকাশের formal procedural language; প্রতিটি operation relation ফেরত দেয়।

Operationকাজ
Selection \(\sigma\)শর্ত অনুযায়ী rows
Projection \(\pi\)নির্দিষ্ট columns
Union / differenceSet combination / subtraction
Cartesian productসব tuple pair
Joinশর্ত পূরণকারী tuple pair
RenameRelation/attribute-এর নাম পরিবর্তন
Question 4b Database Management

4. (b) Consider the relational database:

Account (branch, acc_no, balance)

Depositor (cust_name, acc_no)

Customer (cust_name, cust_st, cust_city)

Give an expression in SQL for each of the following queries: [উপরোক্ত রিলেশনাল ডাটাবেজের সাপেক্ষে নিম্নোক্ত query গুলোর জন্য SQL expression লিখ:]

(i) Find the branch name where the average account balance is more than Tk. 1200 [সকল শাখার নাম বের কর যাদের গড় ব্যালেন্স Tk. 1200 এর চেয়ে বেশি]

(ii) Find names of all customers whose street address include the substring 'main'. [সকল গ্রাহকের নাম বের কর যাদের স্ট্রিট অ্যাড্রেস এ 'main' সাবস্ট্রিং আছে।]

(iii) Find the average balance for each customer who has at least 3 Accounts.

lives in 'XYZ' city. [সকল গ্রাহকের গড় ব্যালেন্স বের কর যাদের কমপক্ষে একাউন্ট আছে এবং যারা 'XYZ' সিটিতে বাস করে ।] (09)

Solution
-- (i)
SELECT branch FROM Account
GROUP BY branch HAVING AVG(balance) > 1200;

-- (ii)
SELECT cust_name FROM Customer
WHERE cust_st LIKE '%main%';

-- (iii)
SELECT c.cust_name, AVG(a.balance) AS average_balance
FROM Customer AS c
JOIN Depositor AS d ON d.cust_name = c.cust_name
JOIN Account AS a ON a.acc_no = d.acc_no
WHERE c.cust_city = 'XYZ'
GROUP BY c.cust_name
HAVING COUNT(DISTINCT a.acc_no) >= 3;
Question 5a Historical: Software Development

5. (a) Give full form of SDLC and mention different phases of SDLC . [SDLC এর পূর্ণরূপ লিখ এবং SDLC এর বিভিন্ন ধাপগুলো লিখ ।] (07)

Solution

SDLC = System Development Life Cycle।

  1. Planning ও feasibility
  2. Requirements analysis
  3. Design
  4. Implementation
  5. Testing
  6. Deployment
  7. Maintenance
Question 5b Historical: Software Development

5. (b) Define system. State the key elements of a system. [System এর সংজ্ঞা দাও। System এর element গুলো উল্লেখ কর ।] (07)

Solution

System হলো নির্দিষ্ট লক্ষ্য অর্জনে পরস্পর-সম্পর্কযুক্ত উপাদানের সমষ্টি।

  1. Input
  2. Processing
  3. Output
  4. Control ও feedback
  5. Boundary, environment ও interface
Question 6a Operating System

6. (a) What are the states of process? [Process এর state গুলো কী কী ।] (07)

Solution

Process হলো execution-এ থাকা program।

Stateঅর্থ
Newতৈরি হচ্ছে
ReadyCPU পাওয়ার অপেক্ষা
RunningCPU-তে চলছে
Waiting/blockedI/O/event-এর অপেক্ষা
TerminatedExecution শেষ

প্রধান transition: New → Ready → Running; Running → Ready (preemption), Running → Waiting (I/O), Waiting → Ready (event complete), Running → Terminated।

Question 6b Operating System

6. (b) What is aging technique of process ? Why is it used in OS?. [প্রসেস এর aging technique কী? কেন এটি OS এ ব্যবহৃত হয়?] (07)

Solution

Aging হলো দীর্ঘ সময় অপেক্ষা করা process-এর priority ধীরে বাড়ানো। এতে low-priority process-এর starvation কমে।

Question 7a Microprocessor & Microcomputer

7. (a) Mention the register names of 8086 microprocessor. [8086 মাইক্রোপ্রসেসর এর রেজিস্টারসমূহের নাম উল্লেখ কর ।] (07)

Solution
GroupRegisters
General dataAX, BX, CX, DX
Pointer/indexSP, BP, SI, DI
SegmentCS, DS, SS, ES
Instruction pointerIP
Status/controlFLAGS

সবগুলো 16-bit; AX/BX/CX/DX-এর high ও low 8-bit অংশ আলাদাভাবে access করা যায়।

Question 7b Digital Electronics

7. (b) Explain why diodes are not operated in the breakdown region in rectifiers? [ব্যাখ্যা কর কেন rectifier এর breakdown অঞ্চলে diode কাজ করে না।] (07)

Solution

সাধারণ rectifier diode reverse half-cycle-এ block করবে। Reverse breakdown-এ অতিরিক্ত current ও heating diode নষ্ট করতে পারে, তাই peak inverse voltage rating মানতে হয়। Zener/avalanche diode-এর controlled breakdown operation আলাদা application।

Question 8a Data Communication & Computer Network

8. (a) What are different ways of securing a computer network? [কম্পিউটার নেটওয়ার্ক এর নিরাপত্তার বিভিন্ন পন্থাগুলো কী কী?] (06)

Solution
  1. Strong authentication, least privilege ও access control।
  2. Firewall ও network segmentation।
  3. Traffic encryption (TLS/VPN)।
  4. System patching ও secure configuration।
  5. Monitoring/IDS, logging ও incident response।
  6. Backups এবং user awareness।
Question 8b Data Communication & Computer Network

8. (b) Suppose a computer network has 2 LANs: LAN-1 having 511 users and LAN-2 having 254 users. You have given an IPv4 address block of 172.16.0.0/16. By doing subnetting, you have to calculate the Network Address, Broadcast Address and Subnet Mask for both LANs. [মনে কর, একটি কম্পিউটার নেটওয়ার্কে 2টি LAN আছে: LAN-1এ 511জন user এবং LAN-2 এ 254 জন user। তোমাকে একটি IPv4 Address block দেয়া হল। এখন, Subnetting করে LAN গুলোর Network Address, Broadcast Address এবং Subnet Mask বের কর।] (08)

Solution

বড় LAN আগে allocate করতে হবে।

\[2^9-2=510<511,\quad2^{10}-2=1022\ge511\]

LANNetworkMaskBroadcastUsable range
LAN-1 (511)172.16.0.0/22255.255.252.0172.16.3.255172.16.0.1 - 172.16.3.254
LAN-2 (254)172.16.4.0/24255.255.255.0172.16.4.255172.16.4.1 - 172.16.4.254
Question 9a Digital Electronics Source ambiguity: see solution note

9. (a) Suppose, the given Sum of product (SOP) is \(\mathbf{X =}\overline{\mathbf{A}\overline{\mathbf{B}}}\mathbf{C +}\overline{\mathbf{A}}\mathbf{BC + AB}\overline{\mathbf{C}}\). Now, Draw its corresponding truth table. [মনে কর, $ \(\mathbf{X =}\overline{\mathbf{A}\overline{\mathbf{B}}}\mathbf{C +}\overline{\mathbf{A}}\mathbf{BC + AB}\overline{\mathbf{C}}\mathbf{\ }\)Sum of Product (SOP) এ দেওয়া আছে। এখন, এর অনুরূপ Truth table বের কর।] (07)

Solution

প্রশ্নের nested overbar আক্ষরিকভাবে পড়লে:

\[X=\overline{A\bar B}C+\bar ABC+AB\bar C\]

\[=(\bar A+B)C+\bar ABC+AB\bar C=\bar AC+BC+AB\bar C=\boxed{AB+\bar AC}\]

Equivalent POS:

\[X=(A+C)(\bar A+B)\]

ABCX
0000
0011
0100
0111
1000
1010
1101
1111

যদি প্রথম term-এ শুধু B-এর ওপর bar বোঝানো হয়, expression আলাদা হবে। এখানে document-এর দৃশ্যমান outer bar রাখা হয়েছে।

Question 9b Digital Electronics

9. (b) The base current and emitter current of transistor are 0.08 mA and 9.6 mA. Calculate \(\mathbf{\alpha}_{\mathbf{\text{dc}}}\) \(\mathbf{\beta}_{\mathbf{\text{dc}}}\) এর মান বের কর । (07)

Solution

\[I_C=I_E-I_B=9.6-0.08=9.52\,\mathrm{mA}\]

\[\alpha_{dc}=\frac{I_C}{I_E}=\frac{9.52}{9.6}\approx0.9917,\qquad\beta_{dc}=\frac{I_C}{I_B}=\frac{9.52}{0.08}=119\]

Question 10.1 Computer Fundamentals

i) What is POST? [Post কী?]

  • a. Power On Self Test
  • b. Property Of Self Test
  • c. Power Off Switch Time
  • d. Power On Switch Test
Solution

POST = Power-On Self-Test।

Question 10.2 Programming

ii) What will be the output if you will compile and execute the following C code? [ নিচের C কোড কম্পাইল ও এক্সিকিউট করলে কি আউটপুট দিবে?]

Void main (){
Const int i = 5 ;
i++;
printf("% d ",i);
}
  • a. 5
  • b. 6
  • c. 0
  • d. Compiler error
Solution

const object increment করা বৈধ নয়; source-এর Void/Const capitalization-ও ভুল।

Question 10.3 Data Structure

iii) Where is LIFO actually used? [LIFO কোথায় ব্যবহৃত হয়?]

  • a. Queue
  • b. Stack
  • c. Linked List
  • d. Tree
Solution

Stack LIFO অনুসরণ করে।

Question 10.4 Programming

iv) Which of the following is not supported by Java? [নিচের কোনটি Java সাপোর্ট করে না?]

  • a. Signed number
  • b. Unsigned number
  • c. Signed right shift
  • d. Unsigned right shift
Solution

Expected answer: unsigned integer type যেমন unsigned int নেই; Java-তে char unsigned এবং unsigned arithmetic helpers আছে। Signed >> ও unsigned >>> দুটিই supported।

Question 10.5 Programming

v) In C language, which function is used to read data fron keybord?[C ল্যাঙ্গুয়েজের কোন ফাংশনটি কিবোর্ড থেকে ডাটা নেয়ার জন্য ব্যবহার করা হয়?]

  • a. printf ()
  • b. scanf ()
  • c. void ()
  • d. main ()
Solution

scanf standard input থেকে formatted data পড়ে।

Question 10.6 Data Communication & Computer Network

vi) The direct connection is made between sendet and receiver so data can be transmitted: [প্রেরক ও প্রাপকের মধ্যে ডাটা সঞ্চালনের জন্য সরাসরি সংযোগ তৈরি হয়:]

  • a. Packet Switching
  • b. Message Switching
  • c. Circuit Switching
  • d. Data Switching
Solution

Circuit switching-এ dedicated communication path স্থাপন হয়।

Question 10.7 Programming

vii) Variable which can be acccssed by all modules of the program is called- [যে variable প্রোগ্রামের সব মডিউল অ্যাকসেস করতে পারে তাকে বলে-]

  • a. Global variable
  • b. Local variable
  • c. static variable
  • d. Auto variable
Solution

Global variable, declaration ও linkage-এর scope সাপেক্ষে।

Question 10.8 Programming

viii) What is the following declaration for? [নিচের declaration টি কী জন্যে?] int(*α) [10];

  • a. Pointer to an array of 10 integers.
  • b. Array of 10 function pointer returning int.
  • c. A pointer ot function retuning an array of 10 integers.
  • d. Array of 10 integer pointer.
Solution

int (*p)[10] হলো 10 integer-এর array-এর pointer।

Question 10.9 Data Communication & Computer Network

ix) Which one of the following is the WiFi standard? [নিচের কোনটি WiFi standerd?]

  • a. IEEE 802.1
  • b. IEEE 802.3
  • c. IEEE 802.11
  • d. IEEE 802.15
Solution

Wi-Fi IEEE 802.11 family-এর ওপর ভিত্তি করে।

Question 10.10 Database Management

x) If we write a program in a programming language and switch to SQL when we require to use the database , then the SQL environment in use is know as [যদি আমরা যেকোন প্রোগ্রামিং ল্যাঙ্গুয়েজে একটি প্রোগ্রাম লিখি এবং তা database এর প্রয়োজনে SQL এর সাথে যুক্ত করি তখন তাকে বলে-]

  • a. PL SQL
  • b. Embedded SQL
  • c. Dynamic SQL
  • d. Real-time SQL
Solution

Host language-এর মধ্যে SQL ব্যবহার: embedded SQL।

Question 10.11 Digital Electronics

x) Dual role of NAND function is- [NAND ফাংশন এর DUAL হলো-]

  • a. AND function
  • b. OR function
  • c. NOR function
  • d. NAND function
Solution

Dual-এ AND ও OR অদলবদল হয়: NAND-এর dual NOR।