Uncategorized

SPSC Lecturer Computer Science (BPS-17) Interview Questions

The Sindh Public Service Commission asked the following questions during interviews for the position of Lecturer Computer Science (BPS-17) in the College Education Department of the Government of Sindh:

1- Difference between Object and Class

The difference between an object and a class in object-oriented programming (OOP) can be understood as follows:

Class

    • A class is a blueprint or template that defines the properties (attributes) and behaviors (methods) that objects created from the class will have.
    • It does not occupy any memory space until an object is created from it.
    • It encapsulates data for the object and methods to manipulate that data.
    • Example: A Car class might have attributes like color, make, and model, and methods like drive() and brake().

Object

    • An object is an instance of a class. It is a concrete entity that occupies memory and has state and behavior defined by its class.
    • Multiple objects can be created from the same class, each with its own unique state.
    • Example: myCar = Car() creates an object myCar of the class Car. This specific car might have the color red, be a Tesla, and be a Model S.

In summary, a class defines the structure and behavior of objects, while an object is an individual instance of a class with specific values for its attributes.

2- What is the difference between Cache and Register? Who is the fastest?

The difference between cache and register, along with their speed comparison, can be understood as follows:

Cache

    • Location: Located between the main memory (RAM) and the CPU.
    • Purpose: Stores copies of frequently accessed data from main memory to reduce the time it takes for the CPU to access this data.
    • Size: Typically much larger than registers but smaller than main memory.
    • Speed: Faster than main memory but slower than registers.
    • Levels: Usually has multiple levels (L1, L2, L3) with L1 being the smallest and fastest and L3 being the largest and slowest.
    • Usage: Used to store data and instructions that are frequently accessed, thereby improving the overall performance of the system.

Register

    • Location: Located within the CPU.
    • Purpose: Stores data and instructions that the CPU is currently processing.
    • Size: Very small in size (typically a few bytes).
    • Speed: The fastest type of memory in a computer system.
    • Types: Includes different types such as data registers, address registers, and special-purpose registers (e.g., instruction register, accumulator).
    • Usage: Used for immediate data manipulation and processing within the CPU.

Who is Fastest?

    • Registers are the fastest type of memory, as they are directly accessible by the CPU and are designed to operate at the speed of the CPU clock. Cache memory, while very fast, is slightly slower than registers.

3- Difference between Inheritance and Polymorphism in OOP

The difference between inheritance and polymorphism in object-oriented programming (OOP) can be summarized as follows:

Inheritance

    • Definition: Inheritance is a mechanism where a new class (called the subclass or derived class) is created from an existing class (called the superclass or base class). The new class inherits attributes and methods from the existing class.
    • Purpose: It allows for code reuse and the creation of a hierarchical relationship between classes.
    • Example: If you have a Vehicle class with properties like speed and methods like move(), you can create a Car class that inherits from Vehicle and adds additional properties and methods specific to cars.
    • Usage: Commonly used to implement the “is-a” relationship. For instance, a Car is a Vehicle.

Polymorphism

    • Definition: Polymorphism allows objects of different classes to be treated as objects of a common superclass. It enables a single interface to represent different underlying forms (data types).
    • Purpose: It allows for flexibility and the ability to define one interface and have multiple implementations.
    • Types:
      • Compile-time (or static) polymorphism: Achieved through method overloading (same method name with different parameters) and operator overloading.
      • Runtime (or dynamic) polymorphism: Achieved through method overriding (a subclass provides a specific implementation of a method that is already defined in its superclass).
    • Example: If you have a Shape class with a method draw(), you can have subclasses like Circle, Square, and Triangle each implementing the draw() method differently. At runtime, you can call draw() on an object of type Shape, and the appropriate subclass method will be executed.
    • Usage: Enables the “many forms” behavior. For example, you can write a function that operates on objects of type Shape without needing to know the exact subclass.

In summary, inheritance establishes a hierarchical relationship between classes and facilitates code reuse, while polymorphism allows for one interface to be used for a general class of actions, promoting flexibility and integration.

SPSC Lecturer Computer Science (BPS-17) Interview Questions Read More »

IBA STS BPS 5 to 15 Past Papers MCQs Dated 20.01.2023

Part – I (English)

Passage for reading comprehension

Read the following passage and answer the question set below it.

