Computer Knowledge

Operating Systems

1,344 Questions

Test your computer knowledge with these questions on operating systems. The content covers various platforms including Unix, Linux, Windows, Android, and Macintosh. These questions are commonly asked in the computer knowledge sections of banking and government exams.

Unix emulatorsLinux distributionsAndroid software stackMacintosh operating systemsWindows OS versionsSymbian OS history

Operating Systems Questions

Multiple choice
  1. Environment.getExternalStoragePath()

  2. Environment.getExternalStorageState()

  3. Environment.getExternalStorageDirectory()

  4. None of above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Environment.getExternalStorageDirectory() returns the File object representing the primary external storage directory. getExternalStorageState() returns storage state (mounted/shared/etc), and getExternalStoragePath() is not a standard Android API.

Multiple choice
  1. WRITE_EXTERNAL_STORAGE

  2. READ_EXTERNAL_STORAGE

  3. Both Op1 and Op2

  4. As per requirement, any of Op1 or Op2

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Pre-API 19, WRITE_EXTERNAL_STORAGE alone allowed both read and write. From API 19+, reading doesn't need permission. From API 23+, write permission requires runtime request. The correct answer depends on API level and use case - you may need either one or both depending on operation and Android version.

Multiple choice
  1. Yes

  2. No

  3. Don’t know

  4. Not applicable

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Android's security model prevents apps from changing network type (2G/3G/4G) programmatically without root access. The MODIFY_PHONE_STATE permission is only available to system apps or rooted devices. This restriction protects users from apps forcing them onto slower networks or bypassing user preferences.

Multiple choice
  1. ContentProvider

  2. ContentResolver

  3. AccessProvider

  4. None of above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

ContentResolver is the client-side class that applications use to communicate with Content Providers. You call getContentResolver() to get an instance, then use its query(), insert(), update(), and delete() methods. ContentProvider is the server-side class you implement to expose data.

Multiple choice
  1. onCreate(), onStart(), onResume(), onPause(), onStop().

  2. onCreate(), onStart(), onResume(), onStop(), onDestroy().

  3. onCreate(), onResume(), onPause(), onStop(), nDestroy().

  4. onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy().

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

There are six functions are used in Activity Life Cycle of Android:

onCreate()
onStart()
onResume()
onPause()
onStop() onDestroy().

Multiple choice
  1. This allows us to send message to be processed immediately only.

  2. This allows us to send messages can be processed at some time in the future only.

  3. This allows us to send messages which can be processed immediately or scheduled for processing at some time in the future.

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

A handler class allows you to send messages which are to be processed by the handler at some other time or immediately.

Multiple choice
  1. StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
    .detectAll()
    .penaltyLog()
    .penaltyDialog()
    .build());
    
  2. StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
    .detectAll()
    .penaltyLog()
    .penaltyDeath()
    .build());
    
  3. StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
    .detectAll()
    .penaltyLog()
    .penaltyDialog()
    );
    
  4. StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
    .detectAll()
    .penaltyDialog()
    .build());
    
Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Simple StrictMode declaration that detects all types of network and disk I/O:

StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
 .detectAll()
 .penaltyLog()
 .penaltyDialog().build());