Tip 1 : Practice Data Structure questions as much as you can. Also, be confident during the interview about your solution. For practice, you can prefer Coding Ninjas and Geeks For Geeks.
Tip 2 : Read About Previously asked questions by the company
Tip 1 : Keep it short. Mention the academic and professional projects you've done. Add your educational details properly with the percentage or CGPA obtained.
Tip 2 : Only write those things in the resume which you are confident of and keep practicing.
This round was conducted on Google Meet and was taken by a Senior engineer at MagicPin. This round had 2 DSA questions followed by some SQL queries.



You may make as many transactions as you want but can not have more than one transaction at a time i.e, if you have the stock, you need to sell it first, and then only you can buy it again.
We buy the stock on the day with least local rate and sell it when we find a peak that is raise in prices again. i.e; we just need to find the next greater element and subtract it from the current element so that the difference keeps increasing and so does the profit.
If the sequence is decreasing sequence then, no profit can be made because no matter on which day we buy the stock, we would have to sell it incurring a loss. So then we don't buy and make '0' profit rather than negative.



1. Buying a stock and then selling it is called one transaction.
2. You are not allowed to do multiple transactions at the same time. This means you have to sell the stock before buying it again.
Input: ‘n’ = 7, ‘prices’ = [3, 3, 5, 0, 3, 1, 4].
Output: 6
Explanation:
The maximum profit can be earned by:
Transaction 1: Buying the stock on day 4 (price 0) and then selling it on day 5 (price 3).
Transaction 2: Buying the stock on day 6 (price 1) and then selling it on day 6 (price 4).
Total profit earned will be (3 - 0) + ( 4 - 1) = 6.
First assume that we have no money, so buy1 means that we have to borrow money from others, we want to borrow less so that we have to make our balance as max as we can(because this is negative).
sell1 means we decide to sell the stock, after selling it we have price[i] money and we have to give back the money we owed, so we have price[i] - |buy1| = prices[i ] + buy1, we want to make this max.
buy2 means we want to buy another stock, we already have sell1 money, so after buying stock2 we have buy2 = sell1 - price[i] money left, we want more money left, so we make it max
sell2 means we want to sell stock2, we can have price[i] money after selling it, and we have buy2 money left before, so sell2 = buy2 + prices[i], we make this max.
So sell2 is the most money we can have.
Asked to Design an employee table by thinking of the possible fields and keys myself and was asked the following queries
1) How to fetch monthly Salary of Employee if annual salary is given
2) How to get 3 Highest salaries records from Employee table?
Tip 1 : Tell the interviewer about the thought process.
Tip 2 : study previous questions. you can use different online platforms for that
This round was conducted on Google Meet and was more of a Discussion round. Questions on my Resume, Projects and past internships were asked followed by 2 DSA questions



str = "ababc"
The longest palindromic substring of "ababc" is "aba", since "aba" is a palindrome and it is the longest substring of length 3 which is a palindrome.
There is another palindromic substring of length 3 is "bab". Since starting index of "aba" is less than "bab", so "aba" is the answer.
Maintain a boolean table[n][n] that is filled in bottom up manner.
The value of table[i][j] is true, if the substring is palindrome, otherwise false.
To calculate table[i][j], check the value of table[i+1][j-1], if the value is true and str[i] is same as str[j], then we make table[i][j] true.
Otherwise, the value of table[i][j] is made false.
We have to fill table previously for substring of length = 1 and length =2 because
as we are finding , if table[i+1][j-1] is true or false , so in case of
(i) length == 1 , lets say i=2 , j=2 and i+1,j-1 doesn’t lies between [i , j]
(ii) length == 2 ,lets say i=2 , j=3 and i+1,j-1 again doesn’t lies between [i , j].



If N = 2 and prerequisite = [[1, 2]]. Then, there are a total of 2 courses you need to take. To take course 1 you need to finish course 2. So, it is possible to complete all courses.
This problem is equivalent to detecting a cycle in the directed graph represented by prerequisites. Both BFS and DFS can be used to solve it using the idea of topological sort. Since pair is inconvenient for implementing graph algorithms, we first transform it to the adjacency-list representation. If course u is a prerequisite of course v, then the adjacency list of u will contain v.
This is not a typical HR round, it is more like a discussion.
Why do you want to join MagicPin?
Discussion about Compensation
You will have to relocate, are you comfortable in relocation?
Tip 1 : Prepare for Basic HR questions
Tip 2 : Stay Honest
Tip 3 : Be confident

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