how to create a new node of a content type when a new node created of another content type?
As said by @drupality

function hook_node_insert($node) {
 if ($node-&gt;type != 'job_posting') {
   return;
 }
$node = new stdClass(); // Create a new node object
$node-&gt;type = "test";
node_object_prepare($node); // Set some default values

$node-&gt;title    = "YOUR title";
$node-&gt;language = LANGUAGE_NONE; // Or e.g. 'en' if locale is enabled

$node-&gt;uid = 1; // UID of the author of the node; or use $node-&gt;name

.
.
.//Enter your other field values
.
node_save($node);  
}