DESCO Assistant Engineer Exam 20 May 2023 — Question Solution | ডেসকো সহকারী প্রকৌশলী নিয়োগ পরীক্ষা ২০২৩ — প্রশ্ন সমাধান
- DESCO
- Assistant Engineer
- 20 May 2023
- 5 questions · 0 MCQ, 5 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The DESCO Assistant Engineer exam was held on 20 May 2023. The paper had 5 written questions. The subjects asked most were Programming (2), Database (1) and Networking (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
- DESCO
- Post
- Assistant Engineer
- Exam date
- 20 May 2023
- Questions
- 5 (0 MCQ, 5 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
Write a Program:
a) Sample Output:
1
12
123
1234
b) Write a C or C++ Program to print an array of five fruits.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explain the various types of access specifiers.
Model answer
Access specifiers (access modifiers) are keywords that decide from where a class member (data or method) can be used. They put encapsulation into practice: internal data is hidden and only a controlled interface is exposed.
The common specifiers
- public – accessible from anywhere: inside the class, in derived classes and from outside code (through an object). Used for the class's interface.
- private – accessible only inside the class itself (in C++ also by its
friendfunctions/classes). Not accessible in derived classes or outside. Used to hide data. - protected – accessible inside the class and in its derived (sub) classes, but not from unrelated outside code. In Java, protected members are also visible to every class in the same package.
- default / package-private (Java only) – written with no keyword; the member is visible only to classes in the same package.
C++ (three specifiers)
| Specifier | Same class | Derived class | Outside the class |
|---|---|---|---|
| public | Yes | Yes | Yes |
| protected | Yes | Yes | No |
| private | Yes | No | No |
If nothing is written, members of a class are private and members of a struct are public.
Java (four levels)
| Modifier | Same class | Same package | Subclass in another package | Other packages |
|---|---|---|---|---|
| public | Yes | Yes | Yes | Yes |
| protected | Yes | Yes | Yes (through inheritance) | No |
| default (no keyword) | Yes | Yes | No | No |
| private | Yes | No | No | No |
Example (C++)
#include <iostream>
using namespace std;
class Account {
private:
double balance; // only Account's own members can use this
protected:
int branchCode; // Account + classes derived from it
public:
Account() : balance(500.0), branchCode(101) {}
double getBalance() const { return balance; } // open interface
};
class SavingsAccount : public Account {
public:
void show() const {
cout << "Branch: " << branchCode << endl; // OK: protected
// cout << balance; // ERROR: balance is private in Account
}
};
int main() {
SavingsAccount s;
s.show();
cout << "Balance: " << s.getBalance() << endl; // OK: public
// s.branchCode = 5; // ERROR: protected, not accessible here
// s.balance = 0; // ERROR: private
return 0;
}
Output
Branch: 101
Balance: 500
If any of the commented lines is enabled, the compiler reports that balance is private or branchCode is protected "within this context", so the program does not compile.
Access specifiers in C++ inheritance
With class Derived : public Base, public members stay public and protected stay protected; with protected inheritance both become protected; with private inheritance both become private. Private members of the base are not directly accessible in the derived class under any inheritance mode (only if the base declares the derived class a friend).
Exam tip: order from most to least open is public > protected > default (Java) > private; give each member the tightest access that still lets the program work.
What are the different types of join in SQL?
Model answer
Answer: A join combines rows of two or more tables on a related column. The main types are INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, FULL OUTER JOIN, CROSS JOIN and SELF JOIN; NATURAL JOIN and equi/non-equi (theta) joins are forms of the inner join.
Sample data
department: (10, Accounts), (20, IT), (30, Audit), where Audit has no employee.
| emp_id | emp_name | dept_id | salary | manager_id |
|---|---|---|---|---|
| 1 | Rahim | 20 | 90000 | NULL |
| 2 | Nusrat | 20 | 70000 | 1 |
| 3 | Tanvir | 10 | 65000 | 1 |
| 4 | Mitu | NULL | 50000 | 3 |
| 5 | Jamal | 10 | 72000 | 3 |
erDiagram
DEPARTMENT |o--o{ EMPLOYEE : "employs"
EMPLOYEE |o--o{ EMPLOYEE : "manages"
An employee may have no department (Mitu) and a department may have no employee (Audit); each employee has zero or one manager.
| Join (algebra) | Returns | Rows here |
|---|---|---|
| INNER JOIN (⋈) | Only rows that match in both tables | 4 (Mitu and Audit missing) |
| LEFT OUTER JOIN (⟕) | All left rows + matches; NULL where no match | 5 (Mitu with NULL department) |
| RIGHT OUTER JOIN (⟖) | All right rows + matches; NULL where no match | 5 (Audit with NULL employee) |
| FULL OUTER JOIN (⟗) | All rows of both tables | 6 (Mitu and Audit both present) |
| CROSS JOIN (×) | Cartesian product, no condition | 5 × 3 = 15 |
| SELF JOIN | A table joined to itself through aliases | 4 employee–manager pairs |
-- INNER: employees with their department
SELECT e.emp_name, d.dept_name
FROM employee e INNER JOIN department d ON e.dept_id = d.dept_id;
-- Rahim IT, Nusrat IT, Tanvir Accounts, Jamal Accounts
-- LEFT: all employees, department or NULL
SELECT e.emp_name, d.dept_name
FROM employee e LEFT JOIN department d ON e.dept_id = d.dept_id;
-- the 4 rows above + Mitu NULL
-- RIGHT: all departments, employee or NULL
SELECT e.emp_name, d.dept_name
FROM employee e RIGHT JOIN department d ON e.dept_id = d.dept_id;
-- the 4 matched rows + NULL Audit
-- FULL OUTER: everything from both sides
SELECT e.emp_name, d.dept_name
FROM employee e FULL OUTER JOIN department d ON e.dept_id = d.dept_id;
-- 4 matched rows + Mitu NULL + NULL Audit
-- CROSS: every employee with every department
SELECT COUNT(*) FROM employee CROSS JOIN department; -- 15
-- SELF: each employee with the manager's name
SELECT w.emp_name AS employee, m.emp_name AS manager
FROM employee w JOIN employee m ON w.manager_id = m.emp_id;
-- Nusrat-Rahim, Tanvir-Rahim, Mitu-Tanvir, Jamal-Tanvir
- Equi join: the condition uses
=. Non-equi (theta) join: it uses<,>,BETWEEN, e.g. matching a salary to a pay-grade range. - NATURAL JOIN: an equi-join on all columns with the same name (here dept_id), with that column shown once; same 4 rows as the inner join.
- DBMS notes: MySQL has no FULL OUTER JOIN (emulate it with LEFT JOIN … UNION ALL RIGHT JOIN … WHERE left key IS NULL); SQLite supports RIGHT and FULL joins from version 3.39.0; Oracle and PostgreSQL support all of the above; SQL Server supports all of them except NATURAL JOIN (write the ON condition instead).
Exam tip: INNER = matches only; LEFT/RIGHT = one whole side + matches; FULL = both whole sides; CROSS = m × n rows; SELF = a table joined to itself with two aliases.
What is OSI Model? Write the names of all its layers in sequence, from top to bottom or bottom to top.
What is SDLC? Write the name of 7 phase of SDLC?
Sign up free to see the model answers to written questions 4–5 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
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 5 syllabus chapters; OSI & TCP/IP Models, SQL & Queries and Object-Oriented Programming lead, with 1 each. OSI & TCP/IP Models is asked in 112 other papers too (2012–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- OSI & TCP/IP Models Networking · 112 other papers, 2012–20261
- SQL & Queries Database · 93 other papers, 2015–20261
- Object-Oriented Programming Programming · 88 other papers, 2015–20261
- Control Flow & Loops Programming · 76 other papers, 2015–20261
- SDLC & Process Models Software Engineering · 44 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 DESCO Assistant Engineer exam (2023)?
- 5 written questions.
- Which subjects were asked most in the DESCO Assistant Engineer exam (2023)?
- Programming (2), Database (1) and Networking (1), out of 5 questions.
- When was the DESCO Assistant Engineer exam held?
- On 20 May 2023.
- Where can I find the DESCO Assistant Engineer exam (2023) question solution?
- On this page: 2 of the 5 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