DESCO; Assistant Engineer; Exam: 20.05.2023 (DESCO)প্রশ্ন ও সমাধান
- Set by
- DESCO
- Post
- Assistant Engineer
- Exam date
- 20 May 2023
- Questions
- 5 (0 MCQ, 5 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
- Programming · প্রোগ্রামিং 2
- Database · ডেটাবেজ 1
- Networking · নেটওয়ার্কিং 1
- Software Engineering · সফটওয়্যার ইঞ্জিনিয়ারিং 1
Write a Program:
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explain the various types of access specifiers.
Model answer
Access specifiers (access modifiers) control the visibility/accessibility of class members (fields, methods) in OOP languages like Java and C++.
classDiagram
class Base {
+publicMember : public, accessible everywhere
#protectedMember : protected, class + subclass
-privateMember : private, class only
}
class Derived
Base <|-- Derived
| Specifier | Same class | Subclass (derived) | Same package/file | Other packages/outside |
|---|---|---|---|---|
| Public | Yes | Yes | Yes | Yes |
| Protected | Yes | Yes | Yes | No |
| Default (package-private, Java only) | Yes | Only if same package | Yes | No |
| Private | Yes | No | No | No |
- Public: part of the class's open interface — used for methods/data meant to be freely used by any code.
- Private: hides implementation details (encapsulation) — accessible only inside the class itself.
- Protected: exposes members to subclasses (supports inheritance) while still hiding them from unrelated outside code.
- Default: Java-specific — no keyword written, visible only within the same package.
Exam takeaway: visibility from most to least open is Public > Protected > Default (package-private) > Private — always choose the tightest specifier that still lets the class fulfil its role, for strong encapsulation.
What are the different types of join in SQL?
Model answer
SQL joins combine rows from two or more tables based on a related column.
erDiagram
EMPLOYEE }o--|| DEPARTMENT : belongs_to
| Join type | Returns | SQL example |
|---|---|---|
| INNER JOIN | Only matching rows in both tables | SELECT * FROM Emp e INNER JOIN Dept d ON e.DeptID=d.DeptID; |
| LEFT (OUTER) JOIN | All rows from left, plus matched rows from right (NULL if no match) | SELECT * FROM Emp e LEFT JOIN Dept d ON e.DeptID=d.DeptID; |
| RIGHT (OUTER) JOIN | All rows from right, plus matched rows from left (NULL if no match) | SELECT * FROM Emp e RIGHT JOIN Dept d ON e.DeptID=d.DeptID; |
| FULL OUTER JOIN | All rows from both tables; NULL where no match on either side | SELECT * FROM Emp e FULL OUTER JOIN Dept d ON e.DeptID=d.DeptID; |
| CROSS JOIN | Cartesian product — every row of A with every row of B (no condition) | SELECT * FROM Emp CROSS JOIN Dept; |
| SELF JOIN | A table joined with itself (e.g. employee-manager) | SELECT e1.Name, e2.Name AS Manager FROM Emp e1 JOIN Emp e2 ON e1.ManagerID=e2.EmpID; |
Exam takeaway: INNER returns only matches; LEFT/RIGHT return all of one side plus matches; FULL OUTER returns all of both sides; CROSS returns every combination; SELF joins a table to itself via a foreign key referencing its own primary key.
What is OSI Model? Write all layer name sequence should be top to bottom or bottom to top.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is SDLC? Write the name of 7 phase of SDLC?
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 · Government IT officer posts guide