BITAC Assistant Programmer Exam 27 October 2023 — Question Solution | বিটাক সহকারী প্রোগ্রামার নিয়োগ পরীক্ষা ২০২৩ — প্রশ্ন সমাধান
- BITAC
- Assistant Programmer
- 27 October 2023
- 4 questions · 0 MCQ, 4 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The BITAC Assistant Programmer exam was held on 27 October 2023. The paper had 4 written questions. The subjects asked most were Computer Architecture (2) and Programming (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
- BITAC
- Post
- Assistant Programmer
- Exam date
- 27 October 2023
- Questions
- 4 (0 MCQ, 4 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
Write the concept of cache memory in a computer. How does it change the performance of a computer?
What is dual channel RAM? Difference between single In-Line and Dual In-Line Memory Module.
Sign up free to see the model answers to written questions 1–2 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is virtual function with example?
Model answer
A virtual function is a member function declared with the keyword virtual in a base class so that a derived class can override it. When the function is called through a base-class pointer or reference, C++ decides at run time which version to execute, according to the actual type of the object pointed to, not the type of the pointer. This is called dynamic (late) binding and it is how C++ achieves run-time polymorphism.
Rules to remember
- Declared
virtualin the base class; the derived version must have the same name, parameter list andconst-ness (override, C++11, makes the compiler check this). - Run-time selection happens only through a pointer or reference;
obj.f()on an object always calls that object's own class version. - A pure virtual function (
virtual void f() = 0;) has no body in the base class and makes the class abstract (no objects of it can be created). - Constructors cannot be virtual; a base class used polymorphically should have a virtual destructor.
Example
#include <iostream>
using namespace std;
class Vehicle {
public:
virtual void describe() const { // virtual function
cout << "Generic vehicle" << endl;
}
void wheels() const { // NON-virtual, for contrast
cout << "Vehicle: wheels unknown" << endl;
}
virtual ~Vehicle() {} // virtual destructor
};
class Bus : public Vehicle {
public:
void describe() const override { // overrides Vehicle::describe
cout << "Bus: carries passengers" << endl;
}
void wheels() const { // hides, does not override
cout << "Bus: 6 wheels" << endl;
}
};
class Truck : public Vehicle {
public:
void describe() const override {
cout << "Truck: carries goods" << endl;
}
};
int main() {
Bus b;
Truck t;
Vehicle *list[2] = { &b, &t }; // base-class pointers
for (int i = 0; i < 2; i++)
list[i]->describe(); // decided at run time
list[0]->wheels(); // decided at compile time
return 0;
}
Output
Bus: carries passengers
Truck: carries goods
Vehicle: wheels unknown
What happened
| Call | Pointer type | Object type | Binding | Version run |
|---|---|---|---|---|
list[0]->describe() |
Vehicle* |
Bus |
run time (virtual) | Bus::describe() |
list[1]->describe() |
Vehicle* |
Truck |
run time (virtual) | Truck::describe() |
list[0]->wheels() |
Vehicle* |
Bus |
compile time (not virtual) | Vehicle::wheels() |
The same statement list[i]->describe() produces different behaviour for different objects, while the non-virtual wheels() follows the pointer type and ignores the Bus version.
How it works (vtable)
Every class with a virtual function has a virtual table (vtable) of function addresses; each object carries a hidden vptr pointing to its class's vtable. A virtual call follows vptr → vtable → function.
flowchart LR
P["Vehicle* list[0]"] --> O["Bus object (hidden vptr)"]
O --> T["Bus vtable"]
T --> F["Bus::describe()"]
Exam tip: virtual function + override in the derived class + call through a base pointer/reference = run-time polymorphism; without virtual, the pointer's declared type decides the call at compile time.
Write a C code that shows the factorial of a number.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
3 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ৩টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 2 syllabus chapters; Functions & Recursion and Memory Hierarchy & Cache lead, with 2 each. 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
- Memory Hierarchy & Cache Computer Architecture · 52 other papers, 2016–20262
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 BITAC Assistant Programmer exam (2023)?
- 4 written questions.
- Which subjects were asked most in the BITAC Assistant Programmer exam (2023)?
- Computer Architecture (2) and Programming (2), out of 4 questions.
- When was the BITAC Assistant Programmer exam held?
- On 27 October 2023.
- Where can I find the BITAC Assistant Programmer exam (2023) question solution?
- On this page: 1 of the 4 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