Google Interview Question
Software Engineer / DevelopersCountry: United States
Actually Two main types of bugs can occur: Physical Bugs and Functional Bugs
Physical bugs are the ones like network issues, DB is down, Memory is corrupted, shared resource is not available or is locked or corrupted for some reason.
Functional bugs are like Multithreading issues (race condition, mutex waithandlers), improper locking of database or objects in code, timezone difference between server client not handled, random variable usage in code etc.
gather more info about the bug and capture data like Memory usage in Task manager, Event log etc.
It can be due to many reasons e.g.:
1. Memory pressure, vmsize limit reached, connection limits or open file handle limits
2. Network is unreliable
3. Hardware Failure
4. Using Debug v/s regular binary
5. Race conditions (no locks in multi-threaded program)
6. Dynamic Backend(e.g. no. of nodes in a social graph can increase/decrease)
7. Memory leaks.
8. Bugs in shared memory code/data
9. Time Difference b/w your node and another server.
10. Timeouts/ Max Time to Live expired e.g. Session Expiration
[1] Random variable being generated and used in some way in the code, some of the random number might cause the test to fail
- Ashupriya September 17, 2012[2] Loading an external library
[3] contacting the server may get timeout sometime and pass some other times
[3.1] Or any other kind of network related problem might occur on and off
[4] Race conditions
[5] Memory leaks
[6] The state of the code might depend on some other process's output and that may cause a failure sometime
[7] Use of extern variables which are set by other processes
[8] Use of shared memory locations
[9] Faulty RAM, (hardware problem)
[10] Multithreading
[11] When the code is using Singleton design pattern, unit testing is difficult for singleton as the state of the functions using singleton class's object may not be deterministic.
[12] Rarely though, but it can be due to a bug in the IDE being used eg Eclipse... sometime we need to restart the Eclipse and program starts working fine again