Tip 1 : Be very clear with your project explanation and don't copy others project .
Tip 2 : Also try to cover all the cs core subjects explanation clearly.
Tip 1 : Make it clean with appropriate knowledge.
Tip 2 : Provide true information and avoid telling lie in which You are not sure.
It was morning time and from 9:00 am . It happened via the google meet online process and it was very smooth onboarding . Interviewer was very friendly kind of nature .



For the given binary search tree and k = 3

The 3rd smallest node is highlighted in yellow colour.
// A simple inorder traversal based Java program
// to find k-th smallest element in a BST.
import java.io.*;
// A BST node
class Node {
int data;
Node left, right;
Node(int x)
{
data = x;
left = right = null;
}
}
class GFG {
static int count = 0;
// Recursive function to insert an key into BST
public static Node insert(Node root, int x)
{
if (root == null)
return new Node(x);
if (x < root.data)
root.left = insert(root.left, x);
else if (x > root.data)
root.right = insert(root.right, x);
return root;
}
// Function to find k'th largest element in BST
// Here count denotes the number of nodes processed so far
public static Node kthSmallest(Node root, int k)
{
// base case
if (root == null)
return null;
// search in left subtree
Node left = kthSmallest(root.left, k);
// if k'th smallest is found in left subtree, return it
if (left != null)
return left;
// if current element is k'th smallest, return it
count++;
if (count == k)
return root;
// else search in right subtree
return kthSmallest(root.right, k);
}
// Function to find k'th largest element in BST
public static void printKthSmallest(Node root, int k)
{
Node res = kthSmallest(root, k);
if (res == null)
System.out.println("There are less than k nodes in the BST");
else
System.out.println("K-th Smallest Element is " + res.data);
}
public static void main(String[] args)
{
Node root = null;
int keys[] = { 20, 8, 22, 4, 12, 10, 14 };
for (int x : keys)
root = insert(root, x);
int k = 3;
printKthSmallest(root, k);
}
}
It was again the morning session and the interviewer was very supportive in nature and gave me the hint too to think the approach and finally i came up the solution which he was expecting.Went very well.




// Java program to check if
// linked list is circular
import java.util.*;
class GFG {
/* Link list Node */
static class Node {
int data;
Node next;
}
/*This function returns true if given linked
list is circular, else false. */
static boolean isCircular(Node head)
{
// An empty linked list is circular
if (head == null)
return true;
// Next of head
Node node = head.next;
// This loop would stop in both cases (1) If
// Circular (2) Not circular
while (node != null && node != head)
node = node.next;
// If loop stopped because of circular
// condition
return (node == head);
}
// Utility function to create a new node.
static Node newNode(int data)
{
Node temp = new Node();
temp.data = data;
temp.next = null;
return temp;
}
/* Driver code*/
public static void main(String args[])
{
/* Start with the empty list */
Node head = newNode(1);
head.next = newNode(2);
head.next.next = newNode(3);
head.next.next.next = newNode(4);
System.out.print(isCircular(head) ? "Yes\n"
: "No\n");
// Making linked list circular
head.next.next.next.next = head;
System.out.print(isCircular(head) ? "Yes\n"
: "No\n");
}
}
i passed this round because I answered very well in first two round and also i was very good in communication kind off.
Ques: What is thread in OS?
Ans: Thread is a path of execution that is composed of a program counter, thread id, stack, and set of registers within the process. It is a basic unit of CPU utilization that makes communication more effective and efficient, enables utilization of multiprocessor architectures to a greater scale and greater efficiency, and reduces the time required in context switching. It simply provides a way to improve and increase the performance of applications through parallelism. Threads are sometimes called lightweight processes because they have their own stack but can access shared data.

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?