This was the coding round which consisted of three coding questions and time limit was of 75 minutes.The platform used was Co-Cubes. 3 questions were asked of 2, 3 and 5 marks respectively with varying difficulty.



Given a positive integer n, round it to nearest whole number having zero as last digit.
Examples:
Input : 4722
Output : 4720
Input : 38
Output : 40
Input : 10
Output: 10
This was very basic question which involved some rounding up mathematics and I solved this question within 10 minutes using some school maths and logic.
Write a function that calculates the day of the week for any particular date in the past or future. A typical application is to calculate the day of the week on which someone was born or some other special event occurred.
This question was already done by earlier so just thought of already built logic and wrote the code, initially few test cases were not passing then I made some changes and all test cases passed.
Given a linked list and two integers M and N. Traverse the linked list such that you retain M nodes then delete next N nodes, continue the same till end of the linked list.
Difficulty Level: Rookie
Examples:
Input:
M = 2, N = 2
Linked List: 1->2->3->4->5->6->7->8
Output:
Linked List: 1->2->5->6
Input:
M = 3, N = 2
Linked List: 1->2->3->4->5->6->7->8->9->10
Output:
Linked List: 1->2->3->6->7->8
Input:
M = 1, N = 1
Linked List: 1->2->3->4->5->6->7->8->9->10
Output:
Linked List: 1->3->5->7->9
This was standard linked list question and I solved it using linked list traversal by changing the pointers only and deleting according to given condition.
This was a written round and we were expected to write fully functional code, without any bugs and errors. Library functions used, if any, had to be explained and if possible, code for that too (not that rigorous). Pseudo code and algorithms were also allowed. All the assumptions made had to be explained as well.
Find the n’th term in Look-and-say (Or Count and Say) Sequence. The look-and-say sequence is the sequence of below integers:
1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, …
n’th term in generated by reading (n-1)’th term.
The first term is "1"
Second term is "11", generated by reading first term as "One 1"
(There is one 1 in previous term)
Third term is "21", generated by reading second term as "Two 1"
Fourth term is "1211", generated by reading third term as "One 2 One 1"
and so on.
Example:
Input: n = 3
Output: 21
Input: n = 5
Output: 111221
I simply checked the sequence and understood the pattern and got it within 10 minutes. I simply use a brute force approach and kind of hashing to count occurrence and explained this properly on paper.
Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548, 60}, the arrangement 6054854654 gives the largest value. And if the given numbers are {1, 34, 3, 98, 9, 76, 45, 4}, then the arrangement 998764543431 gives the largest value.
I used sorting with self made comparator and wrote a properly commented code.
The interviewer was very friendly and started asking me questions by making me comfortable.
Given an absolute path for a file (Unix-style), simplify it. Note that absolute path always begin with ‘/’ ( root directory ), a dot in path represent current directory and double dot represents parent directory.
Examples:
"/a/./" --> means stay at the current directory 'a'
"/a/b/.." --> means jump to the parent directory
from 'b' to 'a'
"////" --> consecutive multiple '/' are a valid
path, they are equivalent to single "/".
Input : /home/
Output : /home
Input : /a/./b/../../c/
Output : /c
Input : /a/..
Output:/
Input : /a/../
Output : /
Input : /../../../../../a
Output : /a
Input : /a/./b/./c/./d/
Output : /a/b/c/d
Input : /a/../.././../../.
Output:/
Input : /a//b//c//////d
Output : /a/b/c/d
I gave him a stack-based approach and he was satisfied with that approach.
Given a polynomial expression, simplify it as efficiently as possible, and sort it in decreasing powers of the variable.
e.g -5x^12 + 6x^10 + 4x^5 + 6x^5 + 3x^3 + 2x^3 + 9 would result to 5x^12 + 6x^10 + 10x^5 + 5x^3 + 9.
I provided him with 3 approaches, one with trees, one with max heap and finally one with Linked lists, considering all the corner cases and continuously optimizing the code with respect to time and space complexity. He seemed happy with my approach.
I explained to him the problem with pseudo code.
This round was focused on resume and projects.
Tell me about all your projects.
Gave him a brief introduction of my projects with tech stack information.
Structures of your projects.
Drawn a neat diagram for that and explained him the structure of the project.
Tell me about your summer intern project.
Gave him all description of the work and challenges that I faced during the internship.
Linear regression.
Explained him very well with a real-life example of a dataset of flats and houses.
This round was basically a mix of HR and creative design round. The interviewer wanted to check whether the candidate can think out-of-the box with regard to any given problem and come up with unique, optimized solutions.
I gave him definition of DBMS which I remembered at that time and explained him ACID properties through the example of ATM transaction.
2 tier and 3 tier architecture of DBMS.
Drawn diagram of both architecture and explained the working of each tier in both architectures.
Schema independence in DBMS.
Explained this with context to 3 tier architecture of DBMS.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?