The textbooks equip our new generation with knowledge, skill and ability to face the challenges of new millennium in the fields of Science, Technology and Humanities. The textbooks are also aimed at inculcating the ingredients of universal brotherhood and to reflect the valiant deeds of our forebears and portray the illuminating patterns of our rich cultural heritage and tradition.

To accomplish this noble task, a team of educationalists, experts, working teachers and committee of friends have been constituted which incessantly endeavor to develop, test and improve content and design of the textbooks on the basis of the feedback, The present intellectual product has been presented with joint efforts of the team to project the aforementioned assignment in its true perspective.

It is expected that the discerning parents, learned teachers and concerned citizens will go through it and offer their valuable opinions to the Board for bringing about improvement in the next edition.

Answer the following first ten (01-10) questions from the above passage you have just read.

1. How many subjects or disciplines of education and learning are mentioned in the first paragraph?
A. two
B. three
C. four
D. five

B. three

2. What is meaning of the underlined word millennium?
A. a period of 1000 years
B. a period of 10000 years
C. a period of ten decades
D. a period of 50 years

A. a period of 1000 years

3. Which one the following in options is the purpose or object of the author for writing this passage?
A. suggestive
B. instructive
C. informative
D. Descriptive

C. informative

4. Other word (synonym) of forbears is __________
A. ancestors
B.  assistors
C. olders
D. olderly relatives

A. ancestors

5. Textbook is ________
A. a book containing lessons
B. a book containing long stories, parables and episodes
C. a book on English classes presented for higher classes
D. a book that teaches a particular subject and that is used especially in schools and colleges.

D. a book that teaches a particular subject and that is used especially in schools and colleges.

6. The underlined word “accomplish” means ___________
A. get
B. achieve
C. obtain
D. receive

B. achieve

7. The underlined word “incessantly” means ________
A. rapidly
B. continually
C. constantly
D. instantly

B. continually

8. The underlined words “It is expected” form a simple sentence. From grammar point of view, it is in ______
A. active voice
B. passive voice
C. informal english
D. idiomatic language

B. passive voice

9. How many sorts of persons are mentioned in the passage? (one kind of persons is mentioned twice)
A. four
B. five
C. six
D. seven

C. six

10. The most important word in the passage is __________
A. knowledge
B. accomplish
C. intellectual
D. textbooks

D. textbooks

IBA STS BPS 5 to 15 Past Papers MCQs Dated 20.01.2023 Read More »

IBA STS BPS 5 to 15 Past Papers MCQs Dated 19.01.2023

Part – I (English)

Passage for reading comprehension

Read the following passage and answer the question set below it.

Allah has created tens of millions of humanity. Of them, scores take birth with passion of selfless service to humanity. They are born to great mothers who bring up, groom and teach them good morals. Such altruists are pride of their families, communities and nations. They live for others. They serve human beings above self regardless of latter’s colour, caste, creed, nationality and geographically remote areas. Such noble people exist on the earth for a sojourn but they leave behind indelible impression on minds of their compatriots. They are no longer with us yet sweet memories and warmth of their altruism, their empathy for their people’s sincere fellow feelings keep us reminding of their nobility, humility and selflessness. Our hearts are such people’s abodes and our minds havens of memories of their noble deeds and great achievements, as long as we survive. Most of such great souls are no more with us yet echoes of their talks, heartfelt words, words of sympathy and deeds of generosity resound in our minds forever.

Answer the following first ten (01-10) questions from the above passage you have just read.

IBA STS BPS 5 to 15 Past Papers MCQs Dated 19.01.2023 Read More »

Solved Past Papers of Airport Security Force (ASF)

An autopsy is connected with:
A. Post-mortem
B. Cancer
C. Study of living cells
D. None of these

The world celebrated the 200th birthday in 2009 of which scientist?
A. Charles Darwin
B. Roger Bacon
C. Issac Newton
D. Alexander Fleming

ECO (Economic Cooperation Organization) secretariat is located in:
A. Tabrez
B. Istanbul
C. Tehran
D. Ashgabat

‘Agerpres’ is the news agency of
A. South Africa
B. Romania
C. Argentina
D. Georgia

Gwadar Port is being constructed in the Province of
A. KPK
B. Punjab
C. Sindh
D. Balochistan

Which film won 8 Oscar awards in 2009?
A. Slumdog Millionaire
B. Traffic
C. Crash
D. Harry Porter and Half Prince

The ancient city of Byzantium is today known as:
A. Ankara
B. Istanbul
C. Izmir
D. Antalya

