SGFL Assistant Engineer (IT) Exam 2023 — Question Solution | সিলেট গ্যাস ফিল্ডস (এসজিএফএল) সহকারী প্রকৌশলী (আইটি) নিয়োগ পরীক্ষা ২০২৩ — প্রশ্ন সমাধান
- SGFL
- Assistant Engineer (IT)
- 2023
- 7 questions · 0 MCQ, 7 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The SGFL Assistant Engineer (IT) exam was held in 2023, conducted by BUET. The paper had 7 written questions. The subjects asked most were Algorithms (1), Cyber Security (1) and Data Structures (1). 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
- SGFL
- Post
- Assistant Engineer (IT)
- Exam date
- 2023
- Conducted by
- BUET
- Questions
- 7 (0 MCQ, 7 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
What is an SQL Injection attack? How is it launched?
Model answer
SQL injection (SQLi) is a web-application attack in which an attacker enters specially crafted text into an input that the application places, unchecked, inside an SQL statement. The database then runs commands the developer never intended: reading, changing or deleting data, or bypassing a login.
Why it is possible: the program builds the query by concatenating user input into the SQL string, so the database cannot tell the developer's code apart from the attacker's data.
How the attack is launched
- Find an entry point: any input that reaches the database, such as a login or search form, a URL parameter (
?id=5), a cookie or an HTTP header. - Probe it: submit characters that have meaning in SQL (a single quote, a comment marker
--, a condition such asOR 1=1) and watch for errors, changed results or delays. - Craft the payload: write input that changes the logic of the query, for example an always-true condition or commenting out the rest of the statement.
- Exploit: read other users' records, bypass authentication, or modify and delete data; in severe cases the attacker can take over the database server.
Example (staff salary lookup)
The vulnerable code builds ... WHERE name = '<input>'. If the attacker types x' OR 1=1 --, the query becomes
SELECT name, salary FROM staff WHERE name = 'x' OR 1=1 --'
OR 1=1 is true for every row, and -- turns the trailing quote into a comment (as in SQLite, used in the demo below; MySQL needs a space after --), so every employee's salary is returned. The parameterised version sends the input separately as data, so it is treated only as a strange name:
import sqlite3
db = sqlite3.connect(":memory:")
db.execute("CREATE TABLE staff (id INTEGER, name TEXT, salary INTEGER)")
db.executemany("INSERT INTO staff VALUES (?, ?, ?)",
[(1, "Rina", 42000), (2, "Tareq", 51000), (3, "Mitu", 47000)])
def find_unsafe(name): # string concatenation: vulnerable
sql = "SELECT name, salary FROM staff WHERE name = '" + name + "'"
return db.execute(sql).fetchall()
def find_safe(name): # parameterised query: safe
return db.execute("SELECT name, salary FROM staff WHERE name = ?", (name,)).fetchall()
typed = "x' OR 1=1 --"
print("normal :", find_unsafe("Rina"))
print("unsafe :", find_unsafe(typed))
print("safe :", find_safe(typed))
Output:
normal : [('Rina', 42000)]
unsafe : [('Rina', 42000), ('Tareq', 51000), ('Mitu', 47000)]
safe : []
sequenceDiagram
participant A as Attacker
participant W as Web application
participant D as Database
A->>W: Types crafted text in the search box
W->>D: Query built by joining the text into SQL
D-->>W: Condition is always true so all rows match
W-->>A: Every employee salary is displayed
Types: in-band (error-based, UNION-based), blind (boolean-based, time-based) and out-of-band.
Impact: data theft, login bypass, data tampering or deletion, and in severe cases full server compromise.
Prevention
- Parameterised queries / prepared statements (the primary fix), or an ORM that uses them.
- Allow-list input validation (e.g. an ID must be digits).
- A least-privilege database account, so the web app cannot drop tables.
- Generic error messages (hide database errors from users).
- A Web Application Firewall (WAF) as an extra layer.
Exam tip: SQL injection = untrusted input concatenated into an SQL query changes its logic; it is launched through forms, URLs or cookies, and stopped by parameterised queries.
Find out total number of pages, when page size 4KB and address space 32 bit.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is NAT? Explain with topological diagram.
Model answer
NAT (Network Address Translation) is a function of a router or firewall that rewrites the IP address (and, in PAT, the port number) in packet headers as they pass between a private network and a public network. It lets many hosts using private IPv4 addresses (RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), which are not routed on the Internet, communicate through one or a few public IP addresses.
Topological diagram
graph LR
subgraph LAN["Private network 192.168.0.0/24"]
PC1["PC-1 192.168.0.2"]
PC2["PC-2 192.168.0.3"]
end
PC1 --> R["NAT router: inside 192.168.0.1, outside 203.0.113.5"]
PC2 --> R
R -- "Public IP 203.0.113.5" --> ISP["ISP network"]
ISP --> NET(("Internet"))
NET --> WS["Web server 198.51.100.10"]
How NAT works (PAT example)
- PC-1 sends a packet: source 192.168.0.2:50001 → destination 198.51.100.10:443.
- The NAT router replaces the source with its public address and a port, 203.0.113.5:50001, and stores the mapping in its NAT table.
- The web server replies to 203.0.113.5:50001.
- The router looks up the table, changes the destination back to 192.168.0.2:50001 and delivers the reply to PC-1.
| Inside local (private) | Inside global (public) | Outside (destination) |
|---|---|---|
| 192.168.0.2:50001 | 203.0.113.5:50001 | 198.51.100.10:443 |
| 192.168.0.3:50001 | 203.0.113.5:50002 | 198.51.100.10:443 |
When two hosts choose the same source port, the router assigns a different public port (50002) to keep the mappings unique.
Types of NAT
| Type | Mapping | Use |
|---|---|---|
| Static NAT | One private ↔ one public, fixed | Servers that must be reachable from outside |
| Dynamic NAT | Private addresses take a free address from a pool of public IPs | Organisations owning several public IPs |
| PAT (NAT overload) | Many private → one public IP, distinguished by port number | Home and office routers (most common) |
| Port forwarding | Public IP:port → a fixed inside host:port | Hosting a server behind PAT |
Advantages: saves scarce public IPv4 addresses; hides the internal addressing; lets the same private ranges be reused in every organisation; allows changing ISP without renumbering the LAN.
Disadvantages: breaks end-to-end connectivity (inbound connections need static NAT or port forwarding); adds processing delay; causes problems for some protocols (IPsec AH, SIP, FTP active mode) and makes tracing harder. IPv6's huge address space removes the need for NAT.
Exam tip: draw private hosts → NAT router (inside/outside addresses) → Internet, and show one row of the NAT table; name PAT as the type used in home routers.
Given item- 40, 45, 80, 90, 50, 70. Draw Heap and Binary search tree (BST).
Find the output from this code-
#include <stdio.h>
void PrintArray(int num[], int n){
int i;
for(i=0;i<n;i++)
{
printf("%d", num[i]);
}
printf("\n");
}
void FunctionArray(int num[], int n) {
int i, j, key;
for (i=1;i<n;i++)
{
key=num[i];
j--;
while(j>=0 && j<=n){
num[j] = num[j+1];
key=num[j];
}
num[i-1]=key;
PrintArray(num,n);
}
}
int main(){
int num[]={11,2,3,4,5};
PrintArray(num,5);
FunctionArray(num,5);
return 0;
}
Write a liner algorithm two sorted item merge. Why this algorithm takes O(n) time complexity?
Find a recurrence relation and give initial conditions for the number of bit strings of length n that do not have two consecutive 0s.
Sign up free to see the model answers to written questions 4–7 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
5 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ৫টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 7 syllabus chapters; IP Addressing & Subnetting, Language Basics & Syntax and Attacks & Threats lead, with 1 each. IP Addressing & Subnetting is asked in 133 other papers too (2012–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- IP Addressing & Subnetting Networking · 133 other papers, 2012–20261
- Language Basics & Syntax Programming · 122 other papers, 2015–20261
- Attacks & Threats Cyber Security · 81 other papers, 2012–20261
- Sorting Algorithms · 59 other papers, 2013–20261
- Trees Data Structures · 47 other papers, 2015–20261
- Memory Management Operating Systems · 40 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 SGFL Assistant Engineer (IT) exam (2023)?
- 7 written questions.
- Which subjects were asked most in the SGFL Assistant Engineer (IT) exam (2023)?
- Algorithms (1), Cyber Security (1) and Data Structures (1), out of 7 questions.
- When was the SGFL Assistant Engineer (IT) exam held?
- In 2023, conducted by BUET. The exact day isn't in our records.
- Where can I find the SGFL Assistant Engineer (IT) exam (2023) question solution?
- On this page: 2 of the 7 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