Sling Media Interview for 5 year experienced C Developer


I. Written round

1. A program was given which creates node in a linked list and then frees the nodes.
Each node in Linked List contain the following :
a) integer value
b) a char pointer -> memory has been dynamically allocated during creation of new node
c) next pointer
In the free function they were freeing the node without freeing the dynamically allocated char pointer.
Task was to identify this memory leak and correct the code accordingly.

2. WAF to print all prime numbers in the range of N to M
https://www.sanfoundry.com/c-program-prime-numbers-given-range/

3. WAF to search a string (might contain spaces) in another string and replace all occurances with a new string
Conditions :-
a) Buffer space should not be used.
b) String should be replaced in place.
https://www.geeksforgeeks.org/c-program-replace-word-text-another-given-word/

4. Design Air Traffic Control System
a) Landing time required for a plane = 60s
b) Only one run-way is present in airport
c) If run-way is blocked for a flight, return the waiting time and waiting slot number
d) Waiting queue is infinite



5. One thread is incrementing a variable. Another thread is printing the variable.
Synchronise these 2 threads using 2 locks.

T1:
release(L2)
i++
lock(L1)

T2:
release(L1)
printf(“%d”, i);
lock(L2)

II. F2F Interview
1. Questions on the projects done.

Write your Interview Experience or mail it to contribute@geeksforgeeks.org



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.