# Direct PhD Interview Experience IIT Madras (July 2020)

Interview date: 23-07-2020

Round 1(written): Wasn’t conducted due to ongoing pandemic.

Round 2(Interview): duration of the interview was about 1 hour.

I was told that they will first ask some programming questions and then move to subjects which I was asked to select before the interview. The subjects were Data Structures and Database Systems.

Programming:

I: Write a program to find the largest element in a linked list?

M: They told to check some conditions. Initially, in line number 9, I wrote some mistake which I corrected later.

#include<bits/stdc++.h>
using namespace std;
int findMax(struct node *ptr){
if(ptr == NULL)
return -1;
if(ptr->next == NULL)
return ptr->data;
int mx = ptr->data;
while(ptr != NULL){
if(mx < ptr->data)
mx = ptr->data;
ptr = ptr->next;
}
return mx;
}
int main(){
cout << findMax(struct node * start);
return 0;
}  

I: What is full Binary Tree?

M: Got confused with Complete Binary Tree(CBT). I told them a binary tree which is left filled and then changed my answer to a binary tree having all the leaves at the same level. But, they told that a tree in which all internal nodes have 2 children.

Data Structures:

I: Determine a logic or code to determine if a tree if full binary tree or not?

M: We can make a recursive call to the left and right subtree and for each node check if both left and right child is not null. When both the children are null means the terminating condition is reached and it is a full binary tree. Then I wrote a pseudo code.

I: Can you determine the recurrence relation and determine the time complexity?

M: I got a bit confused and told O(logn) thinking of BST. Then they helped with an example and wrote the recurrence relation as

T(n) = 2 * T(n/2) + c

Then applied the master's theorem

a = 2, b = 2, k = 0, p = 0
O(n)

I: If some relative order is given in an unsorted array, how many comparisons are required? He told I am just asking you for the challenge you can think and search after the interview.

M: I told about topological sort and can apply DFS. I also discussed Tournament tree and comparison should be required O(n). But he told you are in the right direction but in this short span, it will difficult to take in the full solution. Have a look after the interview.

Database Systems:

I: Do you know Durability?

M: It is one of the ACID properties. It shows that data in the system remain persistent.

I: How you achieve it. Please be technical.

M: Through creating logs.

I: Do you know the types of logs?

M: I did study but could not recall the types.

I: Why you need and how you achieve durability, consistency, etc.?

M: Check over system failure, local error, disk failure, etc. Periodical checks can be performed.

I: Write a Relational algebra to determine the names of the employee working under the supervision of supervisor ‘Smith’?

M: Pi(names)(Sigma(E1.sid = E2.eid and E2.name = ‘Smith’)(E1xE2)). We could have also used joins.

I: In DBMS whose responsibility to determine the consistency?

M: It is the responsibility of the database system to check the consistency.

I: Who is responsible for Isolation?

M: Database Manager so that interleaved execution can be omitted.

I: Any questions?

M: If selected how the labs will be allotted (AIDB, RISE labs)?

I: After selection, you will be asked your choice and depending on the professor. Any more question?

M: No.

I: You can leave the meeting and thank you.

M: Thank you, sir.

7
Like
0
Love
0
Haha
0
Wow
0
Angry
0