Wednesday, September 1, 2010

Inmobi Written Test - Incomplete

Hi all

  Finally I have decided to start blogging and for a start I will just post about my experiences in the rat race called Campus Placements .

  Today we had Inmobi on campus . Its a very fast growing mobile ads company . They make use of cutting edge technologies to provide ad services to their client by seamlessly integrating the ads in the mobile internet . With the ever growing pace of smartphones and the new 3G services , this company surely has a bright future .

  They intially presented a slideshow about their company  Inmobi Profile . Then they had a written test for 90 minutes . The paper had four sections .

Section 1
 1. Given a Linked list with a loop , the head pointer and another node . How do u remove the loop .

2. Using the Trie Data structure to implement a small intranet search engine . They asked us to implement a function to add a page to the search space and another function to return an array of strings containing the pages .

3. A problem on using adjacency list to find the minimum number of traffic policemen required for a patrolling traffic on a junction of roads .


4. A function to find loop within a linked list was given . We had to find 2 logical errors in it and give a proper solution.

Section 2 
  Some more problems on programming . To find errors , testcases , output etc etc . I dont remember right now . Will update tomorrow .

Section 3 - Unix
  This was my favourite part of the paper . So I will also give my answers here :)

1. Which of these is not a shell ?
     a. bash    b.tcsh   c.xterm   d.zsh
    Answer : c.xterm  - it is just a terminal emulation for X window System .

2. What is crom ? what are the default fields in crontab ?
       Cron is the job scheduler in unix . We can specify the commands to be run at a particular time and it automatically runs it .
   These details need to be given in the crontab . I don't know the exact fields , but I guess it will atleast have 2 fields - the command to be run and the time .

3. Why do we give #/bin/sh at the beginning of shell scripts even though we know that # means that the line is a comment  ?
   This is used to specify the interpreter which the shell must use to run the script. It tells the path from where the interpreter needs to be invoked .
Ex : #!/bin/sh - invokes bash     #!/bin/ksh -invokes korn shell 

4. What is the output of the following in perl - $a = 2 ; $b=3 ; $x = "$a.$b" ; print $x; ?  
      I completely screwed this up :(  In perl dot is used as a concatentation operator but since it is used within double quotes the answer is 2.3 .

5.  What is inode ? What is its importance ?

6. What is pipe ? How is it used ?


7. What is the difference between the following  "tail -30f myfile.txt " , "tail -f myfile.txt " and "tail -30 myfile.txt " ?


8.What are Sticky bits ? How are they used ?


9 . Suppose U log in to a unix system , how can u print ur username ?
     a. who am i          b. id             c. whoami            d.all do the same
     I wrote  c. whoami  because of the following
     
umesh@ubuntu:~$ who am i
umesh    pts/4        2010-09-01 23:37 (:0.0)
umesh@ubuntu:~$ whoami
umesh
umesh@ubuntu:~$ id
uid=1000(umesh) gid=1000(umesh) groups=4(adm),20(dialout),24(cdrom),46(plugdev),104(fuse),105(lpadmin),119(admin),122(sambashare),1000(umesh)




10 . What is the difference between the following :  date;who >MyLogFile  and (date;who)>MyLogFile ?
  


To be continued after i recall 

Section 4  - Puzzles 

1. Some simple question on father,son,daughter,brother relations kind of question 
2. Questions on probability 

          .
          .
          .

10 . Function to check if a number is power of 2 without using modulus operator % ?













Friday, August 7, 2009

The Power Of Linux

Reasons Why Everyone Must Try Using Linux
1. It is FREE .
2. It is preconfigured with the basic softwares required by a common man.
3. Its interface is very aesthetic.
4. Linux has a very minimal number of viruses.
5. It is a wonderful experience installing it (WARNING:If u don't follow some simple guidelines u may lose all data on your hard disk and also your favourite OS)
6. It can help you get rid of viruses infected on your favourite OS.
7. Linux doesn't need file extensions to recognize filetypes.
8. It does not irritate you with 'genuine advantage' messages.
9. Best of all -- It is very programmer friendly and helps you to develop your own softwares,
10. If u install a wonderful software called WINE , u would even be able to install the softwares developed for your favourite OS.