Google Interview Question for Site Reliability Engineers


Country: United States
Interview Type: Phone Interview




Comment hidden because of low score. Click to expand.
3
of 3 vote

Trace all system calls with the appropriate tool (strace/trace/truss, depending on your OS) and look for system calls returning error conditions (missing file or directory, insufficient permissions, network connection refused, ...).

- Cenic April 01, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

1> Turn on all the system level log, and see if there is any error message.
2> objdump the binary and see if it is calling some API of other dynamical library, replace those library with debug version and see if it will output any errors.
3> You can also replace the system level library such memory allocation clib with debug version, and dump more information out.
4> Finally you can run the binary in some virtual machine and dump its execution sequence (API call sequence with parameters), and see if it would give you some idea of what is going on.

- chenlc626 March 22, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

1. Knowing that the binary does not log to STDOUT or STDERR, you can assume you're debugging on a UNIX-like system. Where might you find the 'system level logs' on the filesystem?
2. Assume that the binary does not have debug flags or a debug version.
3. What command can you run to determine which system level library the blackbox binary is using?
4. What command can you run that would dump the execution sequence?

- longbelly March 22, 2013 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 votes

1> the binary code it does not output anything, does not mean that the system library it may use does not output anything, unless the binary does not call any system API, which is unlikely.
2> Same as 1>. I do not care what is inside the binary code itself, i care what other library or service it may depends on to work. Have u used the dmesg for some system service?
3> If it is calling the dynamical lib of the system, you should see the app call using NM or other binary utility, otherwise system loader would not help it to prepare the .so file when it starts running. Or it may load the .so itself, in this case, it also must call some system API to do it. You should be able figure out a way to got the name of .so it would use, use a debug of that .so if you can.
4> It depends on the virtual machine you are using. I know some virus software company is using virtual machine to perform the analysis.
The whole idea is that unless the software is just a ball of junk code which does not call any external system service and does not use any system resources, you should be able to get some information from its interactivity with the external system service.

- chenlc626 March 22, 2013 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

1. Look at the logs
2. lsof to see which files, sockets, pipes it has open
3. Run it in the dbugger and see where it core dumps
...

- dmat April 15, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

use strace and look at the /proc/processid directory for the runtime execution commands and all the resources, the HEAP and Stack and file handle contents.

- Ford Prefect May 01, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

use ldd to find the shared libraries used by the program

- MoA July 14, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Plus you could also use a decompiler (if you really wanted to know what was going on and what it was doing) and debugger to walk yourself through the entire thing.

- Mika September 13, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

A program can only exit in a few ways.

abort();
exit(_N) /_exit / _Exit
return _N
or signaled kills.

abort is obvious
signals encode information in their return codes: 128 + signumber, if you see a number this high it is usually not a programmer manually setting.

All of this is just /hints/ at the solution. If you can run the program in a debugger you can run:

gdb ./program
break _exit (note, not `exit` since this signal is not caught on _exit calls)
run
.... yadda yadda...
bt

For a function which exited in an exit or _exit call:
#0 0x00007ffff72d0af0 in _exit () from /usr/lib/libc.so.6
#1 0x00007ffff7250e2b in __run_exit_handlers () from /usr/lib/libc.so.6
#2 0x00007ffff7250eb5 in exit () from /usr/lib/libc.so.6
#3 0x000000000040065a in test() ()

For a function which exited in a return code:
#0 0x00007ffff72d0af0 in _exit () from /usr/lib/libc.so.6
#1 0x00007ffff7250e2b in __run_exit_handlers () from /usr/lib/libc.so.6
#2 0x00007ffff7250eb5 in exit () from /usr/lib/libc.so.6
#3 0x00007ffff723ab0c in __libc_start_main () from /usr/lib/libc.so.6

- cjhanks February 21, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

This is what I would do:
1. App logs (windows)
2. system level logs
3. Create a process dump and analyze
4. look for documentation.
5. Google the mystery exit code for more help

- saki March 28, 2013 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More