Try Before You Buy

Download a free sample of any of our exam questions and answers

  • 24/7 customer support, Secure shopping site
  • Free One year updates to match real exam scenarios
  • If you failed your exam after buying our products we will refund the full amount back to you.

[Q34-Q51] Free Sample Questions to Practice Foundations-of-Computer-Science Certification Test Engine [Aug-2026]

Share

Free Sample Questions to Practice Foundations-of-Computer-Science Certification Test Engine [Aug-2026]

2026 Valid Foundations-of-Computer-Science Real Exam Questions, practice Courses and Certificates

NEW QUESTION # 34
The np_2d array stores information about multiple family members. Each row represents a different person, and the columns store family member attributes in the following order:
Age (years)
Weight (pounds)
Height (inches)
How is the weight of all family members selected from the np_2d array?

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

Answer: C

Explanation:
In a 2D NumPy array, rows and columns represent different dimensions of the data. The indexing form array
[row_selection, column_selection] allows you to select entire rows, entire columns, or submatrices. The slice :
means "all indices along this dimension." Since each row corresponds to a family member (a person), selecting weights forallfamily members means selectingall rowsfor the weight column.
The problem states the columns are ordered as: Age (column 0), Weight (column 1), Height (column 2).
Therefore, the weight column has index 1. The expression np_2d[:, 1] uses : to take every row and 1 to take the second column, producing a 1D array (or a column view) containing the weight values for all people.
Option A, np_2d[:, 2], would select the height column, not weight. Option C, np_2d[2, :], selects the third row (the third person) and all columns-age, weight, and height for just that one person. Option D, np_2d[1, :], selects the second person's entire row.
This column selection technique is fundamental in data analysis because datasets are often stored as
"rows = observations, columns = features," and extracting a feature vector is a frequent operation before computing statistics or building models.


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

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

Answer: A

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 # 36
What is the correct way to convert an integer to a string in Python?

  • A. tostring(variable)
  • B. string(variable)
  • C. int_to_str(variable)
  • D. str(variable)

Answer: D

Explanation:
Python provides built-in type conversion functions that construct a value of a target type from a supplied object when possible. To convert an integer to a string, Python uses the constructor function str(). For example, str(42) produces the string "42". This operation is fundamental in programming textbooks because it enables tasks like formatting output, concatenating numbers into messages, building file names, or preparing numeric values for text-based storage and transmission.
Python distinguishes clearly between numeric types (int, float) and text type (str). You cannot concatenate an integer directly with a string (e.g., "Age: " + 30 raises a TypeError) because the types are different. Using str (30) resolves this by converting the integer into its string representation: "Age: " + str(30) becomes valid.
Modern Python commonly uses f-strings (f"Age: {30}"), which perform conversion automatically, but str() remains the canonical and explicit method.
Options A, B, and C are not standard Python built-ins for conversion. While some libraries define helper functions with similar names, the language's standard approach is str(...). Textbooks also highlight that str() is not limited to integers: it can convert many objects into readable string representations, often by invoking the object's __str__ method. This ties conversion to Python's object model and supports consistent display and logging across programs.


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

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

Answer: D

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 # 38
What is the name of the tool that can allow a device to run more than one operating system at a time as virtual machines?

  • A. Bootloader
  • B. Hypervisor
  • C. System Restore
  • D. Partition Manager

Answer: B


NEW QUESTION # 39
What statistical measure can be used to detect outliers in a dataset using NumPy?

  • A. Median absolute deviation
  • B. Standard deviation
  • C. Mode
  • D. Variance

Answer: A

Explanation:
Outlier detection often relies on measuring how far values deviate from a "typical" center. While variance and standard deviation can be used in simple z-score based methods, they arenot robust: a few extreme outliers can inflate the mean and standard deviation, masking the very outliers you want to find. A widely taught robust alternative is themedian absolute deviation (MAD), which is based on the median rather than the mean and therefore resists distortion by extreme values.
MAD is computed by first taking the median of the data, then computing the absolute deviation of each point from that median, and finally taking the median of those deviations. Because medians are stable under extreme values, MAD provides a strong baseline for identifying unusually distant points. Many textbooks and data analysis references present MAD as a robust scale estimator for outlier detection, often combined with a threshold rule such as flagging points whose deviation exceeds a constant multiple of MAD (with a scaling factor sometimes used to make it comparable to standard deviation under normality assumptions).
In NumPy, you can implement MAD using np.median() and np.abs(). Mode is generally not useful for continuous numeric outlier detection, and variance/standard deviation are more sensitive to outliers than MAD. Thus, among the given options, the best statistical measure for detecting outliers robustly is the median absolute deviation.


NEW QUESTION # 40
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[0,1]
  • B. np_2d[2]
  • C. np_2d[0,1][1]
  • D. np_2d[2, 0]

Answer: A

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 # 41
Which brand of Type 1 hypervisor is commonly used to create virtual machines?

  • A. Parallels Desktop
  • B. VMware ESXi
  • C. VirtualBox
  • D. VMware Workstation

Answer: B

