Computer Science/IT MCQs
Topic Notes: Computer Science/IT
MCQs and preparation resources for competitive exams, covering important concepts, past papers, and detailed explanations.
Plato
- Biography: Ancient Greek philosopher (427–347 BCE), student of Socrates and teacher of Aristotle, founder of the Academy in Athens.
- Important Ideas:
- Theory of Forms
- Philosopher-King
- Ideal State
1
Which of the following does the file extension ".pdf" represent?
Answer:
Portable Document Format
The ".pdf" file extension stands for Portable Document Format. Developed by Adobe, PDF is a widely used file format for presenting documents in a manner independent of application software, hardware, and operating systems. This means that a PDF file will typically look the same regardless of what device or program is used to open it, preserving the original fonts, images, and layout. This portability makes it ideal for sharing and archiving documents.
2
Which of the following best describes a 'file path' within a computer's file system?
Answer:
The hierarchical address that uniquely identifies the location of a file or directory.
A file path is a string of characters that unequivocally specifies the location of a file or directory within the hierarchical structure of a file system. It typically starts from the root directory or a specific reference point (like the current working directory) and lists the sequence of directories (folders) that must be traversed to reach the target file or directory. Option A is incorrect as a file path is a permanent address, not a temporary link. Option C is incorrect because the file name is only one component of the full path. Option D describes metadata associated with a file, not its location path.
3
In command-line interfaces, which directory does the '..' symbol typically signify?
Answer:
The directory that contains the current directory.
In command-line environments (like Bash, CMD, PowerShell), the '..' (double-dot) notation is a universally recognized shorthand. It represents the *parent directory*, meaning the directory immediately above the current working directory in the file system hierarchy. For example, if you are in `/home/user/documents` and type `cd ..`, you will move to `/home/user`. This is distinct from: * The root directory ('/'): The absolute base of the file system. * The current directory ('.'): The directory you are currently in. * The user's home directory ('~' or '$HOME'): The default starting directory for a user.
4
When adhering to best practices for file naming conventions, which of the following actions should generally be avoided?
Answer:
Incorporating symbols such as asterisks (*), forward slashes (/), or backslashes (\) into the file name.
Option B describes a poor practice. Special characters like `*`, `/`, and `\` are often reserved by operating systems or file systems for specific functions (e.g., wildcards, path separators). Using them in file names can lead to errors, prevent files from being accessed, cause compatibility issues across different operating systems, or lead to unexpected behavior in scripts or applications. Good file naming practices prioritize clarity, consistency, and compatibility, which means avoiding such problematic characters. Options A, C, and D are all examples of good practices that enhance file organization, readability, and system compatibility.
5
Which of the following actions is primarily enabled by performing a 'read' operation on a computer file?
Answer:
Accessing and viewing the information stored within the file.
The 'read' operation in computer file systems is specifically designed to retrieve data from a file without altering its contents. This allows users or programs to access, view, display, or load the information stored within the file into memory for processing. Options A, C, and D describe 'write' or 'modify' operations, 'rename' or 'move' operations, and 'delete' operations, respectively, which are distinct from a 'read' operation.
6
Imagine you have a file named 'document.txt' containing plain text. If you rename this file to 'document.jpg' by simply changing its extension, what is the most likely outcome when you attempt to open it?
Answer:
The file's underlying data will remain as plain text, but the operating system will attempt to open it using an image viewing application.
Changing a file's extension, such as from '.txt' to '.jpg', alters only the metadata that the operating system uses to identify the file's type. It does not modify the actual binary data or content stored within the file. Therefore, if the file originally contained plain text, it will still contain plain text. However, because the extension now suggests it's a JPEG image, the operating system will by default try to open it with an image viewer. Since the file's content is not a valid JPEG format, the image viewer will likely display an error message, indicating that the file is corrupted or cannot be opened, rather than converting the text into an image or corrupting the file itself through the renaming process.
7
When performing a file operation (e.g., copying, moving, deleting) within a graphical user interface, which method is commonly used to efficiently select more than one file simultaneously?
Answer:
Utilizing a modifier key (such as Ctrl or Shift) in conjunction with mouse clicks to select multiple files.
In graphical user interfaces (GUIs), such as Windows Explorer, macOS Finder, or various Linux file managers, modifier keys are standard for multi-selection. Holding down the 'Ctrl' key (or 'Cmd' on Mac) while clicking allows you to select non-contiguous files. Holding down the 'Shift' key while clicking allows you to select a contiguous block of files between your first and last click. These methods significantly improve efficiency compared to selecting files individually. Double-clicking typically opens a file, right-clicking opens a context menu, and 'dragging to the top of the screen' is not a standard multi-selection technique.
8
In a hierarchical file system, what is the term for a directory that is contained within another directory?
Answer:
Subdirectory
In a hierarchical file system, directories (often called folders in graphical user interfaces) can contain other directories. A directory that is located inside another directory is known as a 'subdirectory' (or 'subfolder'). The directory that contains it is referred to as the 'parent directory'. 'Sibling directories' are at the same level within the same parent directory, and the 'root directory' is the top-most directory in the file system hierarchy from which all other directories branch.
9
Given the file path `/users/jane/documents/project1/draft.txt`, identify the directory that directly contains the file `draft.txt`.
Answer:
`project1`
In a file system path, the immediate parent directory of a file or subdirectory is the directory name that precedes it directly. In the path `/users/jane/documents/project1/draft.txt`, `draft.txt` is the file. Looking to its left, the directory immediately before it is `project1`. Therefore, `project1` is the immediate parent directory of `draft.txt`. The other options are higher-level directories in the path, but not the direct parent.
10
Which file system operation is specifically designed to establish a new, empty file at a designated path within the file system hierarchy?
Answer:
Generating a brand-new, unpopulated file.
The 'create' operation (often implemented by functions like `create()` or `open()` with specific flags in programming languages, or through 'New File' options in graphical user interfaces) is the primary method for initializing a file. Its distinct purpose is to allocate space on the storage device and register a new file entry in the file system's directory structure, resulting in an empty file ready to receive data. While 'Open' can sometimes create a file if it doesn't exist (e.g., `open('filename', 'w')` in Python), its primary intent is accessing existing files. 'Save' writes content to a file, which could be an existing one or a newly created one, but it's not the initial creation act itself. 'Copy' duplicates an existing file, which implies the source file already exists.