Tip 1: Focus on mastering data structures and algorithms through consistent problem-solving.
Tip 2: Build projects to apply your learning and strengthen your understanding of real-world scenarios.
Tip 1: Highlight relevant projects and technical skills to showcase your hands-on experience.
Tip 2: Keep your resume concise, focusing on key achievements and measurable outcomes.
Timing: The interview was scheduled in the afternoon, with one round in the evening, which was manageable.
Environment: The virtual setup was smooth, and the atmosphere was professional and comfortable.
Significant Activity: A live coding session and a system design discussion were key activities, testing both problem-solving and communication skills.
Interviewer: The interviewer was friendly, patient, and gave constructive feedback, making the experience positive and encouraging.



Given an array A[] of size N where each element represents the cost to reach that index, and you're allowed to jump at most K indices forward at any point. Your goal is to find the minimum cost to reach the last index (index N-1) starting from the first index (index 0).
You can only move forward and you must minimize the total cost of jumps to reach the end. You are allowed to skip indices, but the goal is to find the minimum total cost path.
Step 1: I first analyzed the problem and recognized that it is a variation of the "minimum cost path" problem with a constraint on how far you can jump (a maximum of K indices). The brute force approach would involve exploring all possible paths, but this would be inefficient.
Step 2: I implemented a dynamic programming (DP) approach. I created a DP array dp[] where each entry dp[i] represents the minimum cost to reach index i. The key observation was that, for each index i, the minimum cost to reach i would depend on the minimum cost to reach any of the previous indices within the jump limit K (i.e., indices i-1, i-2, ..., i-K).
Step 3: The recurrence relation is:
dp[i] = A[i] + min(dp[j] for j in range(i-K, i) if j >= 0)
This step ensures that the cost to reach index i is the minimum cost from any of the previous K indices plus the cost at index i.
Step 4: I initialized the base case, dp[0] = A[0], as the starting point has no previous cost. Then, I iterated over the array to fill the dp[] array based on the recurrence relation.
Step 5: Finally, I returned the value at dp[N-1], which gives the minimum cost to reach the last index.
What are semaphores? (Learn)
Semaphores are synchronization primitives used to control access to a common resource in a concurrent system like multitasking or multi-threading. A semaphore uses two main operations:
Wait (P): Decrements the value of the semaphore.
Signal (V): Increments the value of the semaphore.
Semaphores can be used for process synchronization and mutual exclusion. There are two types:
Binary Semaphore (also known as Mutex): Can only take values 0 or 1.
Counting Semaphore: Can take any integer value, useful for managing access to a resource pool.
What is virtual memory? (Learn)
Virtual memory is a memory management technique that provides an "idealized abstraction of the storage resources" that are actually available on a given machine, thus allowing programs to access more memory than physically available in RAM. It uses a combination of hardware (like a Memory Management Unit) and software to enable efficient memory usage by swapping data between RAM and disk storage.
Tip 1: Read Galvin for OS thoroughly: It provides in-depth explanations and examples for key concepts like semaphores, memory management, and other OS fundamentals. This textbook is essential for grasping operating system theory.
Tip 2: Understand how semaphores work in different scenarios: Practice using semaphores in multi-threading and inter-process communication problems. Focus on different use cases like producer-consumer, reader-writer problems, and resource allocation.
Tip 3: Practice OS concepts with real-world problems: Solve problems related to deadlocks, resource allocation, memory management, and process synchronization. This will improve your ability to apply theoretical knowledge in practical scenarios and interviews.
Tip 1: IPC allows processes to exchange data and synchronize their execution, using OS-provided primitives like semaphores and mutexes to ensure controlled access to shared resources.
Tip 2: Scheduling determines which process or thread gets to use the CPU at any given time, using algorithms like Round Robin, FCFS, and Priority Scheduling.
Tip 3:Memory management involves allocating and managing the computer’s memory resources, utilizing techniques like paging, segmentation, and virtual memory.



Given a list of integers, generate a random function to shuffle the list in-place without using extra space. The goal is to produce a random permutation of the list, and you must achieve this without allocating additional memory.
Constraints:
The list will contain N integers.
The random permutation must be unbiased, meaning that each permutation has an equal probability of being chosen.
Do not use extra space (except for a constant number of variables).
You can refer to Fisher-Yates Shuffle for a detailed explanation of the algorithm
.Step 1:
I first looked at the problem's requirements, which involved generating a random permutation in-place without using additional space. I realized the Fisher-Yates (or Knuth) shuffle algorithm was a perfect fit. This algorithm guarantees a uniform distribution of permutations.
Step 2:
The Fisher-Yates algorithm works by iterating through the array from the last element to the second element. At each step, it selects a random index between 0 and the current index and swaps the two elements. This ensures that every element has an equal chance of being placed in any position.
Step 3:
I implemented the Fisher-Yates algorithm:
I started by iterating from the last index to the second index.
For each element, I generated a random index between 0 and the current index.
Then I swapped the current element with the randomly chosen element.
This process is repeated until the entire array has been shuffled.
Step 4:
Finally, I tested the solution by running it multiple times to ensure the array is shuffled randomly and uniformly without using any extra space.

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