[Jun-2026] Foundations-of-Computer-Science Braindumps - Foundations-of-Computer-Science Questions to Get Better Grades [Q29-Q53]

Share

[Jun-2026] Foundations-of-Computer-Science Braindumps – Foundations-of-Computer-Science Questions to Get Better Grades

Foundations-of-Computer-Science Exam Dumps - Try Best Foundations-of-Computer-Science Exam Questions - TroytecDumps

NEW QUESTION # 29
Which order is impossible when traversing a binary tree using depth first search?

  • A. Level-order traversal
  • B. Post-order traversal
  • C. In-order traversal
  • D. Pre-order traversal

Answer: A

Explanation:
Depth-first search (DFS) explores a tree by going as deep as possible along a branch before backtracking. In binary trees, DFS gives rise to the classic traversal orderspre-order,in-order, andpost-order, each defined by when you "visit" the node relative to its left and right subtrees. Pre-order visits the node first, then left subtree, then right subtree. In-order visits left subtree, then the node, then right subtree. Post-order visits left subtree, then right subtree, then the node. These are all DFS-based because they fully explore subtrees before moving sideways to another branch.
Level-order traversalis different: it visits nodes layer by layer from the root outward (all nodes at depth 0, then depth 1, then depth 2, etc.). This is a hallmark ofbreadth-first search (BFS), not DFS. Textbooks emphasize this distinction because DFS and BFS have different properties: BFS naturally finds shortest paths in unweighted graphs and produces level-order traversal in trees, while DFS is useful for tasks like topological sorting, cycle detection, and exploring structure recursively.
Therefore, the traversal order that is impossible to produce as a depth-first traversal of a binary tree is level-order traversal. The DFS orders (pre-, in-, post-) are all achievable by depth-first strategies, typically implemented recursively or with an explicit stack.


NEW QUESTION # 30
Which file system is commonly used in Windows and supports file permissions?

  • A. HFS+
  • B. FAT32
  • C. NTFS
  • D. EXT4

Answer: C

Explanation:
Windows commonly uses the NTFS (New Technology File System) for internal drives and many external drives because it supports advanced features required for modern operating systems. One of the most important features is support forfile and folder permissionsvia Access Control Lists (ACLs). Permissions enable the OS to enforce security policies by controlling which users and groups can read, write, execute, modify, or delete specific resources. This is fundamental to multi-user security and is a standard topic in operating systems and security textbooks.
FAT32 is an older file system designed for simplicity and broad compatibility. It does not provide the same fine-grained permission model as NTFS, which is why it is often used for removable media where cross- platform compatibility matters more than access control. HFS+ is historically associated with Apple's macOS systems, and EXT4 is widely used on Linux. While these file systems have their own permission and feature models, they are not the common Windows default for permission-managed storage in typical Windows deployments.
NTFS also supports journaling (improving reliability after crashes), large file sizes, quotas, compression, and encryption features (through Windows facilities). In enterprise environments, NTFS permissions integrate with Windows authentication and directory services, enabling centralized user management. Therefore, for Windows systems requiring file permissions, NTFS is the correct answer.


NEW QUESTION # 31
What is another term for the inputs into a function?

  • A. Arguments
  • B. Variables
  • C. Outputs
  • D. Procedures

Answer: A

Explanation:
In programming, a function takes inputs, performs computation, and may return an output. The standard term for a function's inputs isarguments(also commonly discussed alongside the closely related termparameters).
Textbooks typically distinguish the two:parametersare the names listed in the function definition, while argumentsare the actual values supplied when the function is called. For example, in def f(x, y):, x and y are parameters. In the call f(3, 5), 3 and 5 are arguments. Many introductory materials use "arguments" informally to refer to the inputs overall, which matches the wording of this question.
Options A, B, and C do not fit the textbook definition. "Variables" is too broad; inputs can be literals, expressions, or variables, but the conceptual role is "arguments." "Procedures" are callable units of code (often used in some languages to mean functions without return values), not the inputs. "Outputs" refers to returned results, not what you pass in.
Understanding arguments is important because it connects to call semantics, scope, and correctness.
Different languages support positional arguments, keyword arguments, default values, and variadic arguments (e.g., *args, **kwargs in Python). This flexibility shapes API design and influences how programmers structure reusable code.


