Bangladesh Bank Assistant Programmer Exam 2016 — Question Solution | বাংলাদেশ ব্যাংক সহকারী প্রোগ্রামার নিয়োগ পরীক্ষা ২০১৬ — প্রশ্ন সমাধান
- Bangladesh Bank
- Assistant Programmer
- 2016
- 9 questions · 0 MCQ, 9 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The Bangladesh Bank Assistant Programmer exam was held in 2016. The paper had 9 written questions. The subjects asked most were Database (2), Programming (2) and Algorithms (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
- Bangladesh Bank
- Post
- Assistant Programmer
- Exam date
- 2016
- Questions
- 9 (0 MCQ, 9 written)
- Exam guide
- Bank IT jobs · ব্যাংকের আইটি চাকরি
What is a tautology? Prove that the statement [(A→B) ∧ A] → A is a tautology by using a truth table.
Write prefix and postfix notations from the statement like ((A+B)*C-(D-E)^F)
Sign up free to see the model answers to written questions 1–2 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is polymorphism? What is the difference between method overriding and method overloading?
Model answer
Polymorphism ("many forms") is the OOP feature that lets one name, one interface, behave in different ways depending on the arguments or on the actual object. A single call such as n.send(msg) can send a log entry, an SMS or an e-mail.
Types of polymorphism
| Type | Also called | Achieved by | Decided |
|---|---|---|---|
| Compile-time | Static / early binding | Method overloading (C++ also allows operator overloading) | By the compiler, from the argument list |
| Run-time | Dynamic / late binding | Method overriding through a parent reference | At run time, from the real object type |
Java does not let a programmer overload operators for user classes: x + y on two objects of a user class does not compile (only the built-in + for String joining exists).
Overriding vs overloading (Java)
| Point | Method overriding | Method overloading |
|---|---|---|
| Meaning | Subclass gives a new body to an inherited method | Several methods share one name with different parameter lists |
| Classes | Needs inheritance (parent and child) | Usually one class (a subclass may also add an overload) |
| Signature | Same name and same parameters | Same name, different parameters (number, type or order) |
| Return type | Same, or a subtype for reference types (covariant) | May differ; a different return type alone is not allowed |
| Binding | Run time (dynamic dispatch) | Compile time (static) |
| Access | Cannot be made weaker | No restriction |
static / final / private |
Cannot be overridden (static is hidden) |
Can be overloaded |
| Polymorphism | Run-time | Compile-time |
Example (Java 21): both kinds in one program
class Notifier {
// Overloading (compile-time): same name, different parameter lists
String send(String msg) { return deliver(msg); }
String send(String msg, int times) { return deliver(msg) + " x" + times; }
// Overriding target (run-time): subclasses replace this body
String deliver(String msg) { return "LOG : " + msg; }
}
class SmsNotifier extends Notifier {
@Override
String deliver(String msg) { return "SMS : " + msg; }
}
class EmailNotifier extends Notifier {
@Override
String deliver(String msg) { return "EMAIL: " + msg; }
}
public class Alerts {
public static void main(String[] args) {
Notifier[] list = { new Notifier(), new SmsNotifier(), new EmailNotifier() };
for (Notifier n : list)
System.out.println(n.send("Exam at 10am")); // one call, three behaviours
System.out.println(list[1].send("Bring admit card", 2));
}
}
Output:
LOG : Exam at 10am
SMS : Exam at 10am
EMAIL: Exam at 10am
SMS : Bring admit card x2
Where each kind appears: send(String) and send(String, int) are overloads; the compiler picks send(..., 2) because the call has two arguments. deliver is overridden in SmsNotifier and EmailNotifier; every element of list has type Notifier, yet the JVM runs the body of the real object, which is why the same call prints LOG, SMS and EMAIL.
In C++: run-time polymorphism needs the base member function to be virtual; a non-virtual function called through a base pointer runs the base version.
Exam tip: Polymorphism = one interface, many forms. Overloading = compile time, different parameters; overriding = run time, same signature in a subclass.
What is main difference between Domain and Workgroup?
Write a structured program to display Fibonacci series up to 100 Numbers.
Sign up free to see the model answers to written questions 4–5 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Define 'integrity rules' of database systems. Write a SQL query to get the second highest salary from Employee table.
Model answer
Integrity rules are the conditions, declared in the schema, that every row of a database must satisfy. The DBMS checks them on each INSERT, UPDATE and DELETE and rejects any change that would break them, so the stored data stays valid and consistent.
| Rule | What it requires | How it is declared |
|---|---|---|
| Entity integrity | A primary key value is unique and no part of it is NULL, so every row can be identified | PRIMARY KEY |
| Referential integrity | A foreign key value must match an existing primary-key (or UNIQUE) value of the parent table, or be NULL; a parent row that still has children cannot be deleted unless a referential action (e.g. ON DELETE CASCADE) says otherwise. The default action is NO ACTION/RESTRICT |
FOREIGN KEY … REFERENCES |
| Domain integrity | Each value belongs to its column's domain: data type, length, allowed range, NULL allowed or not | data type, NOT NULL, CHECK, DEFAULT |
| Key (uniqueness) integrity | No two rows share a candidate-key value | UNIQUE |
| User-defined (business) rules | Organisation-specific conditions, e.g. salary must be positive | CHECK, triggers |
Example schema (tested in SQLite with PRAGMA foreign_keys = ON):
CREATE TABLE Branch (
branch_code CHAR(4) NOT NULL PRIMARY KEY,
city VARCHAR(30) NOT NULL);
CREATE TABLE Employee (
emp_code CHAR(5) NOT NULL PRIMARY KEY,
emp_name VARCHAR(40) NOT NULL,
nid VARCHAR(17) UNIQUE,
salary DECIMAL(10,2) CHECK (salary > 0),
branch_code CHAR(4) REFERENCES Branch(branch_code));
| Rejected statement | Rule broken | SQLite message |
|---|---|---|
INSERT … VALUES (NULL, 'Test', …) |
Entity | NOT NULL constraint failed: Employee.emp_code |
a second row with emp_code = 'E01' |
Entity | UNIQUE constraint failed: Employee.emp_code |
branch_code = 'SYL9' (no such branch) |
Referential | FOREIGN KEY constraint failed |
DELETE FROM Branch WHERE branch_code = 'CTG1' (has employees) |
Referential | FOREIGN KEY constraint failed |
salary = -10 |
Domain / business | CHECK constraint failed: salary > 0 |
(SQLite enforces foreign keys only after PRAGMA foreign_keys = ON, and a non-INTEGER primary key there accepts NULL unless NOT NULL is written, which is why it is written above.)
Second highest salary
| emp_code | emp_name | salary |
|---|---|---|
| E01 | Farhana | 91000 |
| E02 | Nayeem | 91000 |
| E03 | Sadia | 74000 |
| E04 | Arif | 68000 |
| E05 | Lubna | 74000 |
| E06 | Rakib | NULL |
Method 1, nested MAX (works in every DBMS):
SELECT MAX(salary) AS second_highest
FROM Employee
WHERE salary < (SELECT MAX(salary) FROM Employee);
Result: second_highest = 74000. The inner query finds 91000; the outer MAX takes the largest value below it. MAX ignores the NULL salary. If all salaries are equal, the result is NULL.
Method 2, DENSE_RANK (MySQL 8.0+, PostgreSQL, Oracle, SQL Server, SQLite 3.25+); change 2 to N for the Nth highest:
SELECT DISTINCT salary AS second_highest
FROM (SELECT salary,
DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk
FROM Employee
WHERE salary IS NOT NULL) ranked
WHERE rnk = 2;
Result: 74000. Both 91000 rows get rank 1 and both 74000 rows get rank 2. The IS NOT NULL filter matters because PostgreSQL and Oracle sort NULL first in DESC order, which would give the NULL rank 1.
Method 3, DISTINCT + row limiting (syntax varies by DBMS):
-- MySQL, PostgreSQL, SQLite
SELECT DISTINCT salary FROM Employee WHERE salary IS NOT NULL
ORDER BY salary DESC LIMIT 1 OFFSET 1;
-- SQL Server 2012+, Oracle 12c+, standard SQL
SELECT DISTINCT salary FROM Employee WHERE salary IS NOT NULL
ORDER BY salary DESC OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY;
Result: 74000. Without DISTINCT, LIMIT 1 OFFSET 1 returns 91000 (the second copy of the top salary), which is wrong. If there is no second distinct salary, this method returns no row.
Exam tip: name entity, referential and domain integrity with one example each; for the salary query, write the nested-MAX version and say it handles tied top salaries.
What is cardinality and modality?
What are the minimum HTML tags used in web pages? How can you write comments in web pages so that the browser does not read them?
Find time and space complexity like below pseudo code.
for(i=0; i<n;i++)
for(j=0; j<n;j++)
for(k=0; k<n;k++)
count++;
Sign up free to see the model answers to written questions 7–9 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
7 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ৭টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 9 syllabus chapters; ER Model & Design, SQL & Queries and Object-Oriented Programming lead, with 1 each. ER Model & Design is asked in 101 other papers too (2015–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- ER Model & Design Database · 101 other papers, 2015–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
- Boolean Algebra & K-Maps Digital Logic · 50 other papers, 2016–20261
- Trees Data Structures · 47 other papers, 2015–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 Bangladesh Bank Assistant Programmer exam (2016)?
- 9 written questions.
- Which subjects were asked most in the Bangladesh Bank Assistant Programmer exam (2016)?
- Database (2), Programming (2) and Algorithms (1), out of 9 questions.
- When was the Bangladesh Bank Assistant Programmer exam held?
- In 2016. The exact day isn't in our records.
- Where can I find the Bangladesh Bank Assistant Programmer exam (2016) question solution?
- On this page: 2 of the 9 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