Open In App

Lynk Logistics Interview Experience | Senior Software Engineer

Last Updated : 21 Jan, 2020
Improve
Improve
Like Article
Like
Save
Share
Report


Totally there are 3 rounds. But I didn’t clear the first round.

Round1
Its a 2hours online coding test. They have there own ide to take the online test.
Compiler is not user-friendly so be cautions before moving to the next problem. Once you submit you can’t edit your code. Without submitting if you navigate to next problem all your code which you typed will be cleared

Question 1: Find unique N Length Strings from Given String of Length K

Question 2: Gaben’s love

Gaben wants to spread his love for games to poor children in a rural village.
He bought n gaming consoles with him and wants to distribute one console to each child.
Each console contains a number of games.
He wants to ensure that all children get equal or almost equal number of games.
Though he prefers to give consoles with high number of games. This is called as Gaben’s love.
We need to find the maximum Gaben’s love for a given input.
For example, he brings n = 5 consoles where the number of games is g = [5, 4, 4, 8, 6].
There are c=3 children. The minimum difference between all consoles can be had with {5, 4, 4} from indices {0, 1, 2}.
We must get the difference in the following pairs: [{0, 1}, {0, 2}, {1, 2}]. We calculate Gaben’s love as:
index games mapping difference result
0 5 (0, 1), (0, 2) |5-4| + |5-4| 2
1 4 (1, 2) |4-4| 0
2 4

Total = 2
Gaben’s love = 100 – (2/(5+4+4))*100
= 100 – 15.38
= 84.62
= cieling(84.62) = 85
Please get the ceiling value of the resulting float.

If there are c=4 kids then:
Consoles to be selected are {5, 4, 4, 6} from indices {0, 1, 2, 4}. We must get the difference of the following pairs:
index games mapping difference result
0 5 (0, 1), (0, 2), (0, 4) |5-4| + |5-4| + |5-6| 3
1 4 (1, 2), (1, 4) |4-4| + |4-6| 2
2 4 (2, 4) |4-6| 2
4 6

n = 7
Gaben’s love = 100 – (7/(5+4+4+6))*100
= 100 – 36.84
= 63.16
= cieling(63.16) = 64
Please get the ceiling value of the resulting float.

Input:
First line is the number of consoles Gaben has n
Provide the number of games in each console
Lastly give the number of children c
Sample:
Input:
5
5
4
4
8
6
3
Output:
85

Question 3:

Coin change problem with finite number of coins available

https://www.careercup.com/question?id=5692261441470464

Input : 
int[] notes = {100, 200, 500, 2000};
int[] count = {11, 14, 33, 100};
int sum = 500;

Output :
100|200|500|2000 
5, 0, 0, 0
3, 1, 0, 0
1, 2, 0, 0
0, 0, 1, 0

Question 4:

The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive or dead, (or populated and unpopulated, respectively). Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

1. Any live cell with fewer than two live neighbours dies, as if by underpopulation.

2. Any live cell with two or three live neighbours lives on to the next generation.

3. Any live cell with more than three live neighbours dies, as if by overpopulation.

4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed; births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick. Each generation is a pure function of the preceding one. The rules continue to be applied repeatedly to create further generations.

Inputs:

Universe is represented as 2 dimensional array

1. size m of the universe

2. size n of the universe

3. Number of generations to run

4. Number of live cells at the start

5. List of co-ordinates (x, y) of the live cells.

Input

5

5

4

3

2, 1

2, 2

2, 3

Result

0 0 0 0 0

0 0 0 0 0

0 1 1 1 0

0 0 0 0 0

0 0 0 0 0


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads