WZPGCL Assistant Engineer Exam 27 May 2023 — Question Solution | ডব্লিউজেডপিজিসিএল সহকারী প্রকৌশলী নিয়োগ পরীক্ষা ২০২৩ — প্রশ্ন সমাধান
- WZPGCL
- Assistant Engineer
- 27 May 2023
- 13 questions · 0 MCQ, 13 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The WZPGCL Assistant Engineer exam was held on 27 May 2023. The paper had 13 written questions. The subjects asked most were Data Structures (2), Database (2) and Programming (2). 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
- WZPGCL
- Post
- Assistant Engineer
- Exam date
- 27 May 2023
- Questions
- 13 (0 MCQ, 13 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
- Data Structures · ডেটা স্ট্রাকচার 2
- Database · ডেটাবেজ 2
- Programming · প্রোগ্রামিং 2
- Software Engineering · সফটওয়্যার ইঞ্জিনিয়ারিং 2
- Algorithms · অ্যালগরিদম 1
- Cloud & Emerging Tech · ক্লাউড ও উদীয়মান প্রযুক্তি 1
- Cyber Security · সাইবার নিরাপত্তা 1
- Networking · নেটওয়ার্কিং 1
- Operating Systems · অপারেটিং সিস্টেম 1
Write a program swap two numbers without using 3rd variable.
Difference between IPv4 and IPv6.
Briefly explain asymmetric encryption.
Explain binary tree with example.
Sign up free to see the model answers to written questions 1–4 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is Pre-order and Post order?
Model answer
Preorder and postorder are two depth-first ways of visiting every node of a binary tree exactly once. They differ only in when the root is visited, and the same rule is applied recursively to every subtree.
| Traversal | Order at every node | Root is visited |
|---|---|---|
| Preorder (NLR) | Root → Left subtree → Right subtree | first |
| Postorder (LRN) | Left subtree → Right subtree → Root | last |
Example
graph TD
tM((M)) --> tG((G))
tM --> tT((T))
tG --> tC((C))
tG --> tJ((J))
tJ -->|left| tH((H))
tT -->|right| tW((W))
- Preorder: M, G, C, J, H, T, W. M comes first, then the whole left subtree (G, C, J, H), then the right subtree (T, W).
- Postorder: C, H, J, G, W, T, M. G's subtree is finished (C, H, J, G) before T's subtree (W, T), and the root M comes last.
C functions
struct Node {
char data;
struct Node *left, *right;
};
void preorder(struct Node *t) { /* Root, Left, Right */
if (t == NULL) return;
printf("%c ", t->data);
preorder(t->left);
preorder(t->right);
}
void postorder(struct Node *t) { /* Left, Right, Root */
if (t == NULL) return;
postorder(t->left);
postorder(t->right);
printf("%c ", t->data);
}
Called on the tree above (with <stdio.h> included), they print M G C J H T W and C H J G W T M (each letter is followed by a space, the last one included).
Key points
- Both take O(n) time, since each node is visited once, and O(h) extra space for the recursion stack, where h is the height.
- Preorder is used to copy or save a tree (a parent is created before its children). On an expression tree it gives the prefix (Polish) form.
- Postorder is used to delete a tree or compute heights and sizes (children are handled before the parent). On an expression tree it gives the postfix form.
- Preorder or postorder together with inorder fixes a binary tree uniquely. Preorder with postorder alone does so only for a full binary tree.
Exam tip: the first item of a preorder and the last item of a postorder are always the root.
Difference between primary key, foreign key? What is trigger?
What is MVC? Write down the MVC design pattern.
Name a few architectures in design patterns.
What is Semaphore? How would you improve performance when using semaphores?
What is database Normalization? Write down the types of database Normalization.
Sign up free to see the model answers to written questions 6–10 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is constructor function? Write the properties of it.
Model answer
Definition. A constructor is a special member function of a class that runs by itself each time a new object of that class comes into existence. Its job is to initialise the object's data members (and acquire any resources it needs) so that every object starts in a valid state.
Properties of a constructor
- It has the same name as the class.
- It has no return type, not even
void. - It is called automatically, once for each object, at the moment the object is created.
- It is normally declared public; a private constructor stops outside code from creating objects (used in the Singleton pattern).
- It can be overloaded: default, parameterized and copy constructors can exist in the same class.
- It can have default arguments.
- It cannot be virtual, static, const or volatile, and its address cannot be taken.
- It is not inherited; when a derived object is created, the base-class constructor runs first and then the derived one (C++11 can re-use base constructors with
using Base::Base;). - If a class declares no constructor, the compiler supplies an implicit default constructor; in C++ it leaves built-in members such as
intuninitialised in local objects (Java instead sets fields to 0, false or null). - It can initialise members through a member initializer list; inside a constructor this is the only way to initialise
constand reference members (C++11 also allows an initializer written at the member's declaration).
Kinds of constructor
| Kind | Form | Called when |
|---|---|---|
| Default | Account() |
object created without arguments |
| Parameterized | Account(string, double) |
object created with arguments |
| Copy | Account(const Account&) |
object created as a copy of another |
Example (C++)
#include <iostream>
#include <string>
using namespace std;
class Account {
string owner;
double balance;
public:
Account() : owner("Unknown"), balance(0) { // default constructor
cout << "default constructor\n";
}
Account(string name, double amount = 500) // parameterized, with a default argument
: owner(name), balance(amount) {
cout << "parameterized constructor\n";
}
Account(const Account &other) // copy constructor
: owner(other.owner), balance(other.balance) {
cout << "copy constructor\n";
}
void show() const { cout << owner << ": " << balance << "\n"; }
};
int main() {
Account a1; // calls Account()
Account a2("Rafi", 1200); // calls Account(string, double)
Account a3("Mitu"); // amount takes its default 500
Account a4 = a2; // calls the copy constructor
a1.show(); a2.show(); a3.show(); a4.show();
return 0;
}
Output
default constructor
parameterized constructor
parameterized constructor
copy constructor
Unknown: 0
Rafi: 1200
Mitu: 500
Rafi: 1200
Exam tip: list "same name, no return type, automatic call, overloadable, not inherited, cannot be virtual" first — these six properties are what examiners look for.
Write down the difference between Divide and Conquer and Dynamic Programming.
Write about Blockchain.
Sign up free to see the model answers to written questions 12–13 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
11 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ১১টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 11 syllabus chapters; Requirements & Design and Trees lead, with 2 each. Requirements & Design is asked in 50 other papers too (2016–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- Requirements & Design Software Engineering · 50 other papers, 2016–20262
- Trees Data Structures · 47 other papers, 2015–20262
- IP Addressing & Subnetting Networking · 133 other papers, 2012–20261
- Language Basics & Syntax Programming · 122 other papers, 2015–20261
- Functions & Recursion Programming · 60 other papers, 2016–20261
- Processes & Threads Operating Systems · 55 other papers, 2011–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 WZPGCL Assistant Engineer exam (2023)?
- 13 written questions.
- Which subjects were asked most in the WZPGCL Assistant Engineer exam (2023)?
- Data Structures (2), Database (2) and Programming (2), out of 13 questions.
- When was the WZPGCL Assistant Engineer exam held?
- On 27 May 2023.
- Where can I find the WZPGCL Assistant Engineer exam (2023) question solution?
- On this page: 2 of the 13 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