NEW QUESTION # 32
What code would print a subarray of the first 5 elements in numpy_array?

  • A. print(numpy_array.get(5, 1))
  • B. print(numpy_array[:5])
  • C. print(numpy_array.get(0, 5))
  • D. print(numpy_array[1:5])

Answer: B

Explanation:
NumPy arrays support slicing using the same start:stop convention as Python sequences. To take the first five elements, you want indices 0 through 4. The slice numpy_array[:5] means "start from the beginning (default start is 0) and stop before index 5." Because the stop index is exclusive, this returns exactly the first five elements. Printing that slice with print(numpy_array[:5]) displays a 1D view (or copy depending on context) containing those elements.
Option A, numpy_array[1:5], starts at index 1, so it returns elements 1 through 4-only four elements-and it excludes the element at index 0, so it is not the first five elements. Options B and D are incorrect because NumPy arrays do not provide a .get() method for slicing in this manner; .get() is a method associated with dictionaries, not arrays.
Textbooks stress slicing because it is efficient and expressive, especially in data analysis. With slicing, you can take prefixes, suffixes, windows, or regularly spaced samples without writing loops. In NumPy, slicing is particularly important because many slices create views into the same underlying data buffer, enabling memory-efficient operations on large datasets. Understanding inclusive start and exclusive stop boundaries is critical to avoid off-by-one mistakes and to work correctly with batches and segments of numerical data.


NEW QUESTION # 33
What will the expression fam[3:6] return?

  • A. A list with elements at index 3, 4, 5, and 6
  • B. A list with elements at index 6
  • C. A list with elements at index 3, 4, and 5
  • D. A list with elements at index 4, 5, and 6

Answer: C

Explanation:
Python slicing follows the rule `sequence[start:stop]`, where the `start` index is **inclusive** and the `stop` index is **exclusive**. This convention is taught widely because it makes many algorithms and boundary cases simpler: the length of the slice is `stop - start` (when step is 1), and adjacent slices can partition a sequence without overlap. For a list named `fam`, the slice `fam[3:6]` starts at index 3 and includes the elements at indices 3, 4, and 5, but it stops before index 6.
This is a frequent source of off-by-one errors for beginners, so textbooks emphasize remembering: "start is included, stop is not." If `fam` had at least 6 elements, then `fam[3:6]` would produce a new list of exactly three elements (positions 3, 4, 5). If `fam` had fewer than 6 elements, Python would still return a valid slice up to the end without raising an error, because slicing is designed to be safe within bounds.
# Option A is incorrect because it skips index 3 and incorrectly includes index 6. Option B is incorrect because it includes index 6, which the stop boundary excludes. Option D is incorrect because slicing returns a sublist, not a single element; a single element would require indexing like `fam[6]`.


NEW QUESTION # 34
What is the alternative way to access the third element of the first row in np_2d?

  • A. np_2d[3, 1]
  • B. np_2d[2, 0]
  • C. np_2d[1, 3]
  • D. np_2d[0, 2]

Answer: D

Explanation:
NumPy arrays use zero-based indexing, meaning counting starts at 0 rather than 1. In a 2D NumPy array, indexing is typically written in the form array[row_index, column_index]. The first index selects the row, and the second index selects the column. Therefore, the "first row" corresponds to row index 0. Within that row, the "third element" corresponds to column index 2, because the columns are indexed 0, 1, 2, 3, and so on.
So, np_2d[0, 2] directly selects the element at row 0 and column 2, which is the third element in the first row.
This is considered an "alternative" to approaches like two-step indexing (np_2d[0][2]), and it is the standard idiom taught for multi-dimensional NumPy arrays.
The other choices point to different locations. np_2d[1, 3] is the fourth element of the second row, not the third element of the first row. np_2d[2, 0] and np_2d[3, 1] attempt to access the third or fourth row, which would often be out of bounds in a small 2-row example and would raise an IndexError. Correct indexing is a cornerstone of array programming because it determines which observation, feature, or matrix entry your computations will use.