Allama Inyatallah Mashriqi was the founder of
A. MAO College Lahore
B. Anjuman Hiimayat-e-Islam
C. Arafat Magzine
D. Khaksar Movement

Montague-Chelmsford Reforms were announced in
A. 1906
B. 1919
C. 1921
D. 1930

Who leads the Shimla Deputation during a meeting with Governor-General Lord Minto in 1906?
A. Sir Agha Khan
B. Nawab Mohsin-ul-Mulk
C. Nawab Salim-Ullah-Khan
D. Muhammad Ali Jinnah

Reader’s Digest magazine was first published in
A. 1898
B. 1900
C. 1920
D. 1922

Pakistan has how many seasons?
A. Two seasons
B. Four seasons
C. Five seasons
D. Eight seasons

Rome, the capital of Italy is located beside the river:
A. Danube
B. Tiber
C. Rhine
D. Po

Chinese currency is known as:
A. Yuan
B. Yen
C. Dong
D. Ringgit

Kamran’s Bara-Dari in Lahore named after
A. Baur’s father
B. Hamayun’s brother
C. Sher Shah Suri’s father
D. Akbar’s Uncle

Saudi Billionaire Osama bin Laden made his money through which business?
A. Weapons trading
B. Construction
C. Petroleum trading
D. Drug trafficking

At the time of Bengal’s Partition (1905), who was the Governor-General of India?
A. Lord Mayo
B. Lord Curzon
C. Lord Clive
D. Lord Wavell

Who is considered to be the Chief Architect of the 1956 Constitution?
A. Ghulam Muhammad
B. Sikandar Mirza
C. Muhammad Ali Bogra
D. Ch. Muhammad Ali

The country that does not keep any standing armies is:
A. Switzerland
B. Philippines
C. Canada
D. None of these

The Parliament of Kuwait is known as
A. Majlis-al-Nawab
B. Majlis Shoora
C. Majlis-i-Umma
D. Majlis-ul-Umma

The old name of Sri Lanka is:
A. Ceylon
B. Lacca deep
C. Ravan
D. Maldives

A pre-emptive attack is an:
A. attack with chemical weapons
B. attack before the enemy’s attack
C. attack with conventional weapons
D. diplomatic pressure on the rival country

Paktiya, on Pakistan’s border, is a province of:
A. Iran
B. Afghanistan
C. Tajikistan
D. None of these

Astana is the old name of
A. Azerbaijan
B. Tajikistan
C. Kyrgyzstan
D. Kazakhstan

An active flood plain is also known as bet or
A. Meander land
B. Khaddar land
C. Riverine land
D. None of these

Which country is the largest trading partner of Pakistan?
A. UK
B. USA
C. China
D. UAE

Agartala city was made famous by a 1968 conspiracy case located in
A. China
B. Nepal
C. India
D. Bhutan

Burgeon glacier is located in
A. China
B. Nepal
C. India
D. Chile

‘Hamayun Nama’ was written by
A. Altaf Gauhar
B. Noor Jehan
C. Emperor Akbar
D. Gulbaden Begum

What is the length of the shortest river in the world ‘Roe River’?
A. 61 meters
B. 65 meters
C. 69 meters
D. 71 meters

Which of the following gases mainly causing global warming?
A. Nitrogen
B. Methane
C. Carbon Dioxide
D. Hydrogen

The highest of Koh-e-Sulaiman range is
A. Tirich Mir
B. K-2
C. Takhat-e-Sulaiman
D. Sakar

Schwab Klaus was the founder of
A. Red Cross
B. Amnesty International
C. World Economic Forum
D. Human Rights Watch

The major part of the lower Indus plain is
A. Sindh plain
B. Sindh Doaab
C. Thar Desert
D. None of these

The world longest street is
A. Yonge street
B. Wall street
C. Fleet street
D. Lombard street

DeWitt Wallace was the founder of the magazine
A. Time
B. Forbes
C. Newsweek
D. Reader’s Digest

Which of the following Rivers do not flow in Africa?
A. Nile
B. Congo
C. Zamberi
D. Tigris

Canterbury Tales was written by
A. Ernest Hemingway
B. Geoffrey Chaucer
C. Harold Robbins
D. Jane Austin

Solved Past Papers of Airport Security Force (ASF) Read More »

error: Content is protected !!
Scroll to Top