Check our public questions below
Solve questions to get feedback or
take a practice test and get a free certificate.
The Python Algorithms online test assesses candidates' algorithmic-thinking skills and their ability to implement algorithms using Python.
It's an ideal test for pre-employment screening. A good developer will be able to design and implement algorithms that are both correct and efficient. Computational complexity is important not only when scaling applications but when creating responsive, maintainable, and efficient code.
This online test requires candidates to analyze or design an algorithm using Python as the programming language.
Binary search tree (BST) is a binary tree where the value of each node is larger or equal to the values in all the nodes in that node's left subtree and is smaller than the values in all the nodes in that node's right subtree.
Write a function that, efficiently with respect to time used, checks if a given binary search tree contains a given value.
For example, for the following tree:
Call to contains(n2, 3) should return True since a tree with root at n2 contains number 3.
A playlist is considered a repeating playlist if any of the songs contain a reference to a previous song in the playlist. Otherwise, the playlist will end with the last song which points to None.
Implement a function is_repeating_playlist that, efficiently with respect to time used, returns true if a playlist is repeating or false if it is not.
For example, the following code prints "True" as both songs point to each other.
first = Song("Hello") second = Song("Eye of the tiger") first.next_song(second) second.next_song(first) print(first.is_repeating_playlist())
Write a function that, when passed a list and a target sum, returns, efficiently with respect to time used, two distinct zero-based indices of any two of the numbers, whose sum is equal to the target sum. If there are no two numbers, the function should return None.
For example, find_two_sum([3, 1, 5, 7, 5, 9], 10) should return a single tuple containing any of the following pairs of indices:
Implement function count_numbers that accepts a sorted list of unique integers and, efficiently with respect to time used, counts the number of list elements that are less than the parameter less_than.
For example, count_numbers([1, 3, 5, 7], 4) should return 2 because there are two list elements less than 4.
A TrainComposition is built by attaching and detaching wagons from the left and the right sides, efficiently with respect to time used.
For example, if we start by attaching wagon 7 from the left followed by attaching wagon 13, again from the left, we get a composition of two wagons (13 and 7 from left to right). Now the first wagon that can be detached from the right is 7 and the first that can be detached from the left is 13.
Implement a TrainComposition that models this problem.
As a part of the route planner, the route_exists method is used as a quick filter if the destination is reachable, before using more computationally intensive procedures for finding the optimal route.
The roads on the map are rasterized and produce a matrix of boolean values - True if the road is present or False if it is not. The roads in the matrix are connected only if the road is immediately left, right, below or above it.
Finish the route_exists method so that it returns True if the destination is reachable or False if it is not. The from_row and from_column parameters are the starting row and column in the map_matrix. The to_row and to_column are the destination row and column in the map_matrix. The map_matrix parameter is the above mentioned matrix produced from the map.
For example, for the given rasterized map, the code below should return True since the destination is reachable:
map_matrix = [ [True, False, False], [True, True, False], [False, True, True] ]; route_exists(0, 0, 2, 2, map_matrix)
Buy TestDome to access premium questions that can't be practiced.
Get money back if you find any premium question answered online.
From web development and database administration to project management and customer support. See all pre-made tests.
Mix questions for different skills or even custom questions in one test. See an example.