Git with cygwin and Google code

1. Install cygwin from http://www.cygwin.com/install.html

2. When you get to the Select Packages section, search for ‘git’ and select all the packages under Devel.

3. Click next and finish installing.

4. Once installed, create a file called .netrc in your home folder. Just do vim ~/.netrc to open a new file. Add the following lines in the file:

machine code.google.com
login your.email@gmail.com
password Cf3Xv4nU3sD5
(from Google code source tab of your Google code project)

5. Then, do the following commands in a cygwin terminal:

git config --global user.name "Your Name"
git config --global user.email you@example.com

6. Then, open up the the file .git/config in your repository folder, after you’ve cloned your repository using the command given on Google code (e.g. git clone https://your.email@code.google.com/p/your-project/)

7. It should say something like:

...
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://your.email@code.google.com/p/your-project/
...

Change the url line so it says: url = https://code.google.com/p/your-project/. (Delete your email).

8. And that’s it! Now you can commit changes and push changes to your Google code repository.

Advertisements

How to convert bootable USB into an ISO file

Converting an ISO into a bootable USB or DVD is fairly easy.

The following apply when doing this conversion:

.iso to USB:

Use software like http://www.isotousb.com and the steps are simple.

.iso to DVD: 

Use software like ImgBurn.

What’s less familiar, hence the reason for this blog post, is how to convert a bootable USB to an .iso image file for later re-use.

The instructions for USB to .iso are as follows (for a Windows 7 installation for example):

  1. Install ImgBurn. You can even get a portable version of it, just search for it.
  2. Plug the bootable USB into the computer
  3. Start ImgBurn.
  4. Click on the “Create image file from files / folders” button on the home menu.
  5. In “Sources” browse to the USB drive.
  6. In “Destination” choose where to save the final .iso image.
  7. Go to the “Advanced” tab on the right and then “Bootable Disk”.
  8. Check the box “Make Bootable Image” and then, in the “Boot image” box browse to file “etfsboot.com” that is in the USB stick found in the folder “boot”.
  9. In the field “Developer ID” put “Microsoft Corporation” and enter “07C0” in the “Load Segment” field.
  10. Enter ‘4’ in the ‘Sectors To Load’ field if your etfsboot.com file is 2K is size, enter ‘8’ if it’s 4K. In other words, x = size of etfsboot.com in bytes / 512.
  11. Click “Build” and you’re done!

Interview questions

I’m publishing all the interview questions I’ve had (that I still remember) with tech companies (e.g. Microsoft, Google, Nvidia and others) in no particular order. Hopefully it will help you prepare for your interview and land the job!

1. Determine if an input string is a palindrome.

2. Determine the longest palindrome in a given string (e.g. racecarhellobobmalayalam should return malayalam)

3. How would you test Notepad?

4. Reverse the order of words in a given string. Do it in place as a bonus. Test your function.

5. What do you find most exciting about technology?

6. What is the most disappointing project you’ve worked on?

7. What’s the best project you’ve worked on?

8. Insert a node at the end of a circular singly-linked linked list. (e.g. a->b->c->a with node n becomes a->b->c->n->a). Do it in O(1). Test the function.

9. Why are you applying here? What do you find the most fascinating aspect of this company? What are your future plans?

10.

  • You have 8 identical balls, one of them is heavier than all the rest. Given a scale, determine which one it is. As a bonus, do it in 2 weighings.
  • You have the same scenario, but this time the ball is either heavier or lighter than all the rest (you don’t know which way it is). Determine which one it is in 3 weighings.

11. Given a peer-to-peer architecture, test the system. (Solution should cover a wide variety of scenarios and categories to test).

12. Reverse a singly-linked linked list.

13. Given an array of integers, determine the subarray that gives the largest sum.

14. Given two registers and combination logic in between, determine the clock relationships and slacks.

15. Given the system in 14, assume it has negative setup time slack. How would you make it meet timing? (Assume you can’t touch the logic or change the clock speed)

16. Construct a NAND gate with 2-to-1 multiplexers only.

17. Construct any function with 2-to-1 multiplexers.

18. Create circuit to determine 2’s complement of a 32-bit number (e.g. you have 32 bit bus as input)

19. Given a FIFO that has input rate of 20 cycles idle and 80 cycles valid and output rate of 8 cycles valid and 2 cycles idle, determine the smallest size the FIFO can be without stalling either the input or output.

20. Given a convoluted system with different requirements, create an FSM that meets those requirements.