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.
Hey geek! It's time to become a success story instead of reading them. Check out our most renowned DSA Self Paced Course, now at a student-friendly price and become industry ready. And if you are looking for a more complete interview preparation resource, check out Complete Interview Preparation Course that will prepare you for the SDE role of your dreams!
Feeling prepared enough for your interview? Test your skills with our Test Series that will help you prepare for top companies like Amazon, Microsoft, TCS, Wipro, Google and many more!
2. WAF to print all prime numbers in the range of N to M
3. WAF to search a string (might contain spaces) in another string and replace all occurances with a new string
a) Buffer space should not be used.
b) String should be replaced in place.
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.
II. F2F Interview
1. Questions on the projects done.