Tip 1: Focus primarily on DSA and problem-solving.
Tip 2: Improve your development skill set.
Tip 3: Gain good knowledge of core subjects.
Tip 1: Make it formal and professional.
Tip 2: Avoid any grammatical mistakes or errors.
Tip 3: Check your ATS score.
The round consisted of coding and MCQs.




Spiral matrix printing involves traversing a matrix in a clockwise spiral order by maintaining four boundaries: top, bottom, left, and right. Initially, these boundaries represent the outer edges of the matrix. The traversal starts by moving from left to right across the top row, then from top to bottom along the right column, followed by right to left across the bottom row, and finally from bottom to top along the left column. After completing one full layer, the boundaries are adjusted inward (top++, bottom--, left++, right--) to move to the next inner layer. This process continues until all elements are covered, ensuring that conditions are checked before traversing the bottom row and left column to avoid duplicates in cases of single rows or columns.



You do not need to print anything, just return the head of the reversed linked list.
Reversing a linked list involves changing the direction of the next pointers so that each node points to its previous node instead of the next one. The idea is to traverse the list once while keeping track of three pointers: prev (initially NULL), curr (starting at the head), and next (to temporarily store the next node).
At each step, you store curr->next in next, then reverse the link by pointing curr->next to prev. After that, move prev to curr and curr to next. This process continues until curr becomes NULL. At the end, prev will be the new head of the reversed linked list.
This approach works in O(n) time and uses O(1) extra space.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which data structure is used to implement a DFS?