Security Printing Corporation Assistant Programmer Exam 2022 — Question Solution | সিকিউরিটি প্রিন্টিং কর্পোরেশন সহকারী প্রোগ্রামার নিয়োগ পরীক্ষা ২০২২ — প্রশ্ন সমাধান
- Security Printing Corporation
- Assistant Programmer
- 2022
- 12 questions · 0 MCQ, 12 written
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The Security Printing Corporation Assistant Programmer exam was held in 2022. The paper had 12 written questions. The subjects asked most were Programming (5), Cyber Security (3) and Operating Systems (2). This page lists every question, with 1 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
- Security Printing Corporation
- Post
- Assistant Programmer
- Exam date
- 2022
- Questions
- 12 (0 MCQ, 12 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
What is Blacklist and Whitelist? Write down the difference between Black list and White list.
What is difference between exception and error in Java?
Sign up free to see the model answers to written questions 1–2 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What is exception handling? Write with an example.
Model answer
Definition: Exception handling is the mechanism by which a program detects an abnormal event at run time (an exception — e.g. division by zero, text that is not a number, a missing file), transfers control to code written to deal with it, and then continues or ends cleanly instead of terminating abruptly. In Java an exception is an object of a subclass of Throwable; it is thrown where the problem occurs and caught by a matching handler.
Java's five keywords
| Keyword | Role |
|---|---|
try |
Encloses the statements that may throw an exception |
catch |
Handles one exception type; several catch blocks may follow one try |
finally |
Runs always — whether or not an exception occurred — used for cleanup (closing files, connections) |
throw |
Raises an exception object explicitly: throw new OverbookedException(...) |
throws |
In a method header, declares the checked exceptions the method may pass to its caller |
Flow of control
flowchart TD
A["try block runs"] --> B{"Exception thrown?"}
B -- "No" --> F["finally block"]
B -- "Yes" --> C{"Matching catch?"}
C -- "Yes" --> D["catch block handles it"]
D --> F
C -- "No" --> X["finally block, then exception goes to the caller"]
F --> G["Statement after the try statement"]
Example (Java):
class OverbookedException extends Exception { // custom checked exception
OverbookedException(String msg) { super(msg); }
}
public class TicketBooking {
static int seatsLeft(int capacity, int booked) throws OverbookedException {
if (booked > capacity)
throw new OverbookedException(booked + " booked, only " + capacity + " seats");
return capacity - booked;
}
public static void main(String[] args) {
String[] requests = {"40", "4o", "55"};
for (String r : requests) {
try {
int booked = Integer.parseInt(r); // may throw NumberFormatException
System.out.println("Seats left: " + seatsLeft(50, booked));
} catch (NumberFormatException e) {
System.out.println("Not a number: " + r);
} catch (OverbookedException e) {
System.out.println("Rejected: " + e.getMessage());
} finally {
System.out.println("Checked request " + r);
}
}
System.out.println("Program ends normally");
}
}
Output:
Seats left: 10
Checked request 40
Not a number: 4o
Checked request 4o
Rejected: 55 booked, only 50 seats
Checked request 55
Program ends normally
How it works
- "40": no exception, so the try block completes and
finallystill runs. - "4o":
Integer.parseIntthrowsNumberFormatException(unchecked); the rest of the try block is skipped and the first catch handles it. - "55":
seatsLeftusesthrowto raise the custom checked exceptionOverbookedException; because it is checked, the method must declare it withthrows, and the caller must catch it. - Catch order matters: a subclass must be caught before its superclass — putting
catch (Exception e)first makes the later catch unreachable and the code does not compile. - The program never crashes; all three requests are processed.
Other languages use the same idea: C++ has try/throw/catch, Python has try/except/else/finally.
Exam tip: Name all five keywords, give one runnable try-catch-finally example with its output, and state that finally runs in both the normal and the exceptional path.
What is SQL injection? How to prevent it?
What is Cross-Site Scripting (XSS) and how can it be fixed?
Write short note on Virtual Memory and Cache memory.
Describe Dynamic memory allocation in programming in C?
Difference between Data and Information.
Difference between High level languages and low level language with some example?
Difference between LIFO and FIFO in data structure.
What is kernel? Write down the objectives of kernel.
What is nested structure in C programming? Explain with example.
Sign up free to see the model answers to written questions 4–12 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Explanations © ARBS Academy
Keep going with a free account · ফ্রি অ্যাকাউন্টে যা যা করতে পারবেন
11 more answers from this paper open with a free account.
এই প্রশ্নপত্রের আরও ১১টি উত্তর, ধাপে ধাপে ব্যাখ্যাসহ, ফ্রি অ্যাকাউন্টে খুলবে।
Free account · 1 day of Premium free
Paper analysis · প্রশ্নপত্র বিশ্লেষণ
Its questions come from 9 syllabus chapters; Language Basics & Syntax, Attacks & Threats and Output & Debugging lead, with 2 each. Language Basics & Syntax is asked in 122 other papers too (2015–2026).
Its biggest topics · প্রধান টপিক
Questions in this paper, and how many of our other papers ask the topic
- Language Basics & Syntax Programming · 122 other papers, 2015–20262
- Attacks & Threats Cyber Security · 81 other papers, 2012–20262
- Output & Debugging Programming · 7 other papers, 2018–20262
- OS Basics & Types Operating Systems · 45 other papers, 2016–20261
- Pointers, Arrays & Strings Programming · 44 other papers, 2016–20261
- Network & Application Security Cyber Security · 43 other papers, 2012–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 Security Printing Corporation Assistant Programmer exam (2022)?
- 12 written questions.
- Which subjects were asked most in the Security Printing Corporation Assistant Programmer exam (2022)?
- Programming (5), Cyber Security (3) and Operating Systems (2), out of 12 questions.
- When was the Security Printing Corporation Assistant Programmer exam held?
- In 2022. The exact day isn't in our records.
- Where can I find the Security Printing Corporation Assistant Programmer exam (2022) question solution?
- On this page: 1 of the 12 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