Tip 1: Be consistent with your DSA practice. Even solving 2 questions daily makes a huge difference over time.
Tip 2: Revise core CS subjects regularly, as they form the foundation of most interviews.
Tip 3: Focus on quality over quantity — understand the logic behind each problem instead of simply memorizing solutions.
Tip 1: Keep your resume concise and highlight only the most relevant projects, internships, and achievements.
Tip 2: Be honest and ready to explain every single point mentioned. Interviewers often pick questions directly from your resume.
The first interview was conducted during the daytime and lasted around 45 minutes. The environment was quite comfortable and professional, and the interviewer was very calm and encouraging throughout the process. The discussion mainly revolved around core OOPs concepts such as copy constructor, virtual functions, runtime polymorphism, and the difference between deep copy and shallow copy. I was also asked to share my screen and write code to demonstrate these concepts, including a recursive function to reverse a linked list. Overall, the interviewer focused more on understanding my thought process and clarity of fundamentals rather than just the final answer.
Tip 1: Have complete conceptual clarity of OOPs pillars: Encapsulation, Inheritance, Polymorphism, and Abstraction — along with practical examples.
Tip 2: Practice writing small code snippets for concepts like virtual functions, constructor overloading, and deep copy vs shallow copy so you can explain them confidently.
Tip 3: Don’t just memorize definitions. Focus on how and when each concept is used in real-world scenarios.



The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Can you solve this problem in O(N) time and O(1) space complexity?
Step 1: Restate and choose approach
Goal: reverse links so each node points to its previous node.
Constraint: must use recursion → think in terms of solving for the sublist and then fixing one pointer.
Step 2: Identify base cases
If head == null (empty list) → return null.
If head->next == null (single node) → already reversed; return head.
Step 3: Recurse on the smaller subproblem
Let newHead = reverse(head->next) which reverses the sublist starting at head->next.
Step 4: Fix the current node’s pointers (the crux)
After recursion returns, head->next points to the last node of the reversed sublist.
Set head->next->next = head to link current node to the tail of reversed sublist.
Set head->next = null to terminate the list correctly.
Step 5: Return the new head
newHead is the head of the fully reversed list; return it up the call stack.
Step 6: Complexity
Time: O(N) — each node visited once.
Space: O(N) call stack due to recursion (no extra heap structures).
The second interview was conducted in the afternoon and lasted for around 45–50 minutes. The environment was calm and conversational, and the interviewer made sure I was comfortable before starting. The discussion again focused mainly on OOPs concepts and C++ fundamentals. I was also asked a coding question to detect a cycle in a linked list, for which I explained the hare and tortoise approach (Floyd’s Cycle Detection Algorithm). After that, the interviewer asked an interesting puzzle related to measuring 45 minutes using two ropes that burn unevenly. Overall, the interviewer was friendly, encouraging, and seemed more interested in understanding my logical thinking and problem-solving approach rather than just the final answer.
Tip 1: Understand the four pillars of OOPs (Encapsulation, Inheritance, Polymorphism, Abstraction) with examples — don’t just memorize them.
Tip 2: Practice writing small snippets of C++ code to demonstrate concepts like virtual functions, constructor chaining, and function overriding.
Tip 3: Be prepared to differentiate between similar concepts like compile-time vs runtime polymorphism, deep vs shallow copy, and abstract class vs interface.



In the given linked list, there is a cycle, hence we return true.

Step 1: Brute idea (hashing) — works but extra space
Traverse the list, store each node’s address in a hash set.
If you ever see a node that’s already in the set → cycle found.
Time: O(N), Space: O(N).
Interviewer asked to optimize space.
Step 2: Optimize to O(1) space (Floyd’s Hare & Tortoise)
Use two pointers: slow moves 1 step, fast moves 2 steps.
If there’s a cycle, they will meet; if fast or fast->next becomes NULL, no cycle.
Time: O(N), Space: O(1).
Step 3 (Follow-up): Find the cycle’s starting node
After slow and fast meet inside the cycle, reset one pointer to head.
Move both one step at a time; the node where they meet again is the cycle start.
Return that node (or its value), depending on the function signature.
Step 4: Complexity & reasoning
Time: O(N) — each pointer traverses at most ~N+K steps.
Space: O(1) — only pointers used.
Why it works: meeting point proves a loop (relative speed difference is 1), and the reset trick aligns distances to the loop entry.
The interviewer asked a puzzle — "You have two ropes, each of which takes exactly 60 minutes to burn completely, but they burn at a non-uniform rate. Using these two ropes and a lighter, how will you measure exactly 45 minutes?" (Learn)
Tip 1: Think logically and visualize the problem. Focus on the non-uniform burning condition; you can’t assume half the rope burns in 30 minutes.
Tip 2: The key trick:
Light Rope 1 from both ends and Rope 2 from one end at the same time.
Rope 1 will burn out in 30 minutes (since lighting both ends doubles the burning rate).
As soon as Rope 1 finishes, light the other end of Rope 2. Now Rope 2 will burn in 15 minutes (half of 30, since both ends are burning).
Total = 30 + 15 = 45 minutes.
Tip 3: Always explain your reasoning clearly step by step, not just the final answer; interviewers look for your approach and thought process more than the end result.

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