Coding Fundamentals Flashcards
5 cards from real CodeSignal Technical Assessment practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 5 Coding Fundamentals flashcards as text
What is the time complexity of searching for an element in a balanced binary search tree (BST)?
Answer: O(log n)
In a balanced binary search tree, each comparison effectively halves the search space. This logarithmic reduction in the number of elements to check leads to a time complexity of O(log n) for search, insertion, and deletion operations. This efficiency makes balanced BSTs highly effective for managing ordered data.
Which SQL query retrieves all rows from a table named employees where the salary is greater than 5000?
Answer: SELECT * FROM employees WHERE salary > 5000;
The `SELECT *` clause specifies that all columns should be retrieved from the `employees` table. The `WHERE salary > 5000` clause then filters these results, ensuring that only rows where the 'salary' column has a value strictly greater than 5000 are included in the output. This is the standard SQL syntax for such a conditional selection.
Which CSS property is used to create space between the element's content and its border?
Answer: padding
In CSS, `padding` is the property used to generate space within an element's box, specifically between its content and its border. This internal spacing pushes the content away from the border, affecting the element's overall size. In contrast, `margin` creates space outside the element's border, separating it from other elements.
Which Python library is primarily used for data manipulation and analysis?
Answer: Pandas
Pandas is a powerful and widely used open-source Python library specifically designed for data manipulation and analysis. It provides data structures like DataFrames and Series, which are highly efficient for handling tabular data, performing operations like filtering, grouping, merging, and cleaning datasets. While NumPy is foundational for numerical computing, Pandas builds upon it to offer more high-level data handling capabilities.
Which HTTP status code indicates that the resource was not found?
Answer: 404
The HTTP status code 404 Not Found is a standard response code indicating that the server could not find the requested resource. This means the URL is recognized, but the resource itself (e.g., a specific webpage or file) does not exist at that location. It's a common error seen when a link is broken or a page has been moved.