Sheikh Hasina National Institute of Youth Development Instructor Exam 20 May 2023 — Question Solution | শেখ হাসিনা জাতীয় যুব উন্নয়ন ইনস্টিটিউট ইনস্ট্রাক্টর নিয়োগ পরীক্ষা ২০২৩ — প্রশ্ন সমাধান
- Sheikh Hasina National Institute of Youth Development
- Instructor
- 20 May 2023
- 9 questions · 0 MCQ, 9 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The Sheikh Hasina National Institute of Youth Development Instructor exam was held on 20 May 2023. The paper had 9 written questions. The subjects asked most were Programming (4), Software Engineering (2) and Data Structures (1). This page lists every question, with 2 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
- Sheikh Hasina National Institute of Youth Development
- Post
- Instructor
- Exam date
- 20 May 2023
- Questions
- 9 (0 MCQ, 9 written)
- Exam guide
- ICT teaching posts (NTRCA) · আইসিটি শিক্ষক পদ (এনটিআরসিএ)
Write a Program:
a) Sample Output:
1
1 2
1 2 3
b) Sample Output:
Start
Start
Start
Start
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is virtual function?
Model answer
Definition. A virtual function is a member function declared with the keyword virtual in a base class and redefined (overridden) in a derived class. When it is called through a base-class pointer or reference, the version that runs is chosen at run time from the actual type of the object, not from the type of the pointer. This is called dynamic (late) binding and is how C++ achieves run-time polymorphism.
#include <iostream>
using namespace std;
class Employee {
public:
virtual double bonus() const { return 1000; } // virtual: bound at run time
double basic() const { return 20000; } // non-virtual: bound at compile time
virtual ~Employee() {} // virtual destructor for safe delete
};
class Manager : public Employee {
public:
double bonus() const override { return 5000; } // overrides Employee::bonus
double basic() const { return 50000; } // only hides Employee::basic
};
int main() {
Employee *e = new Manager; // base pointer, derived object
cout << "bonus: " << e->bonus() << "\n"; // Manager::bonus (virtual)
cout << "basic: " << e->basic() << "\n"; // Employee::basic (not virtual)
delete e; // runs ~Manager then ~Employee
return 0;
}
Output
bonus: 5000
basic: 20000
e has type Employee* but points to a Manager. bonus() is virtual, so the Manager version runs; basic() is not virtual, so the call is fixed at compile time from the pointer type and the Employee version runs.
| Non-virtual function | Virtual function | |
|---|---|---|
| Binding | static (compile time) | dynamic (run time) |
| Chosen by | type of the pointer/reference | type of the actual object |
| Result above | Employee::basic → 20000 |
Manager::bonus → 5000 |
How it works (typical implementation): each class with virtual functions has a vtable — a table of addresses of its virtual functions — and each object holds a hidden pointer (vptr) to its class's vtable; a virtual call looks up the address through that pointer.
Rules
- The overriding function must have the same name and parameter list; otherwise it only hides the base version.
override(C++11) makes the compiler check this. - Run-time binding happens only through a pointer or reference; a call on an object itself uses that object's own class.
- A virtual function cannot be static, and a constructor cannot be virtual.
- A polymorphic base class should have a virtual destructor, so
deletethrough a base pointer also runs the derived destructor. - A pure virtual function (
virtual double bonus() const = 0;) has no body in the base; a class with one is abstract and cannot be instantiated.
Exam tip: "virtual = decided at run time by the object's type, through a base pointer or reference" — show one program in which a virtual and a non-virtual call give different results.
What is Software testing? Difference between Black box testing and White box testing.
Define copy constructor. What are static binding and dynamic binding?
Sign up free to see the model answers to written questions 3–4 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Define primary key, super key, and Candidate key.
Model answer
Definitions
- Super key: any set of one or more attributes whose values uniquely identify every tuple of a relation (K is a super key of R if K → all attributes of R). It may contain extra, unnecessary attributes.
- Candidate key: a minimal super key: no attribute can be removed from it without losing uniqueness. A relation may have several candidate keys.
- Primary key: the one candidate key the designer chooses as the main identifier of the table. Its values must be unique and NOT NULL. The candidate keys not chosen are called alternate keys.
Worked example: Student(roll_no, email, nid, name, dept), where roll_no, email and nid are each unique for every student, while names and departments can repeat.
| roll_no | nid | name | dept | |
|---|---|---|---|---|
| 1 | rahim1@uni.test | 1000000001 | Rahim | CSE |
| 2 | rahim2@uni.test | 1000000002 | Rahim | CSE |
| 3 | mina@uni.test | 1000000003 | Mina | EEE |
- {name} and {name, dept} are not super keys: rows 1 and 2 share them.
- Super keys: {roll_no}, {email}, {nid}, {roll_no, name}, {email, dept}, {roll_no, email, nid, name, dept}, and so on: every set that contains at least one of roll_no, email or nid. With 5 attributes that is 2⁵ − 2² = 32 − 4 = 28 super keys (all subsets minus those built only from name and dept).
- Candidate keys: {roll_no}, {email}, {nid}. {roll_no, name} is a super key but not a candidate key, because name is redundant.
- Primary key: roll_no (short and stable); email and nid become alternate keys.
CREATE TABLE student (
roll_no INT PRIMARY KEY, -- chosen candidate key
email VARCHAR(60) NOT NULL UNIQUE, -- alternate key
nid CHAR(10) NOT NULL UNIQUE, -- alternate key
name VARCHAR(40),
dept VARCHAR(10)
);
Inserting another student with an existing email is rejected by the UNIQUE constraint, exactly as for a duplicate roll_no.
graph TD
SK["Super keys: every uniquely identifying set"] --> CK["Candidate keys: minimal super keys"]
CK --> PK["Primary key: the one chosen"]
CK --> AK["Alternate keys: candidate keys not chosen"]
| Aspect | Super key | Candidate key | Primary key |
|---|---|---|---|
| Must be minimal? | No | Yes | Yes |
| How many per table | Many | One or more | At most one (the chosen candidate key) |
| Chosen by the designer? | No | No | Yes |
Exam tip: Primary key ⊆ candidate keys ⊆ super keys: every candidate key is a super key but not every super key is a candidate key (minimality decides), and every primary key is a candidate key but not every candidate key is the primary key (the designer decides).
What is function?
Define SDLC? Write the steps of SDLC?
Write down the meaning of: MIME, PNG, JPEG, OSPF
Explain with example Post order traversal.
Sign up free to see the model answers to written questions 6–9 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
7 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ৭টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 8 syllabus chapters; the biggest is Functions & Recursion, in Programming, with 2 questions. Functions & Recursion is asked in 60 other papers too (2016–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- Functions & Recursion Programming · 60 other papers, 2016–20262
- ER Model & Design Database · 101 other papers, 2015–20261
- Object-Oriented Programming Programming · 88 other papers, 2015–20261
- Computer Fundamentals General ICT · 76 other papers, 2011–20261
- Control Flow & Loops Programming · 76 other papers, 2015–20261
- Testing & Quality Software Engineering · 52 other papers, 2016–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 Sheikh Hasina National Institute of Youth Development Instructor exam (2023)?
- 9 written questions.
- Which subjects were asked most in the Sheikh Hasina National Institute of Youth Development Instructor exam (2023)?
- Programming (4), Software Engineering (2) and Data Structures (1), out of 9 questions.
- When was the Sheikh Hasina National Institute of Youth Development Instructor exam held?
- On 20 May 2023.
- Where can I find the Sheikh Hasina National Institute of Youth Development Instructor exam (2023) question solution?
- On this page: 2 of the 9 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