BUET M.Sc. Admission Department of CSE Exam 2019 — Question Solution | বুয়েট এমএসসি ভর্তি নিয়োগ পরীক্ষা ২০১৯ — প্রশ্ন সমাধান
- BUET M.Sc. Admission
- 2019
- 16 questions · 0 MCQ, 16 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The BUET M.Sc. Admission Department of CSE exam was held in 2019. The paper had 16 written questions. The subjects asked most were Data Structures (3), Algorithms (2) and Operating Systems (2). This page lists every question, with 1 answered and explained; the rest of the answers open with a free ARBS Academy account, where the paper can also be practised as a timed test.
বুয়েট এমএসসি ভর্তি নিয়োগ পরীক্ষার (২০১৯) এই প্রশ্নপত্রে ১৬টি প্রশ্ন ছিল, বেশিরভাগ ডেটা স্ট্রাকচার ও অ্যালগরিদম থেকে। এখানে ১টি প্রশ্নের ব্যাখ্যাসহ উত্তর দেওয়া আছে; বাকিগুলো ফ্রি অ্যাকাউন্টে খোলে।
- Organisation
- BUET M.Sc. Admission
- Exam date
- 2019
- Questions
- 16 (0 MCQ, 16 written)
- Exam guide
- M.Sc. admission (CSE and ICT) · এমএসসি ভর্তি (সিএসই ও আইসিটি)
- Data Structures · ডেটা স্ট্রাকচার 3
- Algorithms · অ্যালগরিদম 2
- Operating Systems · অপারেটিং সিস্টেম 2
- Programming · প্রোগ্রামিং 2
- Cloud & Emerging Tech · ক্লাউড ও উদীয়মান প্রযুক্তি 1
- Computer Architecture · কম্পিউটার আর্কিটেকচার 1
- Digital Logic · ডিজিটাল লজিক 1
- Mathematics · গণিত 1
- Microprocessor · মাইক্রোপ্রসেসর 1
- Networking · নেটওয়ার্কিং 1
- Software Engineering · সফটওয়্যার ইঞ্জিনিয়ারিং 1
Write a function for decimal to binary representation without using any arithmetic operator. Only use the while loop and logical operators. Assume that 32-bit memory is used. If n = 12, the output is 0000 0000 0000 0000 0000 0000 0000 1100
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Why do we use try-with-resources in a program?
Model answer
try-with-resources (Java 7 and later) is a try statement that declares one or more resources in brackets after try. Every resource must implement java.lang.AutoCloseable (or its sub-interface java.io.Closeable). Java closes each resource automatically when the block ends, whether it ends normally or by an exception, so no finally { close(); } is needed.
Why it is used
- No resource leaks: files, sockets, streams and database connections are always closed, even when an exception is thrown halfway.
- Less code: no
finallyblock, noif (r != null)check, no nestedtryaroundclose(). - Correct exceptions: if the block throws and
close()also throws, the block's exception is the one thrown and theclose()exception is attached to it as a suppressed exception (getSuppressed()). With a plaintry-finally, an exception thrown byclose()infinallyreplaces the original one, so the real error is lost. - Order: several resources are closed in the reverse order of opening; any
catchorfinallyruns only after the resources are closed.
flowchart TD
A["try (resources): open each resource in order"] --> B["Run the try block"]
B --> C{"Exception in the block?"}
C -- "No" --> D["close() each resource in reverse order"]
C -- "Yes" --> E["close() each resource in reverse order; a close() exception becomes suppressed"]
D --> F["catch / finally run after closing (if present)"]
E --> F
Example
class Ledger implements AutoCloseable {
private final String name;
private final boolean failOnClose;
Ledger(String name, boolean failOnClose) {
this.name = name;
this.failOnClose = failOnClose;
System.out.println("open " + name);
}
void write(int amount) {
if (amount < 0)
throw new IllegalArgumentException("negative amount " + amount);
System.out.println(name + " <- " + amount);
}
@Override
public void close() {
System.out.println("close " + name);
if (failOnClose)
throw new IllegalStateException("cannot close " + name);
}
}
public class LedgerDemo {
public static void main(String[] args) {
// 1. normal run: two resources, closed in reverse order
try (Ledger cash = new Ledger("cash", false);
Ledger bank = new Ledger("bank", false)) {
cash.write(500);
bank.write(900);
}
// 2. body throws AND close() throws: body exception is kept
try (Ledger log = new Ledger("log", true)) {
log.write(-70);
} catch (IllegalArgumentException e) {
System.out.println("caught: " + e.getMessage());
for (Throwable s : e.getSuppressed())
System.out.println("suppressed: " + s.getMessage());
}
// 3. same failure with try-finally: body exception is lost
Ledger old = new Ledger("old", true);
try {
try {
old.write(-70);
} finally {
old.close();
}
} catch (RuntimeException e) {
System.out.println("caught: " + e.getMessage());
}
}
}
Output
open cash
open bank
cash <- 500
bank <- 900
close bank
close cash
open log
close log
caught: negative amount -70
suppressed: cannot close log
open old
close old
caught: cannot close old
Reading the output
- Part 1:
bankis closed beforecash(reverse order), with noclose()call written. - Part 2:
logis closed before thecatchruns; the body's exception is caught and theclose()failure is kept as suppressed. - Part 3: the same failure with
try-finallyreports onlycannot close old; the real errornegative amount -70is lost.
| try-finally | try-with-resources | |
|---|---|---|
| Closing | written by hand in finally |
automatic |
close() throws after the body threw |
body's exception lost | body's exception kept, close() one suppressed |
| Several resources | nested try blocks |
one try (...; ...), closed in reverse order |
From Java 9 an existing final or effectively final variable can be listed directly, e.g. try (in) { ... }. A type that is not AutoCloseable is rejected at compile time (try-with-resources not applicable to variable type).
Exam tip: use try-with-resources for anything AutoCloseable: it guarantees close(), closes in reverse order and keeps the original exception while recording close() failures as suppressed.
If the statement is (p∨q)⇒(p∧q), then write the inverse, converse and contrapositive statements.
How much time swapping of the given program when left child is smaller than the right child.
void heapify(int a[], int n, int i) {
int left = 2*i + 1;
int right = 2*i + 2;
int smallest = i;
if (left < n && a[left] < a[smallest])
smallest = left;
if (right < n && a[right] < a[smallest])
smallest = right;
if (smallest != i) {
int temp = a[i];
a[i] = a[smallest];
a[smallest] = temp;
heapify(a, n, smallest);
}
}
Draw the flag register of the 8086 microprocessors.
Draw the multiplexer for the function F= (x+y)+w+xy.
Write down the difference between Phong shading and Gouraud shading?
Write the subroutine for the Quick sort.
Determine the addressing mode to the right column of the table?
| Instruction | Addressing Mode |
|---|---|
| MOV AX, BX | |
| MOV AX, 2000 | |
| MOV AX, [0500] | |
| MOV AX, [BX+DI] | |
| MOV AL, [SI+BP+2000] |
Let us consider a simple hash function as "key mod 11" and a sequence of keys as 11, 54, 77. When a collision occurs, store the key using quadratic probing.
Write down the names of the process states.
What is the necessary condition for Deadlock?
Sign up free to see the model answers to written questions 3–12 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Write down the difference between Genetic algorithm and traditional algorithm.
Delete a value from a heap tree.
Draw the diagram with protocol name for email sending and receive.
What are context class, entity class and boundary class?
Sign up free to see the model answers to written questions 13–16 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
15 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ১৫টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 14 syllabus chapters; the biggest is Trees, in Data Structures, with 2 questions. Trees is asked in 47 other papers too (2015–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- Trees Data Structures · 47 other papers, 2015–20262
- Language Basics & Syntax Programming · 122 other papers, 2015–20261
- OSI & TCP/IP Models Networking · 112 other papers, 2012–20261
- CPU Organization Computer Architecture · 77 other papers, 2011–20261
- Sorting Algorithms · 59 other papers, 2013–20261
- Processes & Threads Operating Systems · 55 other papers, 2011–20261
From our own past papers: each question filed under one syllabus chapter. Practice and held questions are not counted.
Questions about this paper · সাধারণ প্রশ্ন
- How many questions were in the BUET M.Sc. Admission Department of CSE exam (2019)?
- 16 written questions.
- Which subjects were asked most in the BUET M.Sc. Admission Department of CSE exam (2019)?
- Data Structures (3), Algorithms (2) and Operating Systems (2), out of 16 questions.
- When was the BUET M.Sc. Admission Department of CSE exam held?
- In 2019. The exact day isn't in our records.
- Where can I find the BUET M.Sc. Admission Department of CSE exam (2019) question solution?
- On this page: 1 of the 16 questions are shown with worked answers. The rest of the answers open with a free ARBS Academy account, where the paper can also be practised as a timed test.
Question text is from the public recruitment exam; answers and explanations are written by ARBS Academy. All past papers