Tip 1: Strengthen your DSA.
Tip 2: Practice SQL queries regularly.
Tip 3: Revise core computer science fundamentals.
It was not dependent on Resume because it was on-campus.
It started at 11 AM. I was quiet confident because I was prepared. There were 20 MCQs based on aptitude and two coding problems.
You are given two integer values, a and b. The task is to find the smallest non-negative integers x and y such that the updated values a + x and b + y satisfy the condition:
(b + y) is completely divisible by (a + x).
Additionally, the sum x + y should be minimized.
Iterate over possible increments for x starting from 0.
For each x, compute a' = a + x.
Check the remainder r = b % a'.
If r == 0, then x + y = x (since y = 0) — this is optimal.
Otherwise, calculate y = a' - (b % a') to make b + y divisible by a'.
Keep track of the minimum value of x + y and the corresponding pair (x, y).
Return the pair with the smallest sum x + y.



Given an array of integers, for each element, find the next greater element to its right in the array. The next greater element for an element x is the first element greater than x that appears to its right. If no such element exists, return -1 for that position.
Initialize a stack to keep track of elements for which we haven't found the next greater element yet.
Traverse the array from right to left (reverse order).
For each element:
While the stack is not empty and the top of the stack is less than or equal to the current element, pop from the stack.
If the stack is empty after popping, the next greater element is -1.
If not empty, the top of the stack is the next greater element.
Push the current element onto the stack.
Store the result in an output array, and reverse it if needed (based on how you store results).
It started at 3PM. I was little bit nervous but when interview started I became confident. Interviewer was also very helpful,



You are given a weighted, directed (or undirected) graph with n vertices and m edges. Each edge has a non-negative weight. Your task is to find the shortest distance from a given source node to all other nodes in the graph using Dijkstra’s Algorithm.
Initialize distances:
Create a distance array dist[] of size n, initialized with infinity (INF) for all nodes, except the source node which is set to 0.
Use a priority queue (min-heap):
Push the source node into the heap with distance 0.
Process the queue:
While the priority queue is not empty:
Pop the node with the smallest distance.
For each neighbor of this node:
If dist[u] + weight < dist[v], update dist[v] and push (dist[v], v) into the heap.
Repeat until all reachable nodes are visited.
Return the dist[] array containing the shortest distances from the source.
You are given an array of integers. Your task is to find the first repetitive element in the array, i.e., the first element that appears more than once. If no element is repeated, return -1.
Initialize an empty set.
Traverse the array:
If the element is already in the set, return it (first repetitive element).
If not, add it to the set.
If no element repeats, return -1.
Write a SQL query to find the second highest salary from the Employee table. If there is no second highest salary, return NULL. (Practice)
Tip 1: Use DISTINCT: Select distinct salaries to eliminate duplicates.
Tip 2: Use LIMIT or ROW_NUMBER(): For SQL, use LIMIT with ORDER BY for a simple approach, or use ROW_NUMBER() to rank salaries and select the second highest.
Tip 3: Handle NULLs: Ensure that if no second distinct salary exists, return NULL.
You are given a table called Employee with the following columns:
id (integer) — represents the employee's ID.
name (string) — represents the employee's name.
salary (integer) — represents the employee's salary.
Write an SQL query to find the names of employees whose name starts with the letter 's'.
Tip 1: Use the LIKE operator: WHERE name LIKE 'S%' to filter names starting with 'S'.
Tip 2: Ensure case insensitivity: use UPPER(name) or LOWER(name) to handle different cases.
Tip 3: Optimize the query: If there's a large dataset, ensure proper indexing on the name column for faster querying.
It started at 5PM. I was excited because I had cleared the technical interview.
About Background: Be concise and respectful: Briefly mention parents' occupations and values you've learned from them. Stay relevant: Connect your family background to traits like responsibility, work ethic, or motivation. Stay positive: Highlight support and encouragement without oversharing personal challenges.
About selection process: Be clear and structured: Briefly list the rounds (e.g., aptitude, technical, HR) in order. Highlight your preparation: Mention how you approached each round confidently. Stay honest and concise: Focus on key challenges and how you overcame them without over-explaining.
About leadership skills: Give a real example: Share a situation where you led a team or took initiative. Highlight key traits: Emphasize communication, decision-making, and teamwork. Show impact: Mention the positive outcome or what the team achieved under your leadership.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?