Previous (2021-2026) Assistant Programmer QnS
Combined Bank, Assistant Programmer, 2026 (Based year 2023)
Combined Bank, Assistant Programmer, 2026 (Based Year 2022)
ICB, Assistant Programmer, 2026
- 1Programming ConceptWrite pseudocode or code in any programming language where every character of a string increases by 1 alphabetically, such as a -> b and z -> a.
The problem requires character-wise transformation of a string where each alphabet is shifted by one position in the alphabet. This is commonly known as a Caesar cipher with shift 1.
Logic:
Each character is checked individually. If it is 'z', it wraps to 'a'. If it is 'Z', it wraps to 'A'. Otherwise, ASCII value is incremented by 1.
Pseudocode:
FUNCTION shiftString(S)
RESULT = "
FOR EACH character c IN S
IF c == 'z' THEN
RESULT = RESULT + 'a'
ELSE IF c == 'Z' THEN
RESULT = RESULT + 'A'
ELSE
RESULT = RESULT + (c + 1)
END IF
END FOR
RETURN RESULT
END FUNCTIONConclusion: This algorithm runs in O(n) time complexity where n is the length of the string.
Pseudocode Solution
FUNCTION shiftString(S)
RESULT = "
FOR EACH CHAR c IN S
IF c == 'z' THEN
RESULT = RESULT + 'a'
ELSE IF c == 'Z' THEN
RESULT = RESULT + 'A'
ELSE
RESULT = RESULT + (c + 1)
END IF
END FOR
RETURN RESULT
END FUNCTIONপ্রতিটি character কে ASCII অনুযায়ী +1 shift করা হয় এবং z/Z হলে wrap করে a/A তে নেয়া হয়।
- 2Structure Query LanguageGiven Student(sid, name, dept) and Course(sid, cid, cname, marks), Find the student name, department, course name, and marks where marks are greater than 80.
Find department-wise and subject-wise students where marks are not less than 30.We are given two relations: Student(sid, name, dept) and Course(sid, cid, cname, marks). The common attribute sid is used to join both tables.
1. Students with marks greater than 80:
This query retrieves high-performing students by applying a selection condition on marks.
SELECT S.name, S.dept, C.cname, C.marks
FROM Student S
JOIN Course C ON S.sid = C.sid
WHERE C.marks > 80;2. Department-wise and subject-wise students (marks ≥ 30):
This query filters moderately passed students and organizes output by department and course.
SELECT S.dept, C.cname, S.name, C.marks
FROM Student S
JOIN Course C ON S.sid = C.sid
WHERE C.marks >= 30;Conclusion: JOIN operation is essential to combine student identity with course performance data.
SQL Solution
১. Marks 80 এর বেশি:
SELECT S.name, S.dept, C.cname, C.marks
FROM Student S
JOIN Course C ON S.sid = C.sid
WHERE C.marks > 80;২. Department-wise ও subject-wise (marks ≥ 30):
SELECT S.dept, C.cname, S.name, C.marks
FROM Student S
JOIN Course C ON S.sid = C.sid
WHERE C.marks >= 30; - 3Cloud ComputingISTCL currently supports 10,000 active users and expects traffic to surge to 80,000 concurrent users. The legacy on-premises system already suffers from severe performance degradation and latency during peak hours. The engineering team proposes migrating to a scalable cloud architecture, but executive management denies cloud migration due to budget constraints and data sovereignty policies. What solution should be proposed, and why?
The system faces scalability limitations due to increased concurrent users. Since full cloud migration is restricted, an alternative architecture must be proposed.
Proposed Solution: Hybrid scalability model using optimized on-prem infrastructure.
Components:
- Load balancing across multiple servers
- Horizontal scaling using additional on-prem servers
- Microservices architecture for modular scaling
- CDN for static content delivery
- Database replication and caching layers
Reason: This ensures scalability, cost efficiency, and compliance with data sovereignty policies.
Conclusion: Hybrid architecture provides near-cloud scalability without violating organizational constraints.
Proposed Solution
Full cloud migration সম্ভব নয়, তাই hybrid scalable architecture ব্যবহার করা উচিত।
মূল কৌশল:
- Load
- 4Computer NetworkSubnettingA company named ICB has been allotted the IP address 192.198.10.0/22. Using subnetting, allocate subnets for Finance, Admin, IT, Loan, and HR requiring 250, 125, 120, 250, and 60 hosts respectively. Find the subnet mask, valid host addresses, and network address for each subnet.
The given network is 192.198.10.0/22, which provides 1024 IP addresses (from 192.198.8.0 to 192.198.11.255). VLSM is used to allocate different subnet sizes based on host requirements.
Step 1: Sort requirements (descending)
250, 250, 125, 120, 60 hosts
Step 2: Required subnet sizes
- 250 hosts → /24 (256 addresses)
- 250 hosts → /24
- 125 hosts → /25 (128 addresses)
- 120 hosts → /25
- 60 hosts → /26 (64 addresses)
Step 3: Subnet allocation
Finance: 192.198.8.0/24
Mask: 255.255.255.0
Valid hosts: 192.198.8.1 – 192.198.8.254Loan: 192.198.9.0/24
Mask: 255.255.255.0
Valid hosts: 192.198.9.1 – 192.198.9.254Admin: 192.198.10.0/25
Mask: 255.255.255.128
Valid hosts: 192.198.10.1 – 192.198.10.126IT: 192.198.10.128/25
Mask: 255.255.255.128
Valid hosts: 192.198.10.129 – 192.198.10.254HR: 192.198.11.0/26
Mask: 255.255.255.192
Valid hosts: 192.198.11.1 – 192.198.11.62Conclusion: VLSM minimizes wastage by allocating IPs according to requirement.
VLSM Subnetting Solution
প্রদত্ত IP: 192.198.10.0/22
প্রয়োজন অনুযায়ী ভাগ:
- 250 host → /24
- 250 host → /24
- 125
- 5Digital Logic DesignBasicDetermine whether the logical statement (P -> Q) -> (P' -> Q') is a tautology, contradiction, or contingency.
Determine whether the logical statement:
(P → Q) → (P' → Q')
Apply implication rules
P → Q ≡ ¬P ∨ Q
P' = ¬P
Q' = ¬Q
Therefore,
P' → Q' = ¬P → ¬QConstruct the Truth Table
P Q P → Q P' → Q' (P → Q) → (P' → Q') T T T T T T F F T T F T T F F F F T T T Conclusion
Final column values: T, T, F, T
Since the statement is true in some cases and false in one case, it is neither a tautology nor a contradiction.
Therefore, the logical statement (P → Q) → (P' → Q') is a Contingency.In discrete mathematics, a contingency is a compound proposition whose truth value is neither always true (a tautology) nor always false (a contradiction). Its final outcome depends entirely on the specific truth values of its individual variables, meaning its truth table contains at least one True (T) and at least one False (F).
- 6Microprocessor & Computer ArchitectureBasicA server has a fast CPU and abundant RAM, but despite low CPU and memory utilization, the system suffers from severe instruction execution delays and high latency during processing tasks. What needs to be updated, and what is the solution?
When CPU and RAM utilization are low but system latency is high, the bottleneck is not compute or memory, but input/output performance.
Step 1: Identify bottleneck
- Low CPU usage → not compute-bound
- Low memory usage → not memory-bound
- High latency → likely I/O-bound system
Step 2: Root cause
Slow disk storage (HDD), high I/O wait time, and limited throughput are common causes.
Solution:
Upgrade storage subsystem to SSD or NVMe and optimize I/O scheduling.
Conclusion: I/O subsystem is the critical bottleneck, not CPU or RAM.
Performance Bottleneck Analysis
CPU ও RAM কম ব্যবহার হলেও latency বেশি হলে এটি I/O bottleneck নির্দেশ করে।
সমস্যা:
- Slow HDD storage
- High I/O wait
Solution: SSD/NVMe storage upgrade ও I/O optimization।
- 7Computer SecurityDifferent AttacksWhen an IT firm announces a system exploit and developers rush to implement a patch, the organization enters a vulnerable window of exposure. If a zero-day attack occurs simultaneously and the system is financial, what may happen?
A zero-day vulnerability refers to an exploit that is unknown to vendors and has no available patch at the time of attack. During patch deployment, systems often experience temporary exposure.
Scenario Impact:
- Attackers exploit unpatched vulnerabilities
- Security controls may be partially disabled during updates
- Financial systems become high-value targets
Possible Consequences:
- Unauthorized transactions and fraud
- Leakage of sensitive financial data
- System downtime and integrity loss
- Regulatory penalties and trust damage
Conclusion: A simultaneous zero-day attack can lead to critical financial breach and operational collapse.
Security Impact Analysis
Patch চলাকালীন zero-day exploit হলে system vulnerability window তৈরি হয়।
Financial system এ হতে পারে:
- Unauthorized fund transfer
- Financial data breach
- System integrity compromise
- Compliance violation
Result: বড় financial loss ও security breach।
- 8Big Data, ML & AIProbabilityServer X and Server Y distribute incoming web traffic. Server X handles 60% of requests, while Server Y handles the remaining 40%. The probability of high latency is 2% for Server X and 4% for Server Y. Determine the total probability that a randomly selected request encounters high latency and the conditional probability that a delayed request was handled by Server X.
This is a conditional probability problem using the law of total probability and Bayes' theorem.
Given:
P(X)=0.6, P(Y)=0.4
P(L|X)=0.02, P(L|Y)=0.04Step 1: Total probability of latency
P(L) = P(X)P(L|X) + P(Y)P(L|Y)
= 0.6×0.02 + 0.4×0.04
= 0.012 + 0.016 = 0.028Step 2: Conditional probability
P(X|L) = (P(X)P(L|X)) / P(L)
= 0.012 / 0.028 = 3/7 ≈ 0.4286Conclusion: Overall latency probability is 2.8%, and delayed request is more likely from Server Y.
Probability Solution
Given:
P(X)=0.6, P(Y)=0.4
P(L|X)=0.02, P(L|Y)=0.04Total probability:
P(L)=0.028Conditional probability:
P(X|L)=3/7 ≈ 0.4286
10. Write about 150 word environment and economic impact of Renewable Energy
11. Translation Bangla to English: ২১শে ফেব্রুয়ারি আমাদের জাতীয় ইতিহাসে একটি গৌরবময় এবং স্মরণীয় দিন। প্রতি বছর আমরা এই দিনটিকে শহীদ দিবস এবং আন্তর্জাতিক মাতৃভাষা দিবস হিসেবে পালন করি . এই দিনটি তাদের সেই মহান ত্যাগকে স্মরণ করিয়ে দেয়।
ICB Asset Management Company Ltd, Assistant Programmer, 2024ok
ICB Asset Management Company Ltd
Post:Assistant Programmer
Exam taker:FBS, DU Mark: Non:50 Tech:50
Propagation Time and Transmission Time
- Given: Message size = 2.5 KByte = 2.5 × 1024 = 2560 Byte = 2560 × 8 = 20480 bits
- Bandwidth (R): 1 Gbps = 1 × 109 bps
- Distance (d): 12,000 km = 12,000,000 m
- Propagation speed (v): 2.4 × 108 m/s
- Transmission Time (Tt) = Message bits / Bandwidth
Tt = 20480 / (1 × 109) = 2.048 × 10-5 s ≈ 20.48 μs - Propagation Time (Tp) = Distance / Propagation speed
Tp = 12,000,000 / (2.4 × 108) = 5.0 × 10-2 s = 0.05 s = 50 ms
- Final Answer: Propagation time = 50 ms, Transmission time = 20.48 μs
Difference Between Compiler and Interpreter
- Translation Method: A compiler translates the entire source code at once; an interpreter translates and executes code line by line.
- Execution Speed: Compiled programs execute faster; interpreted programs execute slower.
- Error Detection: A compiler shows errors after compiling the whole program; an interpreter shows errors one by one during execution.
- Output: A compiler generates object/executable code; an interpreter does not generate separate object code.
- Memory Usage: Compiler requires more memory to store object code; interpreter requires less memory.
- Examples: C, C++ use compiler; Python, JavaScript use interpreter.
Compiler এবং Interpreter-এর পার্থক্য
- Translation Method: Compiler সম্পূর্ণ source code একবারে translate করে; Interpreter line by line translate ও execute করে।
- Execution Speed: Compiler দ্বারা তৈরি program দ্রুত execute হয়; Interpreter দ্বারা execute হওয়া program তুলনামূলক ধীর।
- Error Detection: Compiler পুরো program compile করার পর error দেখায়; Interpreter execution চলাকালীন একটির পর একটি error দেখায়।
- Output: Compiler object/executable code তৈরি করে; Interpreter আলাদা object code তৈরি করে না।
- Memory Usage: Compiler object code সংরক্ষণের জন্য বেশি memory ব্যবহার করে; Interpreter কম memory ব্যবহার করে।
- উদাহরণ: C, C++ compiler ব্যবহার করে; Python, JavaScript interpreter ব্যবহার করে।
SDLC is a structured process used to develop high-quality software in a systematic and organized manner. It defines a set of phases that guide the development team from planning to maintenance.
Phases of SDLC:
- Planning: Identify the problem, define objectives, scope, budget, and feasibility of the project.
- Requirement Analysis: Gather and analyze user requirements to determine what the system should do.
- System Design: Prepare system architecture, database design, interface design, and technical specifications.
- Implementation (Coding): Develop the software according to the design.
- Testing: Test the system to detect and fix errors (unit, integration, system testing).
- Deployment: Install and release the software for users.
- Maintenance: Provide updates, fix bugs, and improve performance after deployment.
SDLC (Software Development Life Cycle)
SDLC হলো একটি কাঠামোবদ্ধ প্রক্রিয়া যার মাধ্যমে ধাপে ধাপে মানসম্মত সফটওয়্যার তৈরি করা হয়।
SDLC-এর ধাপসমূহ:
- Planning: সমস্যা চিহ্নিত করা, লক্ষ্য, পরিধি, বাজেট ও সম্ভাব্যতা নির্ধারণ।
- Requirement Analysis: ব্যবহারকারীর চাহিদা সংগ্রহ ও বিশ্লেষণ।
- System Design: সিস্টেমের কাঠামো, ডাটাবেস ও ইন্টারফেস ডিজাইন করা।
- Implementation (Coding): ডিজাইন অনুযায়ী প্রোগ্রাম তৈরি করা।
- Testing: ত্রুটি শনাক্ত ও সংশোধনের জন্য পরীক্ষা করা।
- Deployment: সফটওয়্যার ব্যবহারকারীদের জন্য চালু করা।
- Maintenance: সফটওয়্যার রক্ষণাবেক্ষণ ও উন্নয়ন করা।
Difference Between while and do-while Loop (With Example)
- Condition Checking: In a while loop, the condition is checked before executing the loop body; in a do-while loop, the condition is checked after executing the loop body.
- Execution Guarantee: A while loop may execute zero times if the condition is false; a do-while loop executes at least once.
- Type of Loop: while is an entry-controlled loop; do-while is an exit-controlled loop.
- Syntax Structure: In while loop, the condition appears at the beginning; in do-while loop, the condition appears at the end.
- Semicolon Usage: while loop does not require a semicolon after the condition; do-while loop requires a semicolon at the end.
Example:
while loop:
int i = 5;
while(i < 5) {
System.out.println(i);
i++;
}
(Output: No output because condition is false at the beginning)
do-while loop:
int i = 5;
do {
System.out.println(i);
i++;
} while(i < 5);
(Output: 5 → Executes at least once)
while এবং do-while loop-এর পার্থক্য (উদাহরণসহ)
- Condition Checking: while loop-এ condition আগে check করা হয়; do-while loop-এ loop body execute হওয়ার পর condition check করা হয়।
- Execution Guarantee: while loop-এ condition false হলে একবারও execute নাও হতে পারে; do-while loop অন্তত একবার execute হয়।
- Loop-এর ধরন: while একটি entry-controlled loop; do-while একটি exit-controlled loop।
- Syntax Structure: while loop-এ condition শুরুতে থাকে; do-while loop-এ condition শেষে থাকে।
- Semicolon ব্যবহার: while loop-এ condition-এর পরে semicolon লাগে না; do-while loop-এ শেষে একটি semicolon ব্যবহার করতে হয়।
উদাহরণ
while loop:
int i = 5;
while(i < 5) {
System.out.println(i);
i++;
}
(Output: শুরুতেই condition false, তাই কিছু print হবে না)
do-while loop:
int i = 5;
do {
System.out.println(i);
i++;
} while(i < 5);
(Output: 5 → অন্তত একবার execute হবে)
RSA Algorithm (Public Key Cryptography)
RSA is an asymmetric encryption algorithm that uses two keys: a Public Key and a Private Key.
Step 1: Key Generation
- Choose two large prime numbers: p and q.
- Compute n = p × q.
- Compute Euler’s Totient: φ(n) = (p − 1)(q − 1).
- Choose an integer e such that:
- 1 < e < φ(n)
- gcd(e, φ(n)) = 1
- Compute d such that:
d × e ≡ 1 (mod φ(n))
Public Key: (e, n)
Private Key: (d, n)
Step 2: Encryption
To encrypt message M:
C = Me mod n
Step 3: Decryption
To decrypt ciphertext C:
M = Cd mod n
RSA Algorithm (Public Key Cryptography)
RSA একটি asymmetric encryption পদ্ধতি, যেখানে দুটি key ব্যবহৃত হয়: Public Key এবং Private Key।
ধাপ ১: Key Generation
- দুটি বড় prime সংখ্যা নির্বাচন করো: p এবং q।
- গণনা করো n = p × q।
- Euler’s Totient নির্ণয় করো:
φ(n) = (p − 1)(q − 1)। - একটি সংখ্যা e নির্বাচন করো যাতে:
- 1 < e < φ(n)
- gcd(e, φ(n)) = 1
- d নির্ণয় করো যাতে:
d × e ≡ 1 (mod φ(n))
Public Key: (e, n)
Private Key: (d, n)
ধাপ ২: Encryption
বার্তা M encrypt করতে:
C = Me mod n
ধাপ ৩: Decryption
Ciphertext C decrypt করতে:
M = Cd mod n
Binary Search Algorithm
Binary Search is used to find a key element in a sorted array by repeatedly dividing the search interval into two halves.
Pseudocode:
BINARY_SEARCH(A, n, key) 1. low ← 0 2. high ← n - 1 3. while low ≤ high do 4. mid ← (low + high) / 2 5. if A[mid] = key then 6. return mid 7. else if A[mid] < key then 8. low ← mid + 1 9. else 10. high ← mid - 1 11. return -1
Explanation:
- If the key equals the middle element, return its index.
- If the key is greater, search the right half.
- If the key is smaller, search the left half.
- If not found, return -1.
Time Complexity: O(log n)
Space Complexity: O(1)
Binary Search অ্যালগরিদম
Binary Search একটি sorted array-এ কোনো key খুঁজতে ব্যবহৃত হয়। এটি বারবার array-কে দুই ভাগে বিভক্ত করে অনুসন্ধান করে।
Pseudocode:
BINARY_SEARCH(A, n, key) 1. low ← 0 2. high ← n - 1 3. while low ≤ high do 4. mid ← (low + high) / 2 5. if A[mid] = key then 6. return mid 7. else if A[mid] < key then 8. low ← mid + 1 9. else 10. high ← mid - 1 11. return -1
ব্যাখ্যা:
- key যদি মধ্যম উপাদানের সমান হয়, index ফেরত দেয়।
- key বড় হলে ডান অংশে খোঁজে।
- key ছোট হলে বাম অংশে খোঁজে।
- না পেলে -1 ফেরত দেয়।
Time Complexity: O(log n)
Space Complexity: O(1)
Types of CPU Scheduling
- First Come First Serve (FCFS): Processes are executed in the order of their arrival.
- Shortest Job First (SJF): The process with the shortest burst time is executed first.
- Shortest Remaining Time First (SRTF): Preemptive version of SJF where the process with the shortest remaining time is selected.
- Priority Scheduling: The process with the highest priority is executed first.
- Round Robin (RR): Each process gets a fixed time quantum in cyclic order.
- Multilevel Queue Scheduling: Processes are divided into different queues based on priority or type.
- Multilevel Feedback Queue: Processes can move between queues based on their behavior and execution history.
Best Performing CPU Scheduling Method – Shortest Job First (SJF)
Shortest Job First (SJF) is considered one of the best scheduling algorithms in terms of performance because it minimizes the average waiting time.
- Working Principle: The process with the smallest CPU burst time is selected first.
- Performance: It gives minimum average waiting time among all scheduling algorithms.
- Efficiency: Short processes are completed quickly, improving overall throughput.
- Limitation: It may cause starvation for long processes.
CPU Scheduling-এর বিভিন্ন প্রকার
- First Come First Serve (FCFS): Process আগমনের ক্রমানুসারে execute হয়।
- Shortest Job First (SJF): যে process-এর burst time সবচেয়ে কম, সেটি আগে execute হয়।
- Shortest Remaining Time First (SRTF): এটি SJF-এর preemptive version, যেখানে কম remaining time বিশিষ্ট process নির্বাচন করা হয়।
- Priority Scheduling: সর্বোচ্চ priority বিশিষ্ট process আগে execute হয়।
- Round Robin (RR): প্রতিটি process নির্দিষ্ট time quantum পায় এবং পর্যায়ক্রমে execute হয়।
- Multilevel Queue Scheduling: বিভিন্ন ধরনের process আলাদা queue-তে ভাগ করা হয়।
- Multilevel Feedback Queue: Process-এর behavior অনুযায়ী এক queue থেকে অন্য queue-তে স্থানান্তর করা যায়।
সর্বোত্তম Performance প্রদানকারী CPU Scheduling – Shortest Job First (SJF)
Shortest Job First (SJF) algorithm performance-এর দিক থেকে অন্যতম সেরা, কারণ এটি average waiting time সর্বনিম্ন রাখে।
- Working Principle: যে process-এর CPU burst time সবচেয়ে কম, সেটি আগে execute করা হয়।
- Performance: এটি সব scheduling algorithm-এর মধ্যে সর্বনিম্ন average waiting time প্রদান করে।
- Efficiency: ছোট process দ্রুত সম্পন্ন হওয়ায় throughput বৃদ্ধি পায়।
- Limitations: বড় process-এর ক্ষেত্রে starvation হতে পারে।
#include <stdio.h>
int main() {
int num, i, isPrime = 1;
printf("Enter a number: ");
scanf("%d", &num);
if (num <= 1) {
isPrime = 0;
} else {
for (i = 2; i <= num / 2; i++) {
if (num % i == 0) {
isPrime = 0;
break;
}
}
}
if (isPrime)
printf("%d is a prime number.\n", num);
else
printf("%d is not a prime number.\n", num);
return 0;
}
Types of Information Security Against Cyber Threats
Information Security includes different protective measures to safeguard data and systems from cyber attacks.
- Network Security: Protects network infrastructure from unauthorized access and attacks using Firewall, IDS/IPS, VPN, etc.
- Application Security: Secures software and applications from vulnerabilities through secure coding, patch management, and testing.
- Data Security: Protects sensitive data using encryption, data masking, and backup systems.
- Endpoint Security: Secures end-user devices such as computers and smartphones using antivirus and anti-malware tools.
- Cloud Security: Protects cloud-based systems and data using access control, encryption, and monitoring.
- Identity and Access Management (IAM): Controls user authentication and authorization using passwords, biometrics, and multi-factor authentication (MFA).
- Physical Security: Protects hardware and infrastructure from physical damage or theft.
Conclusion: Effective information security requires a combination of technical, administrative, and physical controls to protect against cyber threats.
Cyber Threat-এর বিরুদ্ধে Information Security-এর প্রকারভেদ
Information Security বিভিন্ন পদ্ধতিতে তথ্য ও সিস্টেমকে সাইবার আক্রমণ থেকে রক্ষা করে।
- Network Security: Firewall, IDS/IPS, VPN ব্যবহার করে নেটওয়ার্ক সুরক্ষা।
- Application Security: Secure coding ও patch management-এর মাধ্যমে সফটওয়্যার সুরক্ষা।
- Data Security: Encryption ও backup-এর মাধ্যমে সংবেদনশীল তথ্য সুরক্ষা।
- Endpoint Security: Antivirus ও anti-malware দ্বারা ব্যবহারকারীর ডিভাইস সুরক্ষা।
- Cloud Security: Cloud system-এ access control ও encryption ব্যবহার।
- Identity and Access Management (IAM): Password, biometric ও MFA-এর মাধ্যমে ব্যবহারকারী যাচাই।
- Physical Security: Hardware ও অবকাঠামো শারীরিকভাবে সুরক্ষা।
- To enforce business rules automatically.
- To maintain data integrity.
- To audit changes (track modifications).
- To automatically update related tables.
CREATE TRIGGER emp_log AFTER INSERT ON Employee FOR EACH ROW BEGIN INSERT INTO Employee_Log(emp_id, action) VALUES (NEW.id, 'New Employee Added'); END;Explanation:
- This trigger runs automatically after a new record is inserted into the Employee table.
- It stores the employee ID and action in the Employee_Log table.
- Business rule স্বয়ংক্রিয়ভাবে প্রয়োগ করতে।
- Data integrity বজায় রাখতে।
- Data পরিবর্তনের লগ রাখতে।
- সম্পর্কিত table স্বয়ংক্রিয়ভাবে update করতে।
CREATE TRIGGER emp_log AFTER INSERT ON Employee FOR EACH ROW BEGIN INSERT INTO Employee_Log(emp_id, action) VALUES (NEW.id, 'New Employee Added'); END;ব্যাখ্যা:
- Employee table-এ নতুন record যোগ হলে trigger স্বয়ংক্রিয়ভাবে কাজ করবে।
- Employee_Log table-এ তথ্য সংরক্ষণ করবে।
Combined Bank, Assistant Programmer, 2024 (MCQ)
Combined Bank
Post: Assistant Programmer
Exam Date: 15.02.2024, Exam Taker: ANZA

