RAKUB Programmer Exam 12 October 2021 — Question Solution | রাকাব প্রোগ্রামার নিয়োগ পরীক্ষা ২০২১ — প্রশ্ন সমাধান
- RAKUB
- Programmer
- 12 October 2021
- 15 questions · 0 MCQ, 15 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The RAKUB Programmer exam was held on 12 October 2021. The paper had 15 written questions. The subjects asked most were Data Structures (3), Programming (3) and Algorithms (2). 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
- RAKUB
- Post
- Programmer
- Exam date
- 12 October 2021
- Questions
- 15 (0 MCQ, 15 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
- Data Structures · ডেটা স্ট্রাকচার 3
- Programming · প্রোগ্রামিং 3
- Algorithms · অ্যালগরিদম 2
- Bangla to English Translation · বাংলা থেকে ইংরেজি অনুবাদ 1
- Bangla Writing · বাংলা লিখন 1
- Computer Architecture · কম্পিউটার আর্কিটেকচার 1
- Cyber Security · সাইবার নিরাপত্তা 1
- Database · ডেটাবেজ 1
- English to Bangla Translation · ইংরেজি থেকে বাংলা অনুবাদ 1
- English Writing · ইংরেজি লিখন 1
Write a programme in C/C++/Java that finds sum of digits of a number until sum becomes single digit. Sample input/output:
Input: 12345
Output: 6
Write a programme in C/C++/Java to check whether an expression balanced parenthesis or not. Sample input/output:
Input: [()]{}{[()()]()}
Output: Balanced
Input: [(])
Output: Not Balanced
Write a programme to create an object of type batsman and calculate the average runs scored by the player.
A program (or a program task) takes 1 billion instructions to execute on a processor running at 2 GHz. Suppose also that 50% of the instructions execute in 3 clock cycles, 30% execute in 4 clock cycles, and 20% execute in 5 clock cycles. What is the execution time for the program or task?
Find the Minimum Spanning Tree of the following graph using Kruskal's algorithm.
graph LR
a((a)) -- 4 --- b((b))
a -- 8 --- h((h))
b -- 8 --- c((c))
b -- 11 --- h
c -- 7 --- d((d))
d -- 9 --- e((e))
d -- 14 --- f((f))
e -- 10 --- f
f -- 2 --- g((g))
g -- 1 --- h
g -- 6 --- i((i))
h -- 7 --- i
The graph is undirected; the number on each edge is its weight.
Mathematically derive the maximum and minimum height of a binary tree consisting of n nodes. Note that the height of a tree with a single node is considered as 1.
Sign up free to see the model answers to written questions 1–6 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explain method overloading and Method overriding with example.
Model answer
Method Overloading and Method Overriding
Method overloading means writing two or more methods with the same name but different parameter lists in the same class (in Java a subclass may also add a new overload of an inherited method). The compiler picks the version from the arguments of the call, so it is compile-time (static) polymorphism.
A parameter list can differ in:
- number of parameters:
area(int)andarea(int, int) - type of parameters:
area(int)andarea(double) - order of parameter types:
tag(String, int)andtag(int, String)
Changing only the return type is not overloading: int f(int) and double f(int) in one class is a compile error.
Method overriding means a subclass gives its own body to an inherited method with the same name, the same parameter list and the same (or a covariant) return type. The version that runs is chosen from the actual object at run time, so it is run-time (dynamic) polymorphism.
| Basis | Overloading | Overriding |
|---|---|---|
| Where | Same class (or a subclass adding a new signature) | Parent class and child class |
| Parameter list | Must differ | Must be the same |
| Inheritance needed | No | Yes |
| Binding | Compile time | Run time (dynamic method dispatch) |
| Return type | Free, but a different return type alone is not enough | Same, or a subtype (covariant) |
| Access (Java) | Any | Cannot be more restrictive than the parent's |
static / final / private (Java) |
Can be overloaded | Cannot be overridden |
Example (Java)
class Geometry {
// ---- overloading: same name, different parameter lists ----
int area(int side) { return side * side; } // 1 parameter
int area(int length, int width) { return length * width; } // number differs
double area(double radius) { return 3.1416 * radius * radius; } // type differs
String tag(String unit, int v) { return v + " " + unit; }
String tag(int v, String unit) { return unit + ":" + v; } // order differs
}
class Account {
double rate() { return 0.0; }
String kind() { return "Account"; }
}
class Savings extends Account {
@Override double rate() { return 4.5; } // same signature, new body
@Override String kind() { return "Savings"; }
}
class FixedDeposit extends Account {
@Override double rate() { return 7.25; }
@Override String kind() { return "FD -> base was " + super.kind(); }
}
public class PolyDemo {
public static void main(String[] args) {
Geometry g = new Geometry();
System.out.println(g.area(4)); // area(int)
System.out.println(g.area(4, 6)); // area(int,int)
System.out.println(g.area(2.0)); // area(double)
System.out.println(g.tag("kg", 3)); // tag(String,int)
System.out.println(g.tag(3, "kg")); // tag(int,String)
Account[] list = { new Account(), new Savings(), new FixedDeposit() };
for (Account a : list) // reference type is Account
System.out.println(a.kind() + " " + a.rate());
}
}
Output
16
24
12.5664
3 kg
kg:3
Account 0.0
Savings 4.5
FD -> base was Account 7.25
How it works
g.area(4),g.area(4, 6)andg.area(2.0)call three different methods; the compiler matches each call to a parameter list.tagshows overloading by order.- In the loop the reference type is always
Account, yet theSavingsandFixedDepositobjects run their ownrate()andkind(): the choice is made at run time.super.kind()still reaches the parent's version. - A
staticmethod with the same signature in a subclass only hides the parent's method (putting@Overrideon it is a compile error). - In C++ the same run-time overriding needs the base function to be declared
virtual.
Exam tip: overloading = same name, different parameters, decided at compile time; overriding = same signature in a subclass, decided at run time.
Draw the state diagram of deterministic Finite Automata (DFA), which accepts set of all strings over {0, 1} which interpreted as binary number is divisible by 4.
Write a programme in C/C++/Java/Python you are given a linked list. Write a recursive function to print the linked list in reverse order for example 1>2>3>4 output should be 4>3>2>1.
Draw E-R diagram of hospital management system. Hospital name "SKY Hospital Ltd.".
What is SQL Injection? How to Prevent against SQL Injection Attacks?
Bangla to English translation
English to Bangla translation
Write a composition: Edge Computing
Write a composition in Bangla: "বর্তমান সময়ে প্রোগ্রামার হিসাবে ক্যারিয়ার গঠনের প্রয়োজনীয়তা"
Sign up free to see the model answers to written questions 8–15 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
14 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ১৪টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 12 syllabus chapters; the biggest is Object-Oriented Programming, in Programming, with 2 questions. 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
- Language Basics & Syntax Programming · 122 other papers, 2015–20261
- ER Model & Design Database · 101 other papers, 2015–20261
- Attacks & Threats Cyber Security · 81 other papers, 2012–20261
- CPU Organization Computer Architecture · 77 other papers, 2011–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 RAKUB Programmer exam (2021)?
- 15 written questions.
- Which subjects were asked most in the RAKUB Programmer exam (2021)?
- Data Structures (3), Programming (3) and Algorithms (2), out of 15 questions.
- When was the RAKUB Programmer exam held?
- On 12 October 2021.
- Where can I find the RAKUB Programmer exam (2021) question solution?
- On this page: 1 of the 15 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