Hacker Self-Test


This test is for you to judge whether you're ready to take my hacking class. This stuff isn't considered that deep or esoteric, but you won't find most of it taught in any class. It's just something you pick up and/or figure out on your own in the course of exploring your passion for computers and software.

To score yourself, you get full credit if you know the answer without using a computer in any way (like googling for the answer, or writing a program). You get half if you use a computer. You get zero if you can't figure it out at all (duh).

If you want to prepare before taking this self-test, learn C and/or Java, Perl, Ruby, Python, Bourne shell, PHP, SQL, HTML, Linux and Windows, data structures and algorithms, operating systems, and networking. Oh, and x86 assembler. Knowing Javascript would be nice too, but I don't know it.

This is by no means comprehensive. It's meant to spot check you to give you a statistical indication of your background coverage.

1. Clear the third bit of a (indexing bits from 0), writing your code in python/java/C.

2. What does this python code do?

a ^= b
b ^= a
a ^= b

3. What does this python code do?

[a,b] = [b,a]

4. What does this C code do?

i = 0;
while (a) {
  a &= (a-1);
  i++;
}

5. I have 10,000 integers in the range from 1 to 107. What's the fastest way to sort them?

6. What's a TLB and what does it do?

7. What is netcat and what kinds of things is it used for?

8. Explain the difference between cdel and windll/odedll calling conventions.

9. What is the Windows Registry and how is it typically used?

10. What is a symbolic link, and how is it typically used?

11. What does xor eax, eax do?

12. Why is the NOP instruction a single byte in machine code?

13. What does this do in PHP?

<?php
include "$path/script.php";
?>

14. Why is the PHP in (13) above often a bad idea?

15. If a UDP packet is fragmented, under what conditions will a router reassemble it?

16. What protocol does a network 'echo' fall under? What is the typical name of the command that causes an 'echo'?

17. What is the name of the most common DNS implementation? And the most common mail agent?

18. Name the default ports used by these services: ftp, telnet, mail, http.

19. How do you make a kernel call in Windows?

20. How do you make a kernel call in Unix (pick a Unix and answer).

21. How do you delete a table in SQL?

22. What is the name of the system call to delete a file in Unix?

23. What is a shadowed password file?

24. Explain how to tunnel IPv6 over IPv4.

25. How does traceroute work?

26. What is a "salt" and why is it used?

27. What is iptables?

28. What is a "nat box"?

29. Why don't TCP/IP sequence numbers start at zero?

30. What is "endianness"?

31. What does Tomasulo's algorithm do?

32. What is "real mode" on the x86?

33. What is a "race condition"?

34. On Windows, you execute "c:\program files\sub dir\program name". How is this interpreted? Candidates are:

    c:\program.exe files\sub dir\program name
    c:\program files\sub.exe dir\program name
    c:\program files\sub dir\program.exe name
    c:\program files\sub dir\program name.exe

35. What does this do on Unix:

$ !-2 !!:*

36. How about this:

$ sort < fn | uniq -c | sort -nr | perl -lane 'print $F[2]'

37. Given only two inverters along with an arbitrary number of AND and OR gates, build a circuit that inverts the inputs on three independent wires.

38. What frequency, in hertz, did AT&T formerly use to signal that a trunk line was not in use?


John Black's WWW Page / John R. Black / (jrblack@cs.colorado.edu)