Loading...
Jalalabad Gas Transmission and Distribution System Ltd

Post: Assistant Engineer (CSE)
Exam Date: 08/10/2021Exam Taker: BUET
1. Write the output of the following code:

#include <iostream>
using namespace std;
int f(int *arr, int size) {
int x = 0;
for (int i = 0; i < size; i++) {
x = x ^ *(arr + i);
}
return x;
}

int main() {
int arr[] = {0, 1, 1, 0, 1, 1, 0, 1};
cout << f(arr, 2) <<f(arr, 3) << f(arr, 5) <<f(arr, 8) << endl;
return 0;
}

Answer: 1011.

Explanation:
f ফাংশনটি অ্যারের প্রথম size এলিমেন্টের XOR করে রিটার্ন করছে।

Step-by-step Calculation:
1) f(arr, 2)
arr[0] = 0
arr[1] = 1
XOR = 0 ^ 1 = 1

2) f(arr, 3)
arr[0] = 0
arr[1] = 1
arr[2] = 1
XOR = 0 ^ 1 ^ 1 = (0 ^ 1) ^ 1 = 1 ^ 1 = 0

3) f(arr, 5)
arr[0] = 0
arr[1] = 1
arr[2] = 1
arr[3] = 0
arr[4] = 1
XOR = 0 ^ 1 ^ 1 ^ 0 ^ 1
= (0 ^ 1) ^ 1 ^ 0 ^ 1
= 1 ^ 1 ^ 0 ^ 1
= 0 ^ 0 ^ 1
= 0 ^ 1 = 1

4) f(arr, 8)
arr = {0, 1, 1, 0, 1, 1, 0, 1}
XOR = 0 ^ 1 ^ 1 ^ 0 ^ 1 ^ 1 ^ 0 ^ 1

Stepwise:
0 ^ 1 = 1
1 ^ 1 = 0
0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 1 = 0
0 ^ 0 = 0
0 ^ 1 = 1

So overall XOR = 1

2. Write a Linux command to revoke permission of execution to everyone but owner from a file "jgtdsl.txt".
$chmod=x-x-x jgtdsl.txt
3. Write LSTM gates name in AI. Write the components of AI.

In AI, especially in the context of LSTM (Long Short-Term Memory) networks, the main gates are:

  1. Forget Gate
  2. Input Gate (sometimes called Update Gate)
  3. Output Gate

These gates control the flow of information inside the LSTM cell, helping it to remember or forget information over time.

These gates control the flow of information inside the LSTM cell, helping it to remember or forget information over time.

4. Write the ACID properties of DBMS.

ACID Properties in DBMS
ACID is an acronym that represents four essential properties of database transactions. These properties ensure data integrity, reliability, and consistency in a database system.

1) Atomicity
Atomicity means a transaction is treated as a single unit. Either all operations of the transaction are completed successfully, or none of them are executed. If any error occurs, the transaction is rolled back, preventing partial updates.

2) Consistency
Consistency ensures that a transaction moves the database from one valid state to another valid state. All integrity constraints, rules, and triggers must be satisfied. If any rule is violated, the transaction is rejected.

3) Isolation
Isolation ensures that multiple concurrent transactions do not affect each other. Each transaction executes as if it is the only one running in the system, even though they may run simultaneously.

4) Durability
Durability guarantees that once a transaction is successfully committed, its changes are permanent. Even if a system failure occurs afterward, the committed data will not be lost.

In short, ACID properties make database transactions secure, reliable, and free from data corruption.

DBMS-এ ACID Properties
ACID হলো একটি acronym যা database transaction-এর চারটি গুরুত্বপূর্ণ বৈশিষ্ট্য নির্দেশ করে। এই বৈশিষ্ট্যগুলো data integrity, reliability এবং consistency নিশ্চিত করে।

1) Atomicity
Atomicity বোঝায় একটি transaction একটি একক unit হিসেবে কাজ করে। অর্থাৎ transaction-এর সব operation সফলভাবে সম্পন্ন হবে, নাহলে একটিও কার্যকর হবে না। কোনো error হলে transaction rollback হয় এবং আংশিক update প্রতিরোধ করা হয়।

2) Consistency
Consistency নিশ্চিত করে যে একটি transaction database-কে একটি valid state থেকে আরেকটি valid state-এ নিয়ে যায়। সব integrity constraint, rule এবং trigger বজায় রাখতে হবে। কোনো নিয়ম ভঙ্গ হলে transaction অনুমোদিত হবে না।

3) Isolation
Isolation নিশ্চিত করে যে একাধিক concurrent transaction একে অপরকে প্রভাবিত করবে না। প্রতিটি transaction এমনভাবে execute হয় যেন এটি একাই system-এ চলছে।

4) Durability
Durability নিশ্চিত করে যে একবার transaction commit হলে তার পরিবর্তন স্থায়ীভাবে সংরক্ষিত হয়। পরে system crash হলেও committed data হারিয়ে যায় না।

সংক্ষেপে, ACID properties database transaction-কে নির্ভরযোগ্য, সুরক্ষিত এবং data corruption বা loss থেকে রক্ষা করে।

5. A hash function h(x) = x%11 is given. Find the location of keys 18,41,22,44, 32,31,73,55. Use the linear probing as the collision resolution technique.

Answer:

Explanation:

6. Simplify F(A,B,C) = A'B C'+ ABC'+ABC. Using K-map and represent in sum of minterm form.

You must subscribe & Login to view more.

Don’t have an account? Register

Or your subscription is under review by admin. Please message on WhatsApp / Telegram.

Leave a Comment

Latest Post
Field Based Job Question & Solution
Bank IT Job Solution

MCQ + Written from Bangladesh Bank, Sonali, Combined Bank IT recruitment.

BPSC IT Job Solution

BPSC Computer/IT cadre & non-cadre post Question papers with full solutions.

Gas Field IT Job Solution

Gas field like TGTDCL, BGDCL, JGTDSL, KGDCL, SGCL, RPGCL, GTCL etc. question solution

Power Sector IT Job Solution

Power sector such as NESCO, DESCO, DPDC, WZPDCL, BPDB, PGCB, BREB etc

Other IT Job Solution

Other Govt. Semi govt. organization like BCC, BTCL, CAAB, NSI etc.

NTRCA IT Job Solution (upcoming)

NTRCA ICT-related posts such as Assistant Teacher, Demonstrator, Lecturer.

IT MCQ Job Solution

Collected MCQ Job solution of BANK, BPSC, POWER SECTOR, GAS Field and Others.

Topic Based Q&S
WhatsApp Telegram Messenger