Explanation:
AType 1 hypervisor, also called abare-metal hypervisor, runs directly on the host machine's hardware rather than on top of a general-purpose operating system. This design is widely described in virtualization textbooks because it improves performance and isolation: the hypervisor controls CPU scheduling, memory management, and I/O virtualization with minimal overhead from an intermediate OS layer. Type 1 hypervisors are therefore common in servers and data centers.
Among the options,VMware ESXiis the well-known Type 1 hypervisor product. It is installed directly onto physical server hardware and provides the virtualization layer used to run multiple virtual machines. In contrast, Parallels Desktop, VirtualBox, and VMware Workstation are typically categorized asType 2 hypervisors, meaning they run as applications on top of a host operating system like Windows, macOS, or Linux. Type 2 hypervisors are excellent for desktops, development, testing, and learning, but they generally rely on the host OS for device drivers and resource management, which can add overhead.
This distinction matters in practice: data centers favor Type 1 hypervisors for efficiency, centralized management, and robust isolation between workloads. Desktop users often choose Type 2 hypervisors for convenience and easier installation. Therefore, the commonly used Type 1 hypervisor brand listed here is VMware ESXi.


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

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

Answer: B


NEW QUESTION # 43
What is the purpose of user management and access control in a networked environment?

  • A. To provide unlimited access to all network resources
  • B. To establish permissions and monitor resource usage
  • C. To ensure all users have the same level of access to resources
  • D. To restrict all users from accessing confidential documents

Answer: B

Explanation:
In a networked environment, user management and access control exist to ensure that resources are used securely, appropriately, and accountably. The core idea isauthorization: defining what each user (or group of users) is allowed to do-read files, modify data, access applications, administer systems, and so on. This is commonly guided by the principle ofleast privilege, which states that users should receive only the permissions necessary to perform their tasks. Proper access control reduces the damage from mistakes and limits the impact of compromised accounts.
User management also includesauthenticationsupport (ensuring a user is who they claim to be) and administrative functions such as creating accounts, assigning roles, revoking access, and enforcing policies (password rules, multi-factor authentication requirements, session timeouts). In many systems, access control is implemented through models like discretionary access control (DAC), role-based access control (RBAC), or mandatory access control (MAC), each with different security properties.
Option B correctly reflects this: the goal is to establish permissions and to monitor or audit usage (logging access, tracking changes, detecting suspicious behavior). Option A is wrong because equal access is rarely secure or practical. Option C is the opposite of secure practice. Option D is too absolute:
systems typically restrict some users from some confidential resources, not all users from all confidential documents.


NEW QUESTION # 44
What is the time complexity of a quicksort algorithm?

  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n log n)

Answer: D

Explanation:
Quicksort is a divide-and-conquer sorting algorithm. It works by selecting a pivot element, partitioning the array into two subarrays (elements less than the pivot and elements greater than the pivot), and then recursively sorting those subarrays. In the average case, the partition step splits the array into roughly equal halves, so the recurrence is commonly written as (T(n) = T(n/2) + T(n/2) + O(n)), where (O(n)) is the cost of partitioning. This solves to (O(n \log n)), which is why quicksort is widely taught as an efficient general- purpose sorting method.
However, textbooks also emphasize that quicksort has a worst-case time complexity of (O(n^2)) when partitions are extremely unbalanced (for example, repeatedly choosing the smallest or largest element as the pivot on already sorted input). Practical implementations reduce the likelihood of worst-case behavior using randomized pivots or "median-of-three" pivot selection. Despite the worst-case, quicksort is often very fast in practice because it has good cache performance and low constant factors, and it sorts in place with only (O (\log n)) average recursion stack space.
Among the provided options, the correct expected complexity for quicksort (average-case, and commonly cited in coursework questions) is (O(n \log n)). The other options are too small to represent the cost of sorting arbitrary data.


NEW QUESTION # 45
Which type of data structure is the only focus of a binary search?

  • A. Linked list
  • B. Ordered list
  • C. Queue
  • D. Stack

Answer: B

Explanation:
Binary search is designed for searching in asorted (ordered) sequence. Its efficiency comes from repeatedly comparing the target to the middle element and discarding half of the remaining search space. This halving logic only works when the data is ordered, because the algorithm relies on the guarantee that all elements on one side of the midpoint are smaller (or larger) than the midpoint. In textbooks, this requirement is stated explicitly: binary search assumes the collection is sorted according to the same ordering used for comparisons.
An "ordered list" is therefore the correct focus among the options. Binary search can be implemented on arrays or other random-access structures where you can quickly access the middle element by index. While you can conceptually perform binary search on a linked list, it becomes inefficient because finding the middle requires linear traversal, losing the O(log n) advantage. Stacks and queues are not appropriate because they restrict access to ends only (LIFO for stacks, FIFO for queues), preventing direct access to the midpoint and making the binary search strategy infeasible.
Thus, the central requirement for binary search is a sorted/ordered sequence, typically supporting efficient indexing, which is why the correct choice is an ordered list.


NEW QUESTION # 46
What is the expected output of calling .shape on a NumPy 2D array?

  • A. The type of elements in the array
  • B. The sum of the dimensions of the array
  • C. The number of rows and columns in the 2D array
  • D. The total number of elements in the array

Answer: C

Explanation:
In NumPy, every ndarray has a shape attribute that describes the size of the array along each dimension. For a
2D array, shape returns a tuple with two integers: (number_of_rows, number_of_columns). For example, if a
= np.array([[1, 2, 3], [4, 5, 6]]), then a.shape is (2, 3), meaning 2 rows and 3 columns. This is a fundamental idea in matrix and array computing, because shape governs how indexing, slicing, broadcasting, and linear algebra operations behave.
Option A describes the dtype, which can be accessed with a.dtype, not a.shape. Option C is incorrect because shape provides per-dimension sizes, not their sum. Option D refers to the total number of elements, which NumPy provides via a.size (or equivalently np.prod(a.shape)).
Textbooks emphasize shape because many errors in numerical computing come from mismatched dimensions. For example, matrix multiplication requires compatible inner dimensions, and broadcasting rules depend on dimension sizes. By checking .shape, programmers can verify their data layout before applying algorithms, ensuring rows represent observations and columns represent features (or vice versa). Thus, for a 2D NumPy array, .shape indicates the number of rows and columns.


NEW QUESTION # 47
Which process is designed to establish the identity of the user such as with a username and password?

  • A. Certification
  • B. Authentication
  • C. Verification
  • D. Registration

Answer: B

Explanation:
Authenticationis the security process of proving or establishing a user's identity. In textbook terminology, authentication answers the question: "Who are you?" Common authentication factors include something you know (password, PIN), something you have (smart card, hardware token), and something you are (biometrics). Username and password is the classic "something you know" mechanism, where the username identifies the account and the password serves as a secret used to validate that the user is the rightful owner of that account.
Authentication is distinct fromauthorization, which determines what an authenticated user is allowed to do (permissions, roles). It is also distinct from registration, which is the administrative act of creating an account or enrolling a user in a system. "Verification" is a general term that can appear in many contexts, but in security frameworks the precise term for identity establishment is authentication. "Certification" usually refers to issuing or validating credentials such as digital certificates (PKI) or professional certifications, not the act of logging in with a password.
Textbooks emphasize that authentication should be strengthened with practices like hashing and salting passwords, multi-factor authentication (MFA), lockout policies, and secure transport (e.g., TLS) to prevent credential theft. The core concept remains: the process that establishes identity using credentials like a username and password is authentication.


NEW QUESTION # 48
Given the following code, what is the expected output?

  • A. [10, 20, 30, 40]
  • B. [1, 2, 3, 4]
  • C. array([10, 20, 30, 40])
  • D. [1, 10]

Answer: B

Explanation:
In NumPy, a 2D array can be visualized as a table of rows and columns. When you write np_2d[0], you are usingzero-based indexingto select thefirst rowof that 2D array. This is a standard convention in Python and many other programming languages: index 0 refers to the first element, index 1 to the second, and so on.
Therefore, np_2d[0] returns all the elements in row 0.
With a typical construction such as np_2d = np.array([[1, 2, 3, 4], [10, 20, 30, 40]]), the first row is [1, 2, 3,
4], so printing np_2d[0] displays that row. NumPy returns the row as a 1D NumPy array, and when printed it often appears in bracket form like [1 2 3 4] (spaces rather than commas are common in NumPy's display).
Conceptually, however, the contents are exactly the first row values, matching option C.
Option A and D show the second row (index 1), not the first. Option B incorrectly suggests a column extraction rather than a row selection.


NEW QUESTION # 49
Which Windows 11 tool enables a user to manually add a Bluetooth device if it does not automatically configure when first connected?

  • A. Task scheduler
  • B. Device manager
  • C. Network center
  • D. Windows defender

Answer: B

Explanation:
When a Bluetooth device does not configure automatically, the underlying issue is often driver discovery, device enumeration, or the Bluetooth adapter's state. In Windows, the tool traditionally associated with manually managing hardware devices and their drivers isDevice Manager. It lets a user view hardware categories (including Bluetooth adapters), enable or disable devices, update drivers, uninstall and rescan, and address "unknown device" situations. These actions are core to manual configuration because they influence whether Windows can properly recognize and communicate with a Bluetooth device.
Windows 11 pairing itself is typically initiated from the Settings app under Bluetooth and devices, where a user chooses "Add device" to pair a new accessory. (Microsoft Support) However, among the options provided, only Device Manager is a hardware-configuration tool that can resolve situations where automatic configuration fails due to driver or adapter problems. Network-related tools do not handle local device drivers, Task Scheduler automates tasks rather than adding devices, and Windows Defender is focused on security and malware protection rather than device setup.
From a systems perspective, this reflects a key operating-systems concept: successful device use requires both discovery/pairing and a correctly installed driver stack. Device Manager is the standard interface for the driver and device side of that equation, which is why it is the best match to "manually add or configure" hardware in the given choices.


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

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

Answer: A

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 # 51
......

Genuine Foundations-of-Computer-Science Exam Dumps Free Demo Valid QA's: https://troytec.examstorrent.com/Foundations-of-Computer-Science-exam-dumps-torrent.html