Drupal 7 create content type programmatically

There are couple ways how to create content type programmatically. We can use hook_update_N() or hook_install()  

$t = get_t();
  // Define the node type.
  $node_example = array(
    'type' => 'node_example',
    'name' => $t('Example Node'),
    'base' => 'node_content',
    'description' => $t('This is an example node type with a few fields.'),
    'body_label' => $t('Example Description')
  );

  // Complete the node type definition by setting any defaults not explicitly
  // declared above.
  // http://api.drupal.org/api/function/node_type_set_defaults/7

  $content_type = node_type_set_defaults($node_example);
  node_add_body_field($content_type);

  // Save the content type
  node_type_save($content_type);

Other way is more proper and it is used in examples module node_example.
above will be given file of one test exercise which were done by my friend. In this example you can see not only node type creation but also creation of sortable table and adding simple pager. You can try to do it by yourself and then if you will understand it you will be ready to some interviews to get work. So good luck!

//Please wrote code!