Time's up
Combined Bank, Assistant Programmer, 2024
Combined Bank, Assistant Programmer, 2023
Bangladesh Bank, Assistant Programmer, 2023
- 1Data StructureHashingConsider strong entries with integer keys. Suppose the hash function is h (k) = k mod 13. Insert in the given order entries with keys 10, 3, 6, 16, 17, 19 in to the hash table using linear probing to resolve collisions. Show all the work.
The hash function is given as h(k)=k mod 13.
The table size is 13, meaning we have indices from 0 to 12.Step-by-Step Insertion Process
Key: 10
Hash value: h(10) = 10 mod 13 = 10. Insert 10 at index 10.Key: 3
Hash value: h(3) = 3 mod 13 = 3. Insert 3 at index 3.Key: 6
Hash value: h(6) = 6 mod 13 = 6. Insert 6 at index 6.Key: 16
Hash value: h(16) = 16 mod 13 = 3. Index 3 is occupied. Use linear probing and insert 16 at index 4.Key: 17
Hash value: h(17) = 17 mod 13 = 4. Index 4 is occupied. Use linear probing and insert 17 at index 5.Key: 19
Hash value: h(19) = 19 mod 13 = 6. Index 6 is occupied. Use linear probing and insert 19 at index 7.Final Hash Table
Index Value 0 - 1 - 2 - 3 3 4 16 5 17 6 6 7 19 8 - 9 - 10 10 11 - 12 - Summary
The final hash table after inserting all keys using linear probing is as follows:[ - , - , - , 3 , 16 , 17 , 6 , 19 , - , - , 10 , - , - ]
- 2Computer SecurityThreatsDescribe a man-in the middle attack on the Diffie-Hellman key exchange protocol in which the adversary generates two public key pairs for the attack.
Man-in-the-Middle (MITM) Attack on Diffie–Hellman Key Exchange
In a MITM attack on Diffie–Hellman (DH), an attacker (Mallory) sits between Alice and Bob, intercepts their public keys, and replaces them with her own. Since basic DH provides no authentication, Alice and Bob cannot verify the real sender of the public key.
Normal DH (No Attack)
- Public parameters: prime p, generator g
- Alice selects private key a, sends public key A = ga mod p
- Bob selects private key b, sends public key B = gb mod p
- Shared key: K = gab mod p
MITM Attack (Attacker Generates Two Key Pairs)
Step 1: Interception
Mallory intercepts Alice’s public key A and Bob’s public key B.Step 2: Mallory Creates Two Private Keys
Mallory chooses two private keys: m1 (for Bob) and m2 (for Alice).Step 3: Mallory Generates Two Public Keys
Mallory computes:
M1 = gm1 mod p
M2 = gm2 mod pStep 4: Key Replacement (Fake Public Keys)
Mallory sends M1 to Bob pretending it is from Alice.
Mallory sends M2 to Alice pretending it is from Bob.Step 5: Two Different Shared Keys are Formed
- Alice computes: K1 = (M2)a mod p (Alice–Mallory key)
- Bob computes: K2 = (M1)b mod p (Bob–Mallory key)
- Mallory can compute both keys:
K1 = (A)m2 mod p and K2 = (B)m1 mod p
Result
- Alice and Bob do not share the same secret key.
- Mallory shares one key with Alice and another key with Bob.
- Mallory can read, modify, and re-encrypt messages between them.
Why It Works
Because basic Diffie–Hellman does not provide authentication, public keys can be replaced without detection.
Prevention
- Use Authenticated Diffie–Hellman
- Use Digital Signatures / Certificates (PKI)
- Use TLS (DHE/ECDHE + certificates)
Diffie–Hellman Key Exchange-এ Man-in-the-Middle (MITM) Attack
MITM attack-এ attacker (Mallory) Alice এবং Bob-এর মাঝখানে বসে public key গুলো intercept করে এবং নিজের public key বসিয়ে দেয়। Basic Diffie–Hellman-এ authentication নেই, তাই Alice/Bob বুঝতে পারে না public key আসলেই কার কাছ থেকে এসেছে。
Normal DH (Attack নেই)
- Public parameter: prime p, generator g
- Alice private key a নেয়, public key পাঠায় A = ga mod p
- Bob private key b নেয়, public key পাঠায় B = gb mod p
- Shared key: K = gab mod p
MITM Attack (Attacker দুইটি Key Pair তৈরি করে)
Step 1: Interception
Mallory Alice-এর public key A এবং Bob-এর public key B intercept করে।Step 2: Mallory দুইটি Private Key নেয়
Mallory দুইটি private key বেছে নেয়: m1 (Bob-এর জন্য) এবং m2 (Alice-এর জন্য)।Step 3: Mallory দুইটি Public Key তৈরি করে
Mallory হিসাব করে:
M1 = gm1 mod p
M2 = gm2 mod pStep 4: Public Key Replace করে
Mallory Bob-কে M1 পাঠায় (যেন Alice পাঠিয়েছে)।
Mallory Alice-কে M2 পাঠায় (যেন Bob পাঠিয়েছে)।Step 5: দুইটা আলাদা Shared Key তৈরি হয়
- Alice হিসাব করে: K1 = (M2)a mod p (Alice–Mallory key)
- Bob হিসাব করে: K2 = (M1)b mod p (Bob–Mallory key)
- Mallory দুইটাই বের করতে পারে:
K1 = (A)m2 mod p এবং K2 = (B)m1 mod p
Result
- Alice এবং Bob-এর মধ্যে একই secret key তৈরি হয় না।
- Mallory Alice-এর সাথে একটি key এবং Bob-এর সাথে আরেকটি key share করে।
- Mallory মাঝখান থেকে message পড়তে, পরিবর্তন করতে, এবং পুনরায় encrypt করে পাঠাতে পারে।
কেন Attack কাজ করে
Basic Diffie–Hellman-এ authentication নেই, তাই public key সহজে replace করা যায়।
Prevention
- Authenticated Diffie–Hellman ব্যবহার
- Digital Signature / Certificate (PKI) ব্যবহার
- TLS (DHE/ECDHE + certificate) ব্যবহার
- 3Computer SecurityCIAPreserving confidentiality integrity and availability of data is a restatement of the concern over falsification, interception, masquerade and denial of service. Explain how the first three concepts relate to the last four.
The concepts of confidentiality, integrity, and availability (CIA triad) directly address the security concerns of falsification, interception, masquerade, and denial of service.
Confidentiality ensures that sensitive information is accessible only to authorized users, protecting against interception, where data could be accessed or stolen by unauthorized parties.
Integrity guarantees that data remains accurate and unaltered, defending against falsification, which involves malicious modification of data, and masquerade, where attackers assume false identities to tamper with information.
Availability ensures that information and resources are accessible when needed, countering denial of service (DoS) attacks that aim to make systems or data unavailable to legitimate users.
By maintaining confidentiality, integrity, and availability, organizations can effectively mitigate these four major security threats and enhance overall data protection.
Confidentiality, Integrity, Availability (CIA triad)-এর ধারণাগুলো মূলত চারটি security threat-এর সাথে সম্পর্কিত: falsification, interception, masquerade, এবং denial of service।
Confidentiality (গোপনীয়তা): সংবেদনশীল তথ্যকে শুধুমাত্র authorized users-এর জন্য accessible রাখে। এটি interception থেকে রক্ষা করে, অর্থাৎ unauthorized ব্যক্তি তথ্য access বা steal করতে পারবে না.
Integrity (অখণ্ডতা): নিশ্চিত করে যে তথ্য correct এবং unaltered আছে। এটি falsification থেকে রক্ষা করে, যেখানে data maliciously modify করা হয়, এবং masquerade থেকে, যেখানে attacker false identity ব্যবহার করে information manipulate করতে পারে.
Availability (উপলব্ধতা): তথ্য এবং resources ব্যবহারকারীদের প্রয়োজন অনুযায়ী accessible রাখে। এটি denial of service (DoS) attack থেকে রক্ষা করে, যা legitimate users-এর জন্য system বা data কে unavailable করতে চায়.
সারসংক্ষেপে, maintaining the CIA triad এই চারটি security threat mitigate করতে সাহায্য করে এবং overall data protection ensure করে।
- 4Programming ConceptGiven two integers A and B as input write a program to compute the least common multiple of A and B.
#include <stdio.h> int main () { int n1, n2, max; printf ("Enter two positive integers: "); scanf ("%d %d", &n1, &n2); // maximum number between n1 and n2 is stored in max max = (n1> n2) ? n1: n2; while (1) { // Check if max is divisible by both n1 and n2 if ((max% n1 == 0)&& (max % n2 ==0)) { // If true, max is the LCM of n1 and n2 printf("The LCM of %d and %d is %d.", n1,n2,max); break; } ++max; } return 0; }
Sample I/O: Enter two positive integers: 14 8 The LCM of 14 and 8 is 56. === Code Execution Successful ===🔗 Run Online: LCM of two integer
- 5Programming ConceptConsider the following code:
Public class Class A {
Mention which of the methods overload, override and hied supper class methods. What about the remaining method?
Public void m1 () {}
Public void m2 (int i) {}
Public void m3 (int i) {}
Public static void m4 (int i) {}
Public class class B extends class A {
Public static void ml (int i) {}
Public void m2 (int i) {}
Public void m3 (string s) {}
Public static void m4 (int i) {}
- 6Data StructureHeap4Given the adjacency list representation of a complete binary tree with 7 vertices, write the equivalent adjacency matrix representation. Assume that the vertices are numbered from 1 to 7 as in a binary heap.Complete Binary Tree
Adjacency List Representation
Adjacency Matrix RepresentationVertex Connected Vertices 1 2, 3 2 4, 5 3 6, 7 4 5 6 7 1 2 3 4 5 6 7 1 0 1 1 0 0 0 0 2 0 0 0 1 1 0 0 3 0 0 0 0 0 1 1 4 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0
Complete Binary Tree
Adjacency List Representation
Adjacency Matrix RepresentationVertex Connected Vertices 1 2, 3 2 4, 5 3 6, 7 4 5 6 7 1 2 3 4 5 6 7 1 0 1 1 0 0 0 0 2 0 0 0 1 1 0 0 3 0 0 0 0 0 1 1 4 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0
- 7Database Management SystemKeysSuppose that we have a relational database with the following table. Underlined one represent primary key
Movies (mid, title, year)
Write a SQL query to return the number of movies that are romantic comedies.
People (pid, name)
Genres (gid, genre)
HasRole (pid, mid, role)
Has Genre (gid, mid)SELECT COUNT(*) FROM Movies, Genres, HasGenre WHERE Movies.mid = HasGenre.mid AND HasGenre.gid = Genres.gid AND Genres.genre = "romantic comedy";
- 8Computer NetworkOSI/TCP-IPIn order to prevent that the company decided to add end to end encryption techniques which layer of the OSI model is suitable to work in considering parameters like development time, software maintainability and development cost, Give reasons for your concepts.
Suitable OSI Layer for End-to-End Encryption
To implement end-to-end encryption (E2EE) while considering development time, software maintainability, and development cost, the most suitable layer of the OSI model is the Application Layer (Layer 7).
Reasons for Choosing the Application Layer
- Faster Development Time: Encryption at the application layer can be implemented directly within the application logic. Developers do not need to modify lower-level networking protocols, which significantly reduces development time.
- Better Software Maintainability: Application-layer encryption is easier to update, debug, and maintain. Changes can be made without affecting the underlying network infrastructure or operating system.
- Lower Development Cost: No changes are required in routers, switches, or transport-layer implementations. This avoids hardware upgrades and reduces overall implementation cost.
- True End-to-End Security: Data is encrypted at the sender’s application and decrypted only at the receiver’s application. Intermediate systems (routers, proxies, servers) cannot read the data.
- Platform Independence: Application-layer encryption works across different networks, protocols, and platforms without compatibility issues.
Why Not Lower Layers?
- Transport Layer (e.g., TLS): Requires certificate management and protocol-level integration, increasing complexity and cost.
- Network/Data Link Layers: Require hardware or OS-level changes, leading to high cost and poor maintainability.
Considering development time, cost efficiency, and long-term maintainability, implementing end-to-end encryption at the Application Layer is the best and most practical choice.
End-to-End Encryption-এর জন্য উপযুক্ত OSI Layer
End-to-end encryption (E2EE) বাস্তবায়নের ক্ষেত্রে যদি development time, software maintainability এবং development cost বিবেচনা করা হয়, তাহলে OSI model-এর মধ্যে সবচেয়ে উপযুক্ত হলো Application Layer (Layer 7)।
Application Layer নির্বাচন করার কারণ
- কম Development Time: Application layer-এ encryption সরাসরি application logic-এর ভেতরে implement করা যায়। নিচের network protocol পরিবর্তনের প্রয়োজন হয় না, ফলে সময় কম লাগে।
- সহজ Software Maintainability: Application-level encryption সহজে update, debug এবং maintain করা যায়। Network বা OS পরিবর্তন ছাড়াই security update সম্ভব।
- কম Development Cost: Router, switch বা hardware পরিবর্তনের দরকার হয় না। এতে implementation cost অনেক কমে যায়।
- প্রকৃত End-to-End Security: Sender-এর application-এ data encrypt হয় এবং receiver-এর application-এই decrypt হয়। মাঝখানের কোনো system data পড়তে পারে না।
- Platform Independent: Application layer encryption বিভিন্ন network ও platform-এ একইভাবে কাজ করে।
নিচের Layer গুলো কেন উপযুক্ত নয়?
- Transport Layer (যেমন TLS): Certificate management ও protocol complexity বেশি, ফলে খরচ ও রক্ষণাবেক্ষণ কঠিন।
- Network/Data Link Layer: Hardware বা OS পরিবর্তন দরকার হয়, যা ব্যয়বহুল ও জটিল।
Development time, খরচ এবং ভবিষ্যৎ maintainability বিবেচনা করলে Application Layer-এ end-to-end encryption বাস্তবায়নই সবচেয়ে কার্যকর সমাধান।
- 9Computer NetworkOthersDraw A class diagram. A token-ring based local area network (LAN) is a network consisting of nodes in which network packets are sent around. Every node has a unique name within the network, and refers to its next node. Different kinds of nodes exist: Workstations are originators of messages; servers and printers are network nodes that can receive messages. Packets contain an originator a destination and content, and are sent around on a network. A LAN is a circular configuration of nodes.
- 10Object Oriented ProgrammingBasicDetermine overloading method, overridden method and hide super class method?
Method Overloading, Method Overriding, and Method Hiding
1. Method Overloading
Method overloading occurs when multiple methods in the same class have the same method name but different parameter lists (different number, type, or order of parameters).
- Resolved at compile time
- Improves code readability and flexibility
Example:
int add(int a, int b) int add(int a, int b, int c)2. Method Overriding
Method overriding happens when a subclass provides a new implementation of a method that is already defined in its superclass with the same method signature.
- Occurs in inheritance
- Resolved at runtime (runtime polymorphism)
- Method must be non-static
Example:
class Parent { void show() { } } class Child extends Parent { void show() { } }3. Method Hiding (Hiding Superclass Method)
Method hiding occurs when a static method in a subclass has the same name and signature as a static method in the superclass.
- Applies only to static methods
- Resolved at compile time
- Not true overriding
Example:
class Parent { static void display() { } } class Child extends Parent { static void display() { } }Summary Comparison
- Overloading: Same class, same method name, different parameters
- Overriding: Subclass redefines superclass method (non-static)
- Hiding: Static method in subclass hides static method of superclass
Method Overloading, Method Overriding এবং Method Hiding
১. Method Overloading
একই class-এর ভেতরে একই নামের method থাকলে কিন্তু তাদের parameter আলাদা হলে তাকে method overloading বলে।
- Compile time-এ সিদ্ধান্ত হয়
- Code সহজ ও flexible হয়
উদাহরণ:
int add(int a, int b) int add(int a, int b, int c)২. Method Overriding
Subclass যখন superclass-এর একটি non-static method একই signature দিয়ে নতুনভাবে implement করে, তখন তাকে method overriding বলে।
- Inheritance-এর ক্ষেত্রে হয়
- Runtime-এ সিদ্ধান্ত হয়
উদাহরণ:
class Parent { void show() { } } class Child extends Parent { void show() { } }৩. Method Hiding (Superclass Method Hide করা)
Subclass যদি superclass-এর static method একই নাম ও signature দিয়ে define করে, তাহলে তাকে method hiding বলে।
- শুধু static method-এর ক্ষেত্রে হয়
- Compile time-এ resolve হয়
- এটা real overriding নয়
উদাহরণ:
class Parent { static void display() { } } class Child extends Parent { static void display() { } }সংক্ষেপে পার্থক্য
- Overloading: একই class, আলাদা parameter
- Overriding: Subclass superclass-এর method পরিবর্তন করে
- Hiding: Static method subclass দ্বারা hide হয়
- 11Non Technical QuestionNon tech10. Growing use to technology in the Financial Service Industry.
11. Translation English to Bangla.
12. Translation Bangla to English.
13. If x is an Integer and x + 1/x= 17/4, then value of x – 1/x =?
14. A basketball team has won 15 games and lost 9. If these games represent 16% of the games to be played, then how many more games must the team win to average 75% for the season?
15. Students of a class are made to stand in rows. If students are extra in each row, then there would be 2 rows less. If four students are less in each row, then there would be 4 more rows. What is the number of students in the class?
16. In the given figure, PQT is a right triangle then what is the area of square QRST.
Bangladesh Bank, Assistant Programmer, 2023 (MCQ)
Bangladesh Bank
Post: Assistant Programmer
Exam Date: 03.02.2023, Exam Taker: BIBM

Time's up
SPCBL, Sub Assistant Programmer, 2022ok
- 1Computer NetworkWhat is Blacklist and Whitelist? Write down the Difference between Black list and white list.
Blacklist
A Blacklist is a list of users, IP addresses, websites, or applications that are explicitly blocked from accessing a system or network.
Whitelist
A Whitelist is a list of users, IP addresses, websites, or applications that are explicitly allowed to access a system or network. Everything else is blocked by default.
Difference between Blacklist and Whitelist
- Access Rule: Blacklist blocks specific entities; Whitelist allows only specific entities.
- Default Behavior: Blacklist allows all except blocked ones; Whitelist blocks all except allowed ones.
- Security Level: Blacklist is less secure; Whitelist is more secure.
- Use Case: Blacklist is used to block known threats; Whitelist is used in high-security environments.
Blacklist
Blacklist হলো এমন একটি তালিকা যেখানে নির্দিষ্ট user, IP address, website বা application-কে block করে রাখা হয় যাতে তারা system বা network access না পায়।
Whitelist
Whitelist হলো এমন একটি তালিকা যেখানে শুধুমাত্র নির্দিষ্ট user, IP address, website বা application-কে allow করা হয়। তালিকার বাইরে থাকা সবকিছু block থাকে।
Blacklist এবং Whitelist-এর পার্থক্য
- Access Rule: Blacklist নির্দিষ্ট entity block করে; Whitelist নির্দিষ্ট entity allow করে।
- Default Behavior: Blacklist-এ সব allow থাকে শুধু blocked ছাড়া; Whitelist-এ সব block থাকে শুধু allowed ছাড়া।
- Security Level: Blacklist তুলনামূলক কম secure; Whitelist বেশি secure।
- Use Case: Blacklist পরিচিত threat block করতে ব্যবহৃত হয়; Whitelist উচ্চ security পরিবেশে ব্যবহৃত হয়।
- 2Programming ConceptWhat is the difference between exception and Error in java?
Difference between Exception and Error in Java
- Meaning: Exception represents conditions that a program can handle; Error represents serious problems that a program cannot handle.
- Recovery: Exceptions can be caught and handled using try-catch; Errors are generally not recoverable.
- Cause: Exceptions occur due to logical issues or user input; Errors occur due to system-level failures.
- Examples: Exception – NullPointerException, ArithmeticException; Error – OutOfMemoryError, StackOverflowError.
- Package: Both belong to java.lang package, but Error is not meant to be handled.
Java-তে Exception এবং Error-এর পার্থক্য
- অর্থ: Exception হলো এমন সমস্যা যা program handle করতে পারে; Error হলো গুরুতর সমস্যা যা program handle করতে পারে না।
- Recovery: Exception try-catch দিয়ে handle করা যায়; Error সাধারণত recover করা যায় না।
- কারণ: Exception হয় logical সমস্যা বা ভুল input-এর কারণে; Error হয় system-level failure-এর কারণে।
- উদাহরণ: Exception – NullPointerException, ArithmeticException; Error – OutOfMemoryError, StackOverflowError।
- Package: দুটোই java.lang package-এর অন্তর্ভুক্ত, তবে Error handle করার জন্য নয়।
- 3Programming ConceptWhat is exception handling? Write with an example.
Exception Handling
Exception handling is a mechanism used in programming to handle runtime errors so that the normal flow of the program is not interrupted. It helps detect errors and provides a way to recover from them.
Example (Java):
try { int a = 10; int b = 0; int c = a / b; System.out.println(c); } catch (ArithmeticException e) { System.out.println("Division by zero is not allowed"); }Here, the exception is caught and handled instead of crashing the program.
Exception Handling
Exception handling হলো programming-এর একটি পদ্ধতি যেখানে runtime error ঘটলে তা handle করা হয়, যাতে program হঠাৎ বন্ধ না হয়ে যায় এবং স্বাভাবিকভাবে চলতে পারে।
উদাহরণ (Java):
try { int a = 10; int b = 0; int c = a / b; System.out.println(c); } catch (ArithmeticException e) { System.out.println("Division by zero is not allowed"); }এখানে error ঘটলেও program বন্ধ না হয়ে error message দেখায়।
- 4Database Management SystemWhat is DBMS? Write short note on Virtual memory and Cache memory
DBMS (Database Management System)
A DBMS is software that is used to create, store, manage, and retrieve data efficiently from a database. It provides an interface between users/applications and the database.
Virtual Memory
Virtual memory is a memory management technique that uses a part of secondary storage (hard disk) as an extension of main memory (RAM). It allows programs to run even if the physical memory is insufficient.
Cache Memory
Cache memory is a small, high-speed memory located between the CPU and main memory. It stores frequently accessed data and instructions to improve system performance.
DBMS (Database Management System)
DBMS হলো এমন একটি software যা database তৈরি, সংরক্ষণ, পরিচালনা এবং data retrieve করার জন্য ব্যবহৃত হয়। এটি user/application এবং database-এর মধ্যে interface হিসেবে কাজ করে।
Virtual Memory
Virtual memory হলো একটি memory management technique যেখানে secondary storage (hard disk)-এর একটি অংশ main memory (RAM)-এর মতো ব্যবহার করা হয়। এতে physical memory কম হলেও program চলতে পারে।
Cache Memory
Cache memory হলো CPU এবং main memory-এর মাঝখানে থাকা একটি ছোট ও দ্রুতগতির memory। এটি বারবার ব্যবহৃত data ও instruction সংরক্ষণ করে system performance বাড়ায়।
- 5Object Oriented ProgrammingDescribe Dynamic memory allocation in programming in C.
Dynamic Memory Allocation in C
Dynamic memory allocation in C refers to allocating memory at runtime using standard library functions. Unlike static memory, dynamic memory can be allocated and freed as needed during program execution.
Functions used:
- malloc(): Allocates a block of memory.
- calloc(): Allocates memory and initializes it to zero.
- realloc(): Changes the size of previously allocated memory.
- free(): Releases allocated memory.
Example:
int *ptr; ptr = (int*)malloc(5 * sizeof(int));Here, memory for 5 integers is allocated dynamically.
C Programming-এ Dynamic Memory Allocation
Dynamic memory allocation হলো program চলাকালীন (runtime) memory বরাদ্দ করার পদ্ধতি। এটি প্রয়োজন অনুযায়ী memory allocate ও deallocate করতে সাহায্য করে।
ব্যবহৃত function:
- malloc(): Memory allocate করে।
- calloc(): Memory allocate করে এবং zero দিয়ে initialize করে।
- realloc(): আগের memory-এর size পরিবর্তন করে।
- free(): Allocate করা memory মুক্ত করে।
উদাহরণ:
int *ptr; ptr = (int*)malloc(5 * sizeof(int));এখানে 5টি integer-এর জন্য dynamically memory allocate করা হয়েছে।
- 6Database Management SystemDifference between data and information?


- 7Programming ConceptDifference between High level language low level languages with some example?

Examples:
- High-Level Languages: C, C++, Java, Python, etc.
- Low-Level Languages: Assembly Language, Machine Code.
- 8Computer SecurityDifferent AttackWhat is SQL injection? How to prevent it?
SQL Injection
SQL Injection is a web security vulnerability where an attacker inserts malicious SQL code into a query to manipulate or access the database without authorization. It can lead to data theft, data modification, or complete database compromise.
How to Prevent SQL Injection
- Use Prepared Statements: Parameterized queries prevent malicious SQL execution.
- Input Validation: Validate and sanitize user inputs.
- Use Stored Procedures: Reduces direct SQL execution.
- Limit Database Privileges: Use least-privilege principle.
- Web Application Firewall (WAF): Blocks common SQL injection patterns.
SQL Injection
SQL Injection হলো একটি web security vulnerability যেখানে attacker malicious SQL code ব্যবহার করে database-এ unauthorized access পায়। এতে data চুরি, পরিবর্তন বা database সম্পূর্ণ নষ্ট হয়ে যেতে পারে।
SQL Injection প্রতিরোধের উপায়
- Prepared Statement ব্যবহার: Parameterized query malicious SQL execute হতে দেয় না।
- Input Validation: User input যাচাই ও sanitize করা।
- Stored Procedure ব্যবহার: Direct SQL execution কমায়।
- Database Privilege সীমিত করা: Least privilege নীতি অনুসরণ করা।
- Web Application Firewall (WAF): SQL injection attack block করে।
- 9Computer SecurityDifferent AttackWhat is Cross site script (XSS) and how can fix it?
Cross-Site Scripting (XSS)
XSS (Cross-Site Scripting) is a web security vulnerability where an attacker injects malicious scripts into trusted websites. These scripts run in the victim’s browser and can steal sensitive information like cookies, session tokens, or redirect users to malicious sites.
How to Fix / Prevent XSS
- Input Validation: Validate and sanitize all user inputs.
- Output Encoding: Encode data before displaying it on web pages.
- Use Security Headers: Implement Content Security Policy (CSP).
- Avoid Inline Scripts: Reduce use of inline JavaScript.
- Use Secure Frameworks: Modern frameworks handle XSS automatically.
Cross-Site Scripting (XSS)
XSS (Cross-Site Scripting) হলো একটি web security vulnerability যেখানে attacker একটি trusted website-এ malicious script inject করে। এই script user-এর browser-এ execute হয় এবং cookie, session information চুরি করতে পারে বা malicious site-এ redirect করতে পারে।
XSS প্রতিরোধের উপায়
- Input Validation: User input যাচাই ও sanitize করা।
- Output Encoding: Web page-এ দেখানোর আগে data encode করা।
- Security Header ব্যবহার: Content Security Policy (CSP) প্রয়োগ করা।
- Inline Script এড়ানো: Inline JavaScript কম ব্যবহার করা।
- Secure Framework ব্যবহার: আধুনিক framework XSS handle করতে সাহায্য করে।
- 10Data StructureStackDifference LIFO and FIFO in data structure?
Difference Between FIFO and LIFO in Data Structures:

6 Banks & Fin. Institutions, Assistant Programmer, 2021
- 1Data StructureTopological SortTopological sorting for Directed Acyclie Graph (DAG) is a linear ordering of vertices such that for every directed edge u v, vertex u comes before v in the ordering. Topological Sorting for a graph is not possible if the graph is not a DAG. Now write a C/C++ Program with the following input and Output.
Input: 5 2, 5 0, 4 0, 4 1, 2 3, 3 1
Output: 5 4 2 3 1 0#include <bits/stdc++.h> using namespace std; // Function to perform DFS and topological sorting void topologicalSortUtil(int v, vector<vector<int>> &adj, vector<bool> &visited, stack<int> &st) { // Mark the current node as visited visited[v] = true; // Recur for all adjacent vertices for (int i : adj[v]) { if (!visited[i]) topologicalSortUtil(i, adj, visited, st); } // Push current vertex to stack which stores the result st.push(v); } vector<vector<int>> constructAdj(int V, vector<vector<int>> &edges) { vector<vector<int>> adj(V); for (auto it : edges) { adj[it[0]].push_back(it[1]); } return adj; } // Function to perform Topological Sort vector<int> topologicalSort(int V, vector<vector<int>> &edges) { // Stack to store the result stack<int> st; vector<bool> visited(V, false); vector<vector<int>> adj = constructAdj(V, edges); // Call the recursive helper function for all vertices for (int i = 0; i < V; i++) { if (!visited[i]) topologicalSortUtil(i, adj, visited, st); } vector<int> ans; // Append contents of stack while (!st.empty()) { ans.push_back(st.top()); st.pop(); } return ans; } int main() { int V = 6; vector<vector<int>> edges = { {2, 3}, {3, 1}, {4, 0}, {4, 1}, {5, 0}, {5, 2} }; vector<int> ans = topologicalSort(V, edges); for (int node : ans) { cout << node << " "; } cout << endl; return 0; }
Source:geeksforgeeks
a href="https://www.programiz.com/online-compiler/20mfFnuoVULmt"> Code link
- 2Programming ConceptWrite a C/C++ program to check Balanced parentheses in an Expression.
#include <bits/stdc++.h> using namespace std; // function to check if brackets are balanced bool areBracketsBalanced(string expr) { stack s; char x; // Traversing the Expression for (int i = 0; i < expr.length(); i++) { if (expr[i] == '(' || expr[i] == '[' || expr[i] == '{') { // Push the element in the stack s.push(expr[i]); continue; } // IF current current character is not opening // bracket, then it must be closing. So stack // cannot be empty at this point. if (s.empty()) return false; switch (expr[i]) { case ')': // Store the top element in a x = s.top(); s.pop(); if (x == '{' || x == '[') return false; break; case '}': // Store the top element in b x = s.top(); s.pop(); if (x == '(' || x == '[') return false; break; case ']': // Store the top element in c x = s.top(); s.pop(); if (x == '(' || x == '{') return false; break; } } // Check Empty Stack return (s.empty()); } // Driver code int main() { string expr; // Taking input from the user cout << "Enter an expression: "; cin >> expr; // Function call if (areBracketsBalanced(expr)) cout << "Balanced\n"; else cout << "Not Balanced\n"; return 0; }
Source : GeeksforGeeks
- 3Programming ConceptWe are given an array of integers and a range, we need to find whether the subarray which falls in this range has values in the form of a mountain or not. All values of the subarray are said to be in the form of a mountain if either all values are increasing or decreasing or first increasing and then decreasing. Write a C/C++ Program that shows input is a Mountain sequence or Not Mountain sequence.
#include <bits/stdc++.h> using namespace std; #define ll long long bool isMountain(vector<ll> a) { ll n = a.size(); if (n < 3) return false; ll i = 1; // Increasing part while (i < n && a[i] > a[i - 1]) { i++; } // Peak cannot be first or last if (i == 1 || i == n) return false; // Decreasing part while (i < n && a[i] < a[i - 1]) { i++; } return i == n; } int main() { ll n; cin >> n; vector<ll> a(n); for (ll i = 0; i < n; i++) { cin >> a[i]; } if (isMountain(a)) { cout << "Mountain" << endl; } else { cout << "Not Mountain" << endl; } return 0; }
Source: Geeksforgeeks
- 4Programming ConceptGiven n jobs starting time n[] and duration d[], print maximum number of jobs that don't overlap between each other.
#include <bits/stdc++.h> using namespace std; #define N 6 // Define structure for Activity struct Activity { int start, finish; }; // Function to compare two activities bool Sort_activity(Activity s1, Activity s2) { return (s1.finish < s2.finish); // Sort by finish time } // Function to print the maximum number of activities void print_Max_Activities(Activity arr[], int n) { // Sort activities based on finish time sort(arr, arr + n, Sort_activity); cout << "Following activities are selected: \n"; int i = 0; cout << "(" << arr[i].start << ", " << arr[i].finish << ")\n"; // Select the next activity that starts after the last selected activity finishes for (int j = 1; j < n; j++) { if (arr[j].start >= arr[i].finish) { cout << "(" << arr[j].start << ", " << arr[j].finish << ")\n"; i = j; } } } int main() { Activity arr[N]; // Taking input from the user for (int i = 0; i < N; i++) { cout << "Enter the start and finish time for job " << i + 1 << " : "; cin >> arr[i].start >> arr[i].finish; } // Function call to print the selected activities print_Max_Activities(arr, N); return 0; }
Code Link
- 5Programming ConceptWrite a C/C++ Program that has a Class Account, Subclass Savings Account, Current Account etc with related hierarchy way.
Code Link#include <iostream> #include <string> using namespace std; // Bank Management System using Class & Inheritance in C++ /* 1. Saving Account 2. Current Account 3. Account Creation 4. Deposit 5. Withdraw 6. Balance */ class account { private: string name; int accno; string atype; public: void getAccountDetails() { cout << "\nEnter Customer Name : "; cin >> name; cout << "Enter Account Number : "; cin >> accno; cout << "Enter Account Type : "; cin >> atype; } void displayDetails() { cout << "\n\nCustomer Name : " << name; cout << "\nAccount Number : " << accno; cout << "\nAccount Type : " << atype; } }; class current_account : public account { private: float balance = 0; public: void c_display() { cout << "\nBalance : " << balance; } void c_deposit() { float deposit; cout << "\nEnter amount to Deposit : "; cin >> deposit; balance = balance + deposit; } void c_withdraw() { float withdraw; cout << "\n\nBalance : " << balance; cout << "\nEnter amount to be withdraw : "; cin >> withdraw; if (balance >= withdraw && balance > 1000) { balance = balance - withdraw; cout << "\nBalance Amount After Withdraw: " << balance; } else { cout << "\nInsufficient Balance"; } } }; class saving_account : public account { private: float sav_balance = 0; public: void s_display() { cout << "\nBalance : " << sav_balance; } void s_deposit() { float deposit, interest; cout << "\nEnter amount to Deposit : "; cin >> deposit; sav_balance = sav_balance + deposit; interest = (sav_balance * 2) / 100; sav_balance = sav_balance + interest; } void s_withdraw() { float withdraw; cout << "\nBalance : " << sav_balance; cout << "\nEnter amount to be withdraw : "; cin >> withdraw; if (sav_balance >= withdraw && sav_balance > 500) { sav_balance = sav_balance - withdraw; cout << "\nBalance Amount After Withdraw: " << sav_balance; } else { cout << "\nInsufficient Balance"; } } }; int main() { current_account c1; saving_account s1; char type; int choice; cout << "\nEnter S for saving customer and C for current a/c customer : "; cin >> type; if (type == 's' || type == 'S') { s1.getAccountDetails(); while (1) { cout << "\nChoose Your Choice" << endl; cout << "1) Deposit" << endl; cout << "2) Withdraw" << endl; cout << "3) Display Balance" << endl; cout << "4) Display with full Details" << endl; cout << "5) Exit" << endl; cout << "Enter Your choice: "; cin >> choice; switch (choice) { case 1: s1.s_deposit(); break; case 2: s1.s_withdraw(); break; case 3: s1.s_display(); break; case 4: s1.displayDetails(); s1.s_display(); break; case 5: goto end; default: cout << "\n\nEntered choice is invalid, TRY AGAIN"; } } } else if (type == 'c' || type == 'C') { c1.getAccountDetails(); while (1) { cout << "\nChoose Your Choice" << endl; cout << "1) Deposit" << endl; cout << "2) Withdraw" << endl; cout << "3) Display Balance" << endl; cout << "4) Display with full Details" << endl; cout << "5) Exit" << endl; cout << "Enter Your choice: "; cin >> choice; switch (choice) { case 1: c1.c_deposit(); break; case 2: c1.c_withdraw(); break; case 3: c1.c_display(); break; case 4: c1.displayDetails(); c1.c_display(); break; case 5: goto end; default: cout << "\n\nEntered choice is invalid, TRY AGAIN"; } } } else { cout << "\nInvalid Account Selection"; } end: cout << "\nThank You for Banking with us.."; return 0; } - 6Structure Query Language
7. Write SQL command from the following tables.
(a) Find name, street, city who work for First Corporation Bank and earn more than 30000
Employee (ename, street, city)
Works (ename, cname, salary, joindate)
Company (cname, city)
Manages (ename, mname)
(b) Find name of all employees, who live in the same city and company for which they work.
(c) Give all employees of First Century Bank 10 percent salary raise.
(d) Find the company with payroll less than 100000.a) answer:SELECT cname FROM Works GROUP BY cname HAVING SUM(salary) < 100000;
b)answer:SELECT e.ename FROM Employee e, Works w, Company c WHERE e.city = c.city AND w.cname = c.cname AND e.ename = w.ename AND e.city = w.city;
c)answer:UPDATE Works SET salary = salary + salary * 0.1 WHERE cname = 'First Century Bank';
d)answer:SELECT cname FROM Works GROUP BY cname HAVING SUM(salary) < 100000;
- 7Object Oriented ProgrammingBasicWrite the definition of Inheritance, Polymorphism with coding example.
Inheritance:
Inheritance is an important concept of Object-Oriented Programming (OOP) where one class (child class) can acquire the properties and methods of another class (parent class). It helps in code reuse and creates a relationship between classes.Example (C++):
#include <iostream> using namespace std; class Animal { public: void eat() { cout << "Animal is eating" << endl; } }; class Dog : public Animal { public: void bark() { cout << "Dog is barking" << endl; } }; int main() { Dog d; d.eat(); // inherited function d.bark(); // own function }In this example, the Dog class inherits the eat() function from the Animal class.
Polymorphism:
Polymorphism means “many forms”. It allows the same function name to perform different tasks depending on the situation. It improves flexibility and reusability in programs.Example (Function Overloading in C++):
#include <iostream> using namespace std; class Math { public: int add(int a, int b) { return a + b; } double add(double a, double b) { return a + b; } }; int main() { Math m; cout << m.add(5, 3) << endl; cout << m.add(4.5, 2.3) << endl; }Here the function add() works in different ways depending on the data type of the arguments. This is an example of polymorphism.
Inheritance:
Inheritance হলো Object-Oriented Programming (OOP)-এর একটি গুরুত্বপূর্ণ ধারণা যেখানে একটি class (child class) অন্য একটি class (parent class)-এর properties এবং methods গ্রহণ করতে পারে। এটি code reuse করতে সাহায্য করে এবং class-এর মধ্যে relationship তৈরি করে।Example (C++):
#include <iostream> using namespace std; class Animal { public: void eat() { cout << "Animal is eating" << endl; } }; class Dog : public Animal { public: void bark() { cout << "Dog is barking" << endl; } }; int main() { Dog d; d.eat(); // inherited function d.bark(); // own function }এখানে Dog class, Animal class-এর eat() function inherit করেছে।
Polymorphism:
Polymorphism অর্থ “many forms”। অর্থাৎ একই function নাম বিভিন্ন পরিস্থিতিতে ভিন্নভাবে কাজ করতে পারে। এটি program-এর flexibility এবং reusability বৃদ্ধি করে।Example (Function Overloading in C++):
#include <iostream> using namespace std; class Math { public: int add(int a, int b) { return a + b; } double add(double a, double b) { return a + b; } }; int main() { Math m; cout << m.add(5, 3) << endl; cout << m.add(4.5, 2.3) << endl; }এখানে add() function একই নাম ব্যবহার করেও ভিন্ন data type-এর জন্য ভিন্নভাবে কাজ করছে। এটিই polymorphism।
- 8Theory of ComputationDFAState diagram of DFA using binary strings having 0 with multiple of 3 on input {0,1}. Also showing regular expression.

Regular Expression
For binary strings over the alphabet Σ = {0,1} that contain a number of 0's which is a multiple of 3, the regular expression is:
1*(01*01*01*)*1*
Explanation
• 1* allows any number of 1's (including none) before, between, and after the zeros.
• 01*01*01* represents exactly three 0's, where each pair of 0's may be separated by any number of 1's.
• (01*01*01*)* repeats this group any number of times, ensuring the total number of 0's is always a multiple of 3.Examples
Accepted Strings:
ε
111
000
010010
101001010111
000111000Rejected Strings:
0
00
0000
10001
6 Bank & Financial Institution, Assistant Programmer, 2021(MCQ)
6 Banks & Financial Institution
Post: Assistant Programmer
Exam Date: 18/03/2021

Time's up


Adjacency List Representation
[source:







