WZPDCL Assistant Engineer Exam 2019 — Question Solution | ওজোপাডিকো (ওয়েস্ট জোন পাওয়ার) সহকারী প্রকৌশলী নিয়োগ পরীক্ষা ২০১৯ — প্রশ্ন সমাধান
- WZPDCL
- Assistant Engineer
- 2019
- 14 questions · 0 MCQ, 14 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The WZPDCL Assistant Engineer exam was held in 2019. The paper had 14 written questions. The subjects asked most were Networking (4), Programming (3) and Database (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
- WZPDCL
- Post
- Assistant Engineer
- Exam date
- 2019
- Questions
- 14 (0 MCQ, 14 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
What is tautology? Write an example of a tautology.
What is linear and Non-linear data structure? Write an example of data structure which represents logarithmic complexity?
How many bits for IPv6? Write an example IPv6?
What is Constructor function? Write an example of Constructor function?
Find the output of Java program:
public class Main{
public static void main(String[] args) {
int i=0;
for(int j=5; i<3 && j<10; i++, j++){
System.out.print(" "+i + " "+j);
}
}
}
Difference between Register and Latch.
Main difference between Combinational and Sequential circuits.
Difference between Router and Switch.
Write an algorithm for matrix multiplication.
Sign up free to see the model answers to written questions 1–9 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is recursive function? Give an example of recursive function.
Model answer
A recursive function is a function that calls itself (directly, or indirectly through another function) to solve a problem by reducing it to a smaller instance of the same problem, until a simple case is reached that is answered without any further call.
Two parts every recursive function needs
- Base case – the smallest input, answered directly; it stops the chain of calls.
- Recursive case – does a little work and calls the function again on a smaller input, so every call moves closer to the base case.
| Type | Meaning |
|---|---|
| Direct recursion | f() calls f() itself |
| Indirect recursion | f() calls g() and g() calls f() |
Example: factorial in C (n! = n × (n − 1)!, with 0! = 1! = 1)
#include <stdio.h>
/* Recursive factorial: n! = n * (n-1)!, with 0! = 1! = 1 */
unsigned long long fact(int n)
{
if (n <= 1) /* base case: stops the self-calls */
return 1ULL;
return n * fact(n - 1); /* recursive case: smaller problem */
}
int main(void)
{
int n;
printf("Enter n (0-20): ");
if (scanf("%d", &n) != 1 || n < 0 || n > 20) {
printf("Invalid input\n");
return 1;
}
printf("%d! = %llu\n", n, fact(n));
return 0;
}
Sample runs (the number after the prompt is typed by the user)
Enter n (0-20): 5
5! = 120
Enter n (0-20): 0
0! = 1
A negative number, a value above 20 or a non-numeric entry prints Invalid input. The limit 20 is needed because 20! = 2432902008176640000 is the largest factorial that fits in a 64-bit unsigned long long; 21! overflows.
How fact(4) runs – the calls go down to the base case, then the multiplications happen while the calls return:
flowchart TD
A["fact(4) = 4 * fact(3)"] --> B["fact(3) = 3 * fact(2)"]
B --> C["fact(2) = 2 * fact(1)"]
C --> D["fact(1) = 1 (base case)"]
D -.->|"returns 1"| C
C -.->|"returns 2"| B
B -.->|"returns 6"| A
A -.->|"returns 24"| R["result: 24"]
| Call | Waits for | Returns |
|---|---|---|
| fact(4) | 4 × fact(3) | 4 × 6 = 24 |
| fact(3) | 3 × fact(2) | 3 × 2 = 6 |
| fact(2) | 2 × fact(1) | 2 × 1 = 2 |
| fact(1) | nothing (base case) | 1 |
Points to remember
- Every pending call keeps its own stack frame (its own copy of
n), so fact(n) uses O(n) stack memory, while a loop needs O(1). - If the base case is missing or can never be reached (e.g.
return n * fact(n - 1);with noif), the calls never stop and the program crashes with a stack overflow. - Recursion suits problems that are defined in terms of smaller copies of themselves: tree traversal, Tower of Hanoi, merge sort, quicksort, binary search.
Exam tip: write the base case first and make sure every recursive call moves toward it (here n - 1 with the base case n <= 1); otherwise the recursion never ends.
What is a foreign key? When is a foreign key used?
Model answer
A foreign key (FK) is a column, or a set of columns, in one table (the child or referencing table) whose values must match a primary key or other candidate (UNIQUE) key of another table, or of the same table (the parent or referenced table). Each FK value must either match an existing parent value or be NULL (when the column allows NULL). This rule is called referential integrity.
Example
erDiagram
DEPARTMENT ||--o{ EMPLOYEE : employs
EMPLOYEE |o--o{ EMPLOYEE : manages
DEPARTMENT {
int dept_id PK
string dept_name UK
}
EMPLOYEE {
int emp_id PK
string emp_name
int dept_id FK
int manager_id FK
}
CREATE TABLE Department (
dept_id INT PRIMARY KEY,
dept_name VARCHAR(30) NOT NULL UNIQUE
);
CREATE TABLE Employee (
emp_id INT PRIMARY KEY,
emp_name VARCHAR(40) NOT NULL,
dept_id INT NOT NULL, -- every employee must have a department
manager_id INT, -- NULL = has no manager
FOREIGN KEY (dept_id) REFERENCES Department(dept_id),
FOREIGN KEY (manager_id) REFERENCES Employee(emp_id) -- self-reference
);
INSERT INTO Department VALUES (1, 'Finance'), (2, 'ICT');
INSERT INTO Employee VALUES (501, 'Nazmul Huda', 2, NULL); -- accepted
INSERT INTO Employee VALUES (502, 'Sadia Afrin', 2, 501); -- accepted
INSERT INTO Employee VALUES (503, 'Rony Saha', 7, 501); -- rejected: no dept 7
DELETE FROM Department WHERE dept_id = 2; -- rejected: ICT has employees
DELETE FROM Department WHERE dept_id = 1; -- accepted: Finance has none
What the DBMS does: it rejects an insert or update that points to a parent row that does not exist. It also rejects deleting or changing a parent key that child rows still use, because the default action is NO ACTION/RESTRICT. You can choose a different action when you define the FK:
| Option | When the parent row is deleted |
|---|---|
| NO ACTION / RESTRICT (default) | the delete is refused while child rows exist |
| ON DELETE CASCADE | the child rows are deleted too |
| ON DELETE SET NULL | the child FK becomes NULL (the column must allow NULL) |
When a foreign key is used
- To link related tables in a 1:N relationship: the FK goes on the "many" side (Employee → Department, Order → Customer). In an M:N relationship it is placed in a junction table (Enrollment holds both student_id and course_id).
- To enforce referential integrity, so no "orphan" rows exist, such as an employee in a non-existent department.
- To model hierarchies inside one table (self-reference), such as employee → manager or branch → parent branch.
- To control what happens on parent changes, with CASCADE, SET NULL or RESTRICT rules.
- To join tables reliably:
JOIN Department d ON d.dept_id = e.dept_idalways finds a matching department.
Key facts: a table can have several FKs; FK values can repeat; an FK can be NULL unless it is declared NOT NULL. SQLite checks FKs only after PRAGMA foreign_keys = ON;, while MySQL InnoDB, PostgreSQL, SQL Server and Oracle check them by default.
Exam tip: Define an FK as "a column that refers to the primary/candidate key of another (or the same) table". Then give the Employee–Department example, and say that it enforces referential integrity with RESTRICT as the default action.
How many layers are used in the OSI and TCP/IP models? Draw the layers.
Write down the problem of asynchronous data transmission? How to solve this Problem using synchronous data transmission?
Write an SQL Query for 2nd highest score for the table T.
Sign up free to see the model answers to written questions 12–14 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
12 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; Functions & Recursion and Sequential Circuits lead, with 2 each. Functions & Recursion is asked in 60 other papers too (2016–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- Functions & Recursion Programming · 60 other papers, 2016–20262
- Sequential Circuits Digital Logic · 13 other papers, 2018–20252
- IP Addressing & Subnetting Networking · 133 other papers, 2012–20261
- Language Basics & Syntax Programming · 122 other papers, 2015–20261
- OSI & TCP/IP Models Networking · 112 other papers, 2012–20261
- SQL & Queries Database · 93 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 WZPDCL Assistant Engineer exam (2019)?
- 14 written questions.
- Which subjects were asked most in the WZPDCL Assistant Engineer exam (2019)?
- Networking (4), Programming (3) and Database (2), out of 14 questions.
- When was the WZPDCL Assistant Engineer exam held?
- In 2019. The exact day isn't in our records.
- Where can I find the WZPDCL Assistant Engineer exam (2019) question solution?
- On this page: 2 of the 14 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