Associate – Projects Cognizant Interview Questions

2 What is stored in each of the memory structures- stack and heap, and how are they related to each other?

The stack is a section of memory that stores information about nested method (recursive) calls all the way down to the present program location. It also holds all local variables and heap references defined in the currently running procedures. This structure enables the runtime to return from the method knowing the address from which it was invoked, as well as to remove all local variables when the procedure has been exited. Every thread has a stack of its own.

The heap is a big chunk of memory used for dynamic allocation. When you use the new keyword to create an object, it is allocated on the heap. The reference to this object, on the other hand, is stored on the stack.

1 What is Root Partition in OS?

The root partition is the place where the operating system kernel is located. Other potentially crucial system files that are mounted during boot time are contained in it as well.

2 What is BufferedWriter? What are flush() and close() used for?

BufferedWriter is a temporary data storage source. Its used to make a buffered character output stream with the default output buffer size.

To flush characters from the buffered writer stream to a file, the flush() function of the BufferedWriter class in Java is employed. It ensures that all data items, including the last character, are written to the file.

The close() function of the Java BufferedWriter class flushes the characters from the buffer stream and then closes it. Calling methods like write() and append() after the stream has been closed will generate an error.

Cognizant Coding Questions All Factors Math

The amount of effort you put into preparing for an interview determines how difficult it is. The more you prepare, the easier it will be to pass the interview. All you need to know is the fundamentals of new technologies, programming languages, your projects, and Cognizant. Interviewers are interested in how candidates approach problems, construct their thought process, and display personal qualities such as communication, in addition to technical knowledge (which is vital).

2 What is Exterior Gateway Protocol (EGP)?

The Exterior Gateway Protocol (EGP) is a protocol that allows Internet gateways from the same or separate autonomous systems to share network reach-ability information.

EGP serves three primary purposes:

  • Create a set of neighbors.
  • Keep a check on the neighbors (to see if they are still alive and reachable).
  • Notify the neighbors about the networks that are accessible from their autonomous systems.
  • 1 What is the purpose of a Virtual File System (VFS)?

    An abstract layer on top of a more concrete file system is a virtual file system (VFS) or virtual filesystem switch.

  • The purpose of a VFS is to make it possible for client applications to access various types of concrete file systems in a consistent manner. For example, a VFS can be used to seamlessly access local and network storage devices without the client device recognizing the difference.
  • It can be used to bridge the gap between Windows, traditional Mac OS/macOS, and Unix filesystems, allowing applications to access files on those sorts of local file systems without needing to know what type of file system theyre dealing with.
  • A VFS defines the kernels interface with a certain file system. As a result, adding support for new file system types to the kernel is simple.

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *