JGTDSL Assistant Engineer (CSE) Exam: 08.10.2021প্রশ্ন ও সমাধান
- Set by
- JGTDSL
- Post
- Assistant Engineer
- Exam date
- 8 Oct 2021
- Questions
- 10 (0 MCQ, 10 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
- Software Engineering · সফটওয়্যার ইঞ্জিনিয়ারিং 2
- Algorithms · অ্যালগরিদম 1
- Cloud & Emerging Tech · ক্লাউড ও উদীয়মান প্রযুক্তি 1
- Cyber Security · সাইবার নিরাপত্তা 1
- Database · ডেটাবেজ 1
- Digital Logic · ডিজিটাল লজিক 1
- Microprocessor · মাইক্রোপ্রসেসর 1
- Networking · নেটওয়ার্কিং 1
- Programming · প্রোগ্রামিং 1
Why we optimize algorithm when it runs in compile time?
Model answer
Why Code/Algorithm Optimization Happens at Compile Time
Compile-time (code) optimization is a phase of the compiler that transforms intermediate code into a functionally equivalent but more efficient form, without changing the program's output - done before execution so the cost is paid once (at compile time) rather than repeatedly (every run).
Why it is necessary
- Speed: eliminates redundant computation (e.g., constant folding, common sub-expression elimination) so the generated machine code runs faster.
- Space: removes unreachable/dead code and unused variables, producing a smaller executable.
- Resource efficiency: better register allocation and loop optimization (loop-invariant code motion, strength reduction) reduce memory access and CPU cycles at run time.
- No repeated runtime overhead: since the analysis happens once at compile time, none of this analysis cost is paid again every time the program executes, unlike a runtime/JIT optimizer that must re-analyze on the fly.
Common optimization techniques
| Technique | Effect |
|---|---|
| Constant folding | x = 2*3 becomes x = 6, computed at compile time |
| Dead code elimination | Removes code whose result is never used |
| Loop-invariant code motion | Moves computations that do not change across iterations outside the loop |
| Common sub-expression elimination | Computes a repeated expression once and reuses the result |
Exam takeaway: compile-time optimization trades a slightly longer compilation step for a program that is smaller, faster, and cheaper to run every single time it executes - a one-time cost for a repeated benefit.
How CFG to represent a palindrome number?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Write LSTM gates name in AI.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Simplify ĀBC̄ + ABC + ABC̄ using K-map.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Write two symmetric key algorithm name.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Given a totology of distance vector routing. Find the table of each node for the 1st route..
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Describe ACID properties of DBMS.
Model answer
ACID Properties of a DBMS
ACID is the set of four guarantees a database transaction must satisfy to ensure reliable processing:
- Atomicity: a transaction is treated as a single indivisible unit - either all of its operations succeed and are committed, or none are (a failure triggers a full rollback). Example: in a bank transfer, both the debit from account A and the credit to account B must happen together, or neither happens.
- Consistency: a transaction takes the database from one valid state to another, preserving all defined rules, constraints, and triggers (e.g., total balance across accounts stays unchanged after a transfer).
- Isolation: concurrently executing transactions must not interfere with each other - the result must be the same as if the transactions ran one after another (serially), typically enforced via locking or MVCC.
- Durability: once a transaction is committed, its changes are permanent and survive any subsequent system crash or power failure (persisted to non-volatile storage, often via a write-ahead log).
graph LR
A[Atomicity - all or nothing] --> T((Transaction))
C[Consistency - valid state to valid state] --> T
I[Isolation - concurrent transactions do not interfere] --> T
D[Durability - committed changes survive crashes] --> T
Exam takeaway: ACID is what distinguishes a reliable transactional DBMS (MySQL/InnoDB, PostgreSQL, Oracle) from a system with weaker guarantees - many NoSQL stores trade strict ACID for the BASE model (Basically Available, Soft state, Eventual consistency) to gain higher availability and scalability.
What is reverse engineering and forward engineering?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Which signal a sensor could to send the signal to microcontroller if the sensor finds any gas leakage point?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Find out program output of f(arr,2), f(arr,3), f(arr,5), f(arr,8). arr[] = [0,1,1,0,1,1,0,1], (like as ….)
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Question text is from the public recruitment exam; answers and explanations are written by ARBS Academy. All past papers · Government IT officer posts guide