37th BCS Written Test: 2017প্রশ্ন ও সমাধান
- Set by
- BCS
- Exam date
- 2017
- Questions
- 6 (0 MCQ, 6 written)
- Exam guide
- BCS (ICT and CSE cadre) · বিসিএস (আইসিটি ও সিএসই ক্যাডার)
- Data Structures · ডেটা স্ট্রাকচার 2
- Networking · নেটওয়ার্কিং 1
- Operating Systems · অপারেটিং সিস্টেম 1
- Programming · প্রোগ্রামিং 1
- Web Technology · ওয়েব টেকনোলজি 1
a) State the protocol each layer of OSI.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
a) Difference between e-commerce and m-commerce.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
a) How does dynamic memory allocation help in managing data?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
a) What is the difference between preemptive and non-preemptive scheduling?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
a) What are objects in C++?
Model answer
An object in C++ is a concrete instance of a class — it occupies actual memory and holds real values for the class's data members, while the class itself is only a blueprint/template with no memory until instantiated.
#include <iostream>
using namespace std;
class Car {
public:
string model;
int speed;
void display() {
cout << model << " running at " << speed << " km/h" << endl;
}
};
int main() {
Car c1; // c1 is an object of class Car
c1.model = "Sedan";
c1.speed = 120;
c1.display();
Car c2; // a second, independent object
c2.model = "SUV";
c2.speed = 100;
c2.display();
return 0;
}
Sample output:
Sedan running at 120 km/h
SUV running at 100 km/h
Key points:
- Each object has its own copy of data members (
c1.speedis independent ofc2.speed) but shares the class's member functions. - Objects can be created on the stack (
Car c1;) or the heap (Car *c3 = new Car();), the latter requiringdeleteto free memory. - A class can have any number of objects, each with a distinct identity and state.
Exam takeaway: class = blueprint (no memory); object = instance of that blueprint (occupies memory, has state) — the same relationship as a "recipe" vs "the actual dish cooked from it."
a) What is the linear data structure?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Question text is from the public recruitment exam; answers and explanations are written by ARBS Academy. All past papers · BCS (ICT and CSE cadre) guide