NEW QUESTION # 35
What Python code would return the value 2 from np_2d, where np_2d = np.array([[1, 2, 3, 4], [10, 20, 30,
40]])?

  • A. np_2d[2]
  • B. np_2d[0,1][1]
  • C. np_2d[2, 0]
  • D. np_2d[0,1]

Answer: D

Explanation:
NumPy arrays support multi-dimensional indexing using a comma-separated index tuple. For a 2D array, the first index selects the row and the second index selects the column. With np_2d = np.array([[1, 2, 3, 4], [10,
20, 30, 40]]), row 0 is [1, 2, 3, 4]. Within that row, column 1 is the second element, which is 2. Therefore, np_2d[0, 1] returns 2.
Option A is incorrect because np_2d[0,1] already produces a scalar (an integer), and indexing a scalar again with [1] is invalid. Option C, np_2d[2], attempts to access the third row, but this array has only two rows (indices 0 and 1), so it would raise an index error. Option D, np_2d[2, 0], also references a non-existent third row and would error.
This indexing rule is foundational in array-based computing: it provides direct access to elements without loops and supports efficient numerical computation. Understanding row/column indexing is essential for slicing, broadcasting, and matrix operations taught in scientific computing curricula.


NEW QUESTION # 36
What is the output of print(employees[3]) when employees = ["Anika", "Omar", "Li", "Alex"]?

  • A. "Li"
  • B. "Omar"
  • C. "Alex"
  • D. "Anika"

Answer: C

Explanation:
Python lists are ordered sequences indexed starting from 0. This zero-based indexing is standard in many programming languages and is a core concept in data structures. For the list `employees = ["Anika", "Omar",
"Li", "Alex"]`, the mapping of indices to elements is: index 0 # "Anika", index 1 # "Omar", index 2 # "Li", index 3 # "Alex". Therefore, the expression `employees[3]` selects the element at index 3, which is `"Alex"`, and `print(employees[3])` outputs `Alex` (strings print without quotes in normal output).
Option A would be correct for `employees[1]`, option D would be correct for `employees[2]`, and option C would be correct for `employees[0]`. This kind of question tests understanding of list indexing, which is essential for iteration, slicing, and algorithm implementation.
# Textbooks also note the difference between indexing and slicing: indexing returns a single element, while slicing returns a sublist. Here, because square brackets contain a single integer index, it is indexing. If you attempted an index that is out of range, Python would raise an `IndexError`, which reinforces careful reasoning about list length and positions. Understanding these fundamentals is critical for correctly manipulating datasets, where row/column positions and offsets frequently matter.


NEW QUESTION # 37
What is the only content that will display if the List folder contents permission is not enabled for a particular folder in Windows 11?

  • A. The folder's author
  • B. Files with Read permission
  • C. Files with Write permission
  • D. The folder's creation date

Answer: D

Explanation:
In Windows file security (NTFS permissions), "List folder contents" controls whether a user cansee the names of files and subfoldersinside a folder. If a user does not have permission to list a folder, Windows prevents directory enumeration: the user cannot browse the folder and view what is inside. (2BrightSparks) This is a key concept in access control: it separates "being able to traverse to a location" from "being able to see what is stored there." When "List folder contents" is not enabled, the user typically cannot view the list of files regardless of whether individual files might have separate permissions. In standard user-facing behavior, what remains visible in the folder's properties and metadata is limited; among the choices given, the only item that is reliably a folder-level metadata attribute (and not a listing of contents) is the folder'screation date. The
"author" is not a universal, reliably displayed NTFS folder property, and options C and D talk about files (contents), which cannot be listed without the list permission. (2BrightSparks) This reflects a broader textbook principle: operating systems enforce access control both on objects (files/folders) and on operations (read data, write data, list directory). Removing the list operation blocks visibility of contents, even if other permissions exist elsewhere.


