37th BCS Written Exam 2017 — Question Solution | বিসিএস নিয়োগ পরীক্ষা ২০১৭ — প্রশ্ন সমাধান
- BCS
- 2017
- 7 questions · 0 MCQ, 7 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The 37th BCS Written exam was held in 2017. The paper had 7 written questions. The subjects asked most were Data Structures (2), Programming (2) and Networking (1). 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
- BCS
- Exam date
- 2017
- Questions
- 7 (0 MCQ, 7 written)
- Exam guide
- BCS (ICT and CSE cadre) · বিসিএস (আইসিটি ও সিএসই ক্যাডার)
a) State the protocol of each layer of OSI.
b) Distinguish between TCP and UDP.
c) What is the OSI model? Draw the diagram of the OSI model.
a) Difference between e-commerce and m-commerce.
b) What are the barriers of e-commerce?
c) What is cryptography, and why are cryptography and public key infrastructure important to e-commerce?
a) How does dynamic memory allocation help in managing data?
b) Illustrate singly link list, doubly link list and circular link list with diagram.
a) What is the difference between preemptive and non-preemptive scheduling?
b) What is Aging? Why is it used in an operating system?
a) What is object-oriented programming?
b) What are main features of OOP?
c) How we can solve problem using Abstraction?
Sign up free to see the model answers to written questions 1–5 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
(a) What are objects in C++?
(b) How is a member function of a class defined?
Model answer
(a) Objects in C++
An object is an instance of a class: a variable of a class type. The class is only the design (it lists data members and member functions); memory for the data members is set aside only when an object is created. Every object has:
- state: its own values of the data members,
- behaviour: the member functions it can call,
- identity: its own place in memory, separate from other objects of the same class.
Account a, b; // two objects on the stack
Account *pa = new Account; // an object on the heap, used with ->
pa->open("Nila", 300);
delete pa; // a heap object must be released
Members are reached with the dot operator for an object (a.show()) and the arrow operator for a pointer to an object (pa->show()). Each object gets its own copy of the data members, while the code of the member functions is shared by all objects of the class.
flowchart LR
C["class Account: design only, no data stored"] --> A["object a: holder = Rafi, balance = 5750"]
C --> B["object b: holder = Mitu, balance = 1200"]
(b) Defining a member function
A member function can be defined in two ways.
1. Inside the class body: the whole definition is written in the class. Such a function is automatically treated as inline.
2. Outside the class: only the prototype is written inside the class; the body is written outside using the class name and the scope resolution operator :::
return_type ClassName::functionName(parameter list)
{
function body
}
The ClassName:: part tells the compiler that the function belongs to that class, so it may use the class's private members.
Program showing both ways and two objects
#include <iostream>
#include <string>
using namespace std;
class Account {
private:
string holder;
double balance;
public:
// (i) defined INSIDE the class: implicitly inline
void open(const string &name, double amount) {
holder = name;
balance = amount;
}
void deposit(double amount); // only declared here
void show() const; // only declared here
};
// (ii) defined OUTSIDE the class with the scope resolution operator ::
void Account::deposit(double amount) {
if (amount > 0)
balance += amount;
}
void Account::show() const {
cout << holder << ": Tk " << balance << endl;
}
int main() {
Account a, b; // two objects of class Account
a.open("Rafi", 5000);
b.open("Mitu", 1200);
a.deposit(750); // changes a only
a.show();
b.show();
return 0;
}
Output:
Rafi: Tk 5750
Mitu: Tk 1200
a.deposit(750) changed only a's balance, which shows that each object keeps its own data.
| Point | Defined inside the class | Defined outside the class |
|---|---|---|
| Where the body is written | in the class body | after the class, as Type ClassName::name(...) |
Needs :: |
no | yes |
| Inline | implicitly inline | not inline unless declared inline |
| Best for | short functions | longer functions; keeps the class declaration short |
Common errors: if Account:: is left out, void deposit(double amount) { ... } becomes an ordinary global function, and the compiler reports that balance was not declared in that scope. Writing a.balance = 0; in main is also a compile error, because balance is private. A const member function such as show() const cannot change the object's data.
Exam tip: define an object as "an instance of a class", then show both definitions of a member function (inside the class, and outside with ClassName::) in one short program.
(a) What is the linear data structure?
(b) Why do we use stack? What are the differences between Linked List and Array?
(c) What is merge sort and how it works?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
6 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ৬টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 4 syllabus chapters; Object-Oriented Programming and Arrays & Linked Lists lead, with 2 each. Object-Oriented Programming is asked in 88 other papers too (2015–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- Object-Oriented Programming Programming · 88 other papers, 2015–20262
- Arrays & Linked Lists Data Structures · 38 other papers, 2017–20252
- OSI & TCP/IP Models Networking · 112 other papers, 2012–20261
- CPU Scheduling Operating Systems · 16 other papers, 2018–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 37th BCS Written exam (2017)?
- 7 written questions.
- Which subjects were asked most in the 37th BCS Written exam (2017)?
- Data Structures (2), Programming (2) and Networking (1), out of 7 questions.
- When was the 37th BCS Written exam held?
- In 2017. The exact day isn't in our records.
- Where can I find the 37th BCS Written exam (2017) question solution?
- On this page: 1 of the 7 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