Professional Documents
Culture Documents
Omnidrone - Coding Test
Omnidrone - Coding Test
OMNIDRONE
Coding Test
Instructions
1. For each problem, copy the code to your IDE
2. Use your IDE to implement the classes, execute as console application, test and debug
3. When you’re done or run out of time, zip all your code files and submit them here.
Picture Composition
Bob has a collection of pictures. He wants to create the most stylish composition with them, so he tries to
arrange them in different orders, by adding and removing pictures to the left or the right of his current
composition.
For example: he starts his collection with picture 1, then he adds picture 2 to the left. His collection now will
look like {2, 1}. Now he can add picture 3 to the right, and will end up with {2, 1, 3}.
https://sites.google.com/omnidrone.net/coding-test/test-13 1/8
8/31/2019 OMNIDRONE - Test 13
using System;
OMNIDRONE
public class PictureComposition
{
public void AttachPictureFromLeft(int pictureId)
{
throw new NotImplementedException("Not implemented yet.");
}
https://sites.google.com/omnidrone.net/coding-test/test-13 2/8
8/31/2019 OMNIDRONE - Test 13
Grid Blocks
OMNIDRONE
We have a Tetris-like grid, with some blocks falling due to gravity. Whenever a cell is empty, the block will fall
down. If a cell is occupied by a block, the blocks above will pile-up.
The state of the grid is represented with a list of strings, where "." represents an empty space and "#"
represents a block.
{"##",
"#.",
".."}
{"..",
"#.",
"##"}
The two blocks on the left will fall down and pile up in the first column. The only block in the right column will
fall down to the bottom.
using System;
if
https://sites.google.com/omnidrone.net/coding-test/test-13 3/8
8/31/2019 OMNIDRONE - Test 13
OMNIDRONE
Step Distance
Joe navigates a map, and moves one step at a time. He's using a compass to decide in which of the 8 direction
he goes: North, NorthEast, East, SouthEast, South, SouthWest, West or NorthWest. For every move i he makes, he
chooses a direction d[i] and a number of steps s[i].
For example, if he moves 1 step North, he'll be exactly 1.0 steps away from where he started.
If he moves 2 steps North, then 1 step East, he'll be approximately at 2.2360679774997898 steps from the
beginning.
https://sites.google.com/omnidrone.net/coding-test/test-13 4/8
8/31/2019 OMNIDRONE - Test 13
OMNIDRONE
https://sites.google.com/omnidrone.net/coding-test/test-13 5/8
8/31/2019 OMNIDRONE - Test 13
using System;
OMNIDRONE
public enum Direction
{
North,
NorthEast,
East,
SouthEast,
South,
SouthWest,
West,
NorthWest
}
https://sites.google.com/omnidrone.net/coding-test/test-13 6/8
8/31/2019 OMNIDRONE - Test 13
Path
OMNIDRONE
Write a function that provides change directory (cd) function for an abstract file system.
For example:
Directory names consist only of English alphabet letters (A-Z and a-z)
https://sites.google.com/omnidrone.net/coding-test/test-13 7/8
8/31/2019 OMNIDRONE - Test 13
using System;
OMNIDRONE
public class Path
{
public string CurrentPath { get; private set; }
Submit your answers. You can submit more than once as long as there's time left.
Submit Answer
https://sites.google.com/omnidrone.net/coding-test/test-13 8/8