NEW QUESTION # 38
What is the main advantage of using NumPy arrays over regular Python lists for data analysis?

  • A. NumPy arrays can only hold elements of the same type.
  • B. NumPy arrays can concatenate lists by default.
  • C. NumPy arrays can bring different types into the array at the same time.
  • D. NumPy arrays can perform calculations over entire collections of values.

Answer: D

Explanation:
The primary advantage of NumPy arrays in data analysis is their support for fast, vectorized computation over whole collections of numeric data. A NumPy `ndarray` stores elements in a contiguous memory block with a single, fixed data type, enabling efficient low-level operations implemented in optimized C/Fortran code. As a result, expressions like `arr + 5`, `arr * arr`, or `np.mean(arr)` operate over the entire array without explicit Python loops. This style is commonly called **vectorization**, and it is a central theme in scientific computing textbooks because it is both clearer to read and significantly faster for large datasets.
Option A describes a property of Python lists, not NumPy arrays. Python lists can mix types freely, but this flexibility comes with overhead. Option B is true-NumPy arrays typically hold a single dtype-but it is not the main advantage; it is more of an implementation feature that enables speed and memory efficiency.
Option D is not a defining advantage; both lists and arrays can be concatenated, and NumPy provides dedicated functions such as `np.concatenate`, but concatenation is not the core reason NumPy dominates data analysis workflows.
# Because NumPy operations are applied element-wise across entire arrays and can leverage CPU vector instructions and efficient memory access patterns, they form the foundation for higher-level tools like pandas, SciPy, and many machine learning libraries. This is why the best answer is that NumPy arrays can perform calculations over entire collections of values.


NEW QUESTION # 39
What is the expected result of running the following code: list1[0] = "California"?

  • A. The first value in the list will be replaced with "California".
  • B. A second element will be added to the line "California".
  • C. A new list will be created with the value "California".
  • D. The list will be extended by adding "California" at the end.

Answer: A

Explanation:
Python lists are mutable sequences, which means elements can be changed in place after the list has been created. The expression list1[0] = "California" uses indexing to target the element at position 0 (the first element, because Python uses zero-based indexing) and assignment (=) to replace that element with a new value. As a result, the list keeps the same length, but its first entry becomes "California".
This operation does not create a new list (so option A is incorrect); it modifies the existing list object referenced by list1. It also does not append to the end of the list (so option C is incorrect). Appending would use methods like list1.append("California"). Option D is not meaningful in Python list semantics; assignment to a single index replaces exactly one element rather than "adding a second element to the line." Textbooks highlight this difference between mutable and immutable sequence types. For example, strings are immutable, so you cannot assign to some_string[0]. Lists, however, are designed for collections that change over time, supporting updates, insertions, deletions, and reordering. Index assignment is fundamental for many algorithms: updating an array-like buffer, modifying a dataset row, replacing incorrect values, or implementing in-place transformations efficiently.


NEW QUESTION # 40
What is the first step in the selection sort algorithm?

  • A. Sort the list in descending order.
  • B. Find the highest value and the lowest value in the list.
  • C. Swap the first and last elements.
  • D. Determine the lowest value starting from the first position.

Answer: D

Explanation:
Selection sort works by growing a sorted portion of the list one element at a time. The algorithm conceptually divides the array into two regions: asorted prefixon the left and anunsorted suffixon the right. At the beginning, the sorted prefix is empty and the entire list is unsorted. The first step is to consider position 0 as the target location for the smallest element. The algorithm scans the unsorted region (initially the whole list) to find the smallest valueand records its index. That action is exactly what option C describes: determine the lowest value starting from the first position.
After identifying the minimum element, selection sort swaps it into position 0 (if it isn't already there). Then it repeats the process for position 1, scanning the remaining unsorted suffix to find the next smallest element, swapping it into place, and so on. Textbooks emphasize that the key characteristic of selection sort is the repeated "select min (or max) from unsorted region and place it into the sorted region." Option A is not the standard first step; finding both min and max is unnecessary. Option B describes an unrelated swap that doesn't ensure progress toward sorting. Option D is not a "first step" but rather a different ordering goal; selection sort can be adapted for descending order, but the canonical version begins by selecting the minimum for the first position.


NEW QUESTION # 41
How is the NumPy package imported into a Python session?

  • A. import numpy as np
  • B. import num_py
  • C. include numpy
  • D. using numpy

Answer: A

Explanation:
In Python, external libraries are brought into a program using the import statement. NumPy, which provides the ndarray type and a large collection of numerical computing functions, is conventionally imported with an alias for convenience. The standard and widely taught pattern is import numpy as np. This imports the numpy module and binds it to the shorter name np, making code more readable and reducing repeated typing, especially in mathematical expressions such as np.array(...), np.mean(...), or np.dot(...).
Option A is incorrect because the module name is numpy, not num_py. Options C and D resemble syntax from other languages (for example, "using" in C# or "include" in C/C++), but they are not valid Python import mechanisms. Python's module system is based on imports, and the aliasing feature (as np) is built into the import statement.
Textbooks also emphasize that importing a package requires that it be installed in the active Python environment. If NumPy is not installed, import numpy as np will raise an ImportError (or ModuleNotFoundError in modern Python). Once imported, the alias np is used consistently in scientific computing materials, notebooks, and professional data analysis codebases, which is why this option is considered the correct and expected answer.


NEW QUESTION # 42
What is the purpose of the pointer element of each node in a linked list?

  • A. To indicate the current position
  • B. To indicate the next node
  • C. To keep track of the list size
  • D. To store the data value

Answer: B

Explanation:
In a singly linked list, each node is a small record that typically contains two main parts: a data field and a pointer field. The data field stores the actual value being kept in the list. The pointer field stores the address or reference of another node. The pointer element's purpose is to connect one node to the next by indicating where the next node is located in memory. This is essential because linked-list nodes are not stored in contiguous memory locations the way array elements are. Nodes may exist anywhere in memory, and the pointer is what preserves the logical sequence of the list.
This design supports efficient structural changes. For traversal, a program starts at the head node and repeatedly follows the pointer to reach subsequent nodes. For insertion, a new node can be added by adjusting a small number of pointers instead of shifting many elements, as would be required in an array. For deletion, the list can "skip over" a node by updating the pointer in the previous node to reference the node after the removed one. The end of the list is typically represented by a null pointer value, signaling there is no next node.
Keeping track of list size or current position is not the responsibility of each node's pointer field; these are usually handled by separate variables or computed during traversal.


NEW QUESTION # 43
Which protocol provides encryption while email messages are in transit?

  • A. FTP
  • B. TLS
  • C. HTTP
  • D. IMAP

Answer: B

Explanation:
"Encryption in transit" means protecting data while it moves across a network so that eavesdroppers cannot read or modify it. For email systems, this protection is most commonly provided byTLS (Transport Layer Security). TLS is a cryptographic protocol that can wrap application protocols (including mail protocols) to provide confidentiality, integrity, and server (and sometimes client) authentication. In practice, TLS is used to secure connections such as SMTP submission (often with STARTTLS or implicit TLS), IMAP over TLS, and POP3 over TLS. Textbooks present TLS as the standard successor to SSL and the foundation of secure communication on the modern Internet.
The other options are not correct in this context. FTP is a file transfer protocol and is traditionally unencrypted unless paired with additional security mechanisms (e.g., FTPS, which uses TLS, or SFTP, which uses SSH). HTTP is a web protocol; it becomes encrypted only when used as HTTPS, which again relies on TLS underneath. IMAP is an email retrieval protocol, butIMAP itself is not the encryption protocol- IMAP can be run over TLS (IMAPS) to become secure.
Therefore, the protocol that provides encryption while email messages (or email protocol traffic) are in transit is TLS.


NEW QUESTION # 44
Which action is taken if the first number is the lowest value in a selection sort?

  • A. It swaps the selected element with the first unsorted element.
  • B. The first number is increased by one.
  • C. The first number is duplicated.
  • D. It swaps the selected element with the last unsorted element.

Answer: A

Explanation:
Selection sort works by maintaining a boundary between a sorted prefix and an unsorted suffix. On each pass, the algorithm finds the smallest value in the unsorted portion and places it into the first position of that unsorted portion (which is also the next position in the sorted prefix). This is usually done by swapping the element at the minimum's index with the element at the boundary index (the "first unsorted element"). That description matches option D.
If the first element of the unsorted portion is already the smallest, then the minimum's index equals the boundary index. In textbook implementations, the algorithm may still execute a swap operation, but it becomes a swap of an element with itself (a no-op), leaving the array unchanged. Many implementations include a small optimization: perform the swap only if the minimum index differs from the boundary index.
Either way, conceptually the "action taken" by selection sort is still "swap the selected minimum into the first unsorted position," which is exactly what option D states.
Options A and B are unrelated to sorting; selection sort never increases or duplicates values. Option C is incorrect because selection sort swaps the minimum with thefirstunsorted element, not the last. After the swap (or no-op), the sorted region grows by one element, and the algorithm repeats from the next boundary position.
This logic is fundamental for understanding how selection sort ensures correctness: after pass i, the smallest i+1 elements are fixed in their final positions.


NEW QUESTION # 45
What is the built-in data structure that implements a hash table in Python?

  • A. Array
  • B. Dictionary
  • C. List
  • D. Tuple

Answer: B

Explanation:
A hash table is a data structure that supports fast lookup, insertion, and deletion by using ahash functionto map keys to positions in an underlying storage structure. In Python, the built-in data structure that provides hash-table behavior is thedictionary, written with curly braces like {"a": 1, "b": 2}. Dictionaries store key- value pairs and are designed so that accessing a value by key, such as d["a"], is efficient on average.
Textbooks typically describe this expected efficiency as average-case constant time, often written as O(1), assuming a good hash function and a well-managed table size.
Tuples and lists are sequence types. Lists provide indexed access by integer position, not hashing by arbitrary keys. Tuples are immutable sequences and likewise do not provide key-based hashing semantics. "Array" is not the core built-in mapping structure in Python; while Python has an array module and NumPy has arrays, neither is the built-in hash table abstraction for general key-value storage.
Python dictionaries require keys to be hashable, meaning the key's hash value is stable during its lifetime (common examples: strings, numbers, tuples of hashable items). This requirement is directly tied to hash-table implementation. Dictionaries are used throughout computer science applications:
symbol tables in interpreters, caches and memoization, frequency counting, indexing, and implementing graphs via adjacency maps.


NEW QUESTION # 46
What is a correct call to the linear search defined as def linear_search(customersList, search_value): ?

  • A. linear_search()(customersList)
  • B. print(linear_search(customersList, search_value))
  • C. search_linear(customersList, search_value)
  • D. find_linear(customersList)

Answer: B

Explanation:
A function definition in Python specifies a function name and a list of parameters. Here, def linear_search (customersList, search_value): defines a function named linear_search that requirestwo argumentswhen called: a list (or sequence) of customer items and the value being searched for. A correct call must therefore supply both arguments in the same order: linear_search(customersList, search_value). Option B is correct because it calls the function properly and then prints the returned result.
Textbooks describe linear search as scanning the list from the beginning to the end, comparing each element to search_value until a match is found or the list ends. The function typically returns an index (e.g., position of the match) or a Boolean, or possibly -1/None if not found. Wrapping the call in print(...) is a standard way to display the returned value for testing or demonstration.
Option A is incorrect because it calls a different function name, not linear_search. Option C is incorrect because linear_search() would attempt to call the function with zero arguments, which would raise a TypeError, and then it tries to call the result as if it were another function. Option D uses a different function name (search_linear) and also contains a spelling mismatch compared to the given definition.


NEW QUESTION # 47
What is the method for changing an element in a Python list?

  • A. Use curly brackets and the equals sign
  • B. Use parentheses and the plus sign
  • C. Use square brackets and the equals sign
  • D. Use the del keyword and the element's value

Answer: C

Explanation:
In Python, a list is a mutable sequence, meaning its elements can be changed after the list is created. The standard textbook method for updating a specific element isindex assignment, which uses square brackets to select the position and the equals sign to assign a new value. For example, if nums = [10, 20, 30], then nums
[1] = 99 changes the element at index 1 from 20 to 99, producing [10, 99, 30]. This works because lists store references to objects and allow those references to be updated in-place.
Option B is incorrect because parentheses are used for function calls and tuples, and the plus sign typically performs concatenation (creating a new list) rather than modifying an existing element by position. Option C is incorrect because curly brackets denote dictionaries or sets, not lists. Option D is incorrect because del removes elements by index or slice (for example, del nums[1]), and it does not delete by "the element's value" unless you first find the index. Deleting is not the same as changing; deletion reduces the list's length and shifts later indices.
Index assignment is fundamental in list manipulation and appears in standard algorithms: updating counters, replacing sentinel values, editing collections, and implementing in-place transformations efficiently without allocating a new list.


NEW QUESTION # 48
What type of encryption is provided by encryption utilities built into the file system?

  • A. Encryption steganography
  • B. Encryption authentication
  • C. Encryption in motion
  • D. Encryption at rest

Answer: D

Explanation:
File system encryption utilities are designed to protect datastored on a disk-for example, files on an SSD, HDD, or other persistent storage. This protection is calledencryption at rest. The key idea is that if an attacker steals the physical drive, gains access to a powered-off machine, or otherwise reads storage directly, the raw bytes on disk remain unreadable without the correct cryptographic key. Common textbook examples include full-disk encryption and per-file encryption supported by operating systems and file systems.
This differs fromencryption in motion(also called encryption in transit), which protects data while it is being transmitted over networks, such as via TLS/HTTPS, VPNs, or secure messaging protocols. File system utilities do not primarily address network transmission; they address stored data confidentiality. Option B,
"encryption authentication," is not a standard category; authentication is a security goal often achieved using mechanisms like digital signatures, MACs, certificates, and protocol handshakes, not a type of file system encryption. Option D, steganography, is the practice of hiding information within other data (like images or audio) rather than encrypting it for confidentiality.
In short, file system encryption utilities aim to ensure that stored files remain confidential if storage is accessed without authorization, which is precisely the definition of encryption at rest.


NEW QUESTION # 49
What is the correct way to represent a boolean value in Python?

  • A. "true"
  • B. True
  • C. "True"
  • D. true

Answer: B

Explanation:
Python has a built-in boolean type named bool, which has exactly two values: True and False. These are language keywords/constants and are case-sensitive. Therefore, the correct representation of a boolean value is True (capital T, lowercase rest) or False (capital F). This is consistently taught in introductory programming textbooks because it affects conditional statements (if, while), logical operations (and, or, not), and comparisons.
Option A, "True", is a string literal, not a boolean. While it visually resembles the boolean constant, it behaves differently: non-empty strings are "truthy" in conditions, but "True" == True is false because they are different types (str vs bool). Option B, "true", is also a string, and it differs in casing as well. Option D, true, is not valid in Python; it will raise a NameError unless a variable named true has been defined.
Textbooks also stress that boolean values often result from comparisons, such as x > 0, and that booleans are a subtype of integers in Python (True behaves like 1 and False like 0 in arithmetic contexts). Still, their primary use is representing logical truth values for control flow and decision- making.


NEW QUESTION # 50
How is a NumPy array named data with 6 elements reshaped into a 2x3 array?

  • A. data.set_shape(2, 3)
  • B. data_reshape[2, 3]
  • C. np.reshape(data, (2, 3))
  • D. np_reshape(list, (2, 3))

Answer: C

Explanation:
Reshaping is the operation of changing the "view" of an array so that the same elements are arranged with new dimensions. In NumPy, reshaping is possible when the total number of elements stays the same. A 2x3 array contains 6 elements, so a 1D array data of length 6 can be reshaped into shape (2, 3) without adding or removing values. Textbooks stress this invariant: the product of the dimensions must equal the original size.
NumPy provides two standard reshaping interfaces: the function np.reshape(data, (2, 3)) and the method data.
reshape(2, 3) (or data.reshape((2, 3))). Option A is correct because it uses the official NumPy function with the proper arguments: the original array and the target shape. The shape is passed as a tuple describing rows and columns.
Option B is incorrect because np_reshape is not the correct NumPy function name, and it references an unrelated identifier list. Option C is incorrect because NumPy arrays do not provide a set_shape method like that. Option D is not valid NumPy syntax for reshaping.
Reshaping is fundamental in data analysis and machine learning: it converts flat vectors into matrices, prepares batches of samples, and aligns dimensions for matrix multiplication and broadcasting.


NEW QUESTION # 51
What Python code would return the value 40 from np_2d, where np_2d = np.array([[1, 2, 3, 4], [10, 20, 30,
40]])?

  • A. np_2d[3, 1]
  • B. np_2d[4, 1]
  • C. np_2d[1, 3]
  • D. np_2d[0, 4]

Answer: C

Explanation:
In a 2D NumPy array, indexing is written as array[row_index, column_index] using zero-based indices. The array np_2d = np.array([[1, 2, 3, 4], [10, 20, 30, 40]]) has two rows (indices 0 and 1) and four columns (indices 0, 1, 2, 3). The value 40 is located in the second row and the fourth column. Using zero-based indexing, that corresponds to row index 1 and column index 3. Therefore, np_2d[1, 3] returns 40.
Option A attempts to access row 3, which does not exist and would raise an IndexError. Option C attempts to access column 4 in row 0, but valid column indices are only 0 through 3, so it would also error. Option D likewise refers to a non-existent row 4. Only option B uses valid indices and points to the correct location.
Textbooks emphasize multi-dimensional indexing because it underlies matrix operations, dataset manipulation, and feature extraction in data science. Correctly interpreting rows and columns is essential when rows represent observations (like people) and columns represent attributes (like age, weight, height). This question tests precise control over row/column addressing, which prevents subtle bugs in numerical analysis.


NEW QUESTION # 52
How can a user subset a NumPy array bmi to only include values over 23?

  • A. bmi.select(23)
  • B. bmi[bmi > 23]
  • C. bmi.where(bmi > 23)
  • D. bmi.get_values(>23)

Answer: B

Explanation:
NumPy supports a powerful technique calledBoolean indexing(also called Boolean masking) to filter arrays based on a condition. When you write bmi > 23, NumPy performs an element-wise comparison and produces a Boolean array of the same shape, containing True where the condition holds and False otherwise. Using that Boolean array inside square brackets, as in bmi[bmi > 23], tells NumPy to return a new 1D array containing only the elements whose mask value is True. This approach is heavily emphasized in scientific computing curricula because it expresses selection logic without explicit loops and runs efficiently in optimized compiled code.
Option B looks close but is not standard NumPy usage. The function commonly used is np.where(condition) or np.where(condition, x, y). While np.where(bmi > 23) can return indices, bmi.where(...) is not a NumPy array method; it is more associated with pandas objects. Options A and C are not valid NumPy APIs for filtering.
Boolean indexing is central in data analysis tasks such as removing invalid measurements, selecting a population subgroup, applying thresholds, and building feature subsets. It composes cleanly with vectorized computation, for example bmi[bmi > 23].mean(), enabling concise and high-performance numerical workflows.


NEW QUESTION # 53
......

Verified Foundations-of-Computer-Science exam dumps Q&As with Correct 72 Questions and Answers: https://www.troytecdumps.com/Foundations-of-Computer-Science-troytec-exam-dumps.html

Get New Foundations-of-Computer-Science Certification – Valid Exam Dumps Questions: https://drive.google.com/open?id=1pXdweF7gqA6HdZNXhUOxOj3XuABGckAX