Mixed Deck — All CodeSignal Technical Assessment Topics Flashcards
100 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 20 Mixed Deck — All CodeSignal Technical Assessment Topics flashcards as text
In a scenario where you need to check if a string is a palindrome (reads the same forwards and backwards), which algorithm offers the best time complexity?
Answer: Use two pointers, one at the beginning and one at the end, moving towards the center and comparing characters.
The two-pointer technique is the most efficient method. One pointer starts at the beginning of the string and the other at the end. The characters at these pointers are compared. If they are the same, the pointers move towards each other. This process continues until the pointers meet or cross. This approach has a time complexity of O(n/2), which simplifies to O(n), and a space complexity of O(1) as it doesn't require creating a new copy of the string or a separate data structure.
You are designing a URL shortener expected to handle 10,000 writes/sec. What is the primary bottleneck to address first?
Answer: Unique ID generation at scale
At high write rates, generating collision-free short codes becomes the bottleneck; solutions include Snowflake IDs or distributed counters.
Which Big-O complexity describes inserting an element at the beginning of a singly linked list?
Answer: O(1)
Inserting at the head of a singly linked list requires only updating the head pointer and the new node's next pointer, both constant-time operations.
Which of the following sorting algorithms has the best average-case time complexity?
Answer: Merge Sort
While Quick Sort often performs very well in practice with an average-case time complexity of O(n log n), its worst-case complexity is O(n^2). Merge Sort, on the other hand, consistently maintains an O(n log n) time complexity in its best, average, and worst-case scenarios. This makes Merge Sort a more reliably efficient choice for its average-case performance compared to the other options listed.
Which of the following is a fundamental prerequisite for the Binary Search algorithm to function correctly?
Answer: The array must be sorted.
The core principle of Binary Search relies on dividing the search space in half based on comparing the target value to the middle element. This process only works if the array is sorted, allowing the algorithm to correctly discard one half of the elements in each step.
You are developing a feature for a music streaming service that requires frequently checking if a specific song ID (an integer) exists in a user's large playlist of several thousand songs. The most important consideration is minimizing the time it takes to perform this existence check. Which data structure is the most efficient choice for storing the song IDs?
Answer: A hash set
A hash set provides average O(1) time complexity for search, insertion, and deletion operations. This is significantly faster than a sorted array (O(log n) for search), a linked list (O(n) for search), and a queue (O(n) for search), making it the ideal choice for frequent existence checks in a large dataset.
A linked list is generally preferred over an array when:
Answer: Frequent insertions and deletions at arbitrary positions are required
Linked lists allow O(1) insertion/deletion at a known node without shifting elements, unlike arrays which require O(n) shifting.
To find the single non-repeating element in an array where every other element appears exactly twice, which operation is applied across all elements?
Answer: XOR all elements
XOR of any number with itself is 0, so paired elements cancel out and the unique element remains.
What is Big O notation?
Answer: A mathematical notation describing the upper bound of an algorithms time or space complexity
Big O describes the worst-case growth rate of an algorithm as input size increases.
You are tasked with sorting a list of customer objects based on their purchase date. If two customers have the same purchase date, their original relative order must be preserved. Which of the following sorting algorithms is most suitable for this requirement?
Answer: Merge Sort
The requirement to preserve the relative order of elements with equal keys means a stable sorting algorithm is needed. Among the choices, Merge Sort is a stable algorithm. Heap Sort, Quick Sort, and Selection Sort are all unstable sorting algorithms and do not guarantee that the original order of equal elements will be maintained.
In Git, what does a 'detached HEAD' state mean?
Answer: The HEAD pointer references a specific commit rather than a branch
Detached HEAD means HEAD points directly to a commit SHA instead of a named branch ref, so new commits won't belong to any branch.
A CDN serves static assets globally. A user in Tokyo requests an asset cached in Singapore. What metric describes the extra delay from that geographic distance?
Answer: Network latency (propagation delay)
Propagation delay is the time signal takes to travel the physical distance between nodes, which is a fundamental latency floor.
What does `O(1)` space complexity mean for an algorithm?
Answer: The algorithm's memory usage doesn't grow with input size
O(1) space means the amount of extra memory used remains constant regardless of how large the input is.
What is the time complexity of accessing an element by index in a dynamic array (like Python's list)?
Answer: O(1)
Dynamic arrays store elements in contiguous memory, so index-based access is O(1) constant time.
Which statement best describes the difference between composition and inheritance?
Answer: Inheritance models an 'is-a' relationship while composition models a 'has-a' relationship
Inheritance expresses that one type 'is a' subtype of another (Dog is an Animal), while composition expresses that one type 'has a' component of another (Car has an Engine).
Which technique does Shell Sort use to improve upon Insertion Sort?
Answer: It sorts elements far apart first using decreasing gap sequences
Shell Sort moves elements large distances early by using a gap sequence, reducing the number of shifts needed in final passes.
A programmer is working on a memory-constrained embedded system and needs to sort an array of sensor readings in-place. Which of the following sorting algorithms has the best auxiliary space complexity for this task?
Answer: Heap Sort
Heap Sort is an in-place sorting algorithm with a space complexity of O(1), meaning it requires a constant amount of extra memory regardless of the input size. Merge Sort requires O(n) auxiliary space, making it unsuitable for this scenario. Radix and Tim Sort can also have higher space requirements.
Which TCP mechanism prevents a fast sender from overwhelming a slow receiver?
Answer: Flow control via the receive window
TCP flow control uses the receiver-advertised window size (rwnd) to limit how much data the sender can have in-flight at once.
What is the output of `print(3 // 2)` in Python 3?
Answer: 1
The `//` operator performs floor division, rounding down to the nearest integer, so 3 // 2 equals 1.
A matrix is considered 'valid' if each row and each column contains all integers from 1 to N exactly once. What is this structure called?
Answer: Latin square
A Latin square is an N×N array filled with N different symbols, each occurring exactly once in each row and column.
Written and edited by Nathan Beja, founder of Practice Test Geeks, with AI assistance. Exam facts are checked against the official sources linked below. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- support.codesignal.com — Time limit, eligibility, retake policy, score validity, exam format, passing score, score release · verified Nov 2026
- codesignal.com — Test delivery · verified Nov 2026