















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















































































Question 1.Which binary value corresponds to the decimal number 13? A) 1101 B) 1011 C) 1110 D) 1001 Answer: A Explanation: 13 in decimal equals 1101 in binary (8+4+0+1). Question 2.Which hexadecimal representation is equivalent to the binary sequence 1010 1111? A) 0xAF B) 0x5F C) 0xFA D) 0xA Answer: A Explanation: 1010 1111 groups into AF (10=A, 15=F). Question 3.What is the size, in bytes, of a signed 64‑bit integer in Python’s struct module? A) 4 B) 8 C) 16 D) 2 Answer: B Explanation: 64 bits = 8 bytes.
Question 4.Which of the following is a little‑endian representation of the 32‑bit hex value 0x12345678? A) 78 56 34 12 B) 12 34 56 78 C) 34 12 78 56 D) 56 78 12 34 Answer: A Explanation: Little‑endian stores least‑significant byte first: 78 56 34 12. Question 5.In a fixed‑length record file each record is 128 bytes. If the file is 12 800 bytes long, how many records does it contain? A) 80 B) 100 C) 120 D) 64 Answer: B Explanation: 12 800 ÷ 128 = 100 records. Question 6.What delimiter is most commonly used to separate fields in a CSV file? A) Tab B) Semicolon C) Comma D) Pipe Answer: C Explanation: CSV stands for “Comma‑Separated Values”.
Question 10.What type of JOIN returns all rows from the left table and matching rows from the right table? A) INNER JOIN B) LEFT JOIN C) RIGHT JOIN D) FULL OUTER JOIN Answer: B Explanation: LEFT JOIN keeps all left‑table rows. Question 11.In SQLite, which file stores the write‑ahead log (WAL) data? A) .db B) .sqlite C) .wal D) .shm Answer: C Explanation: The .wal file holds WAL entries. Question 12.What Python data type is best for storing an immutable ordered collection of items? A) list B) dict C) set D) tuple Answer: D
Explanation: Tuples are immutable and ordered. Question 13.Which exception is raised when a file opened with open() cannot be found? A) IOError B) FileNotFoundError C) OSError D) PermissionError Answer: B Explanation: FileNotFoundError is a subclass of OSError for missing files. Question 14.What does the Python expression len(b'\x00\x01\x02') return? A) 2 B) 3 C) 4 D) 0 Answer: B Explanation: The bytes object contains three bytes. Question 15.Which regular‑expression pattern matches a US phone number in the format (123) 456 ‑7890? A) \(\d{3}\) \d{3}-\d{4} B) \d{3}-\d{3}-\d{4} C) \(\d{2}\) \d{3}\.\d{4} D) \d{10}
Answer: C Explanation: plistlib is part of Python’s standard library. Question 19.In Android, which file format is commonly used for app configuration and is XML‑based? A) .plist B) .json C) AndroidManifest.xml D) .ini Answer: C Explanation: The AndroidManifest.xml defines app components. Question 20.What is the primary purpose of a Protocol Buffer (protobuf) in mobile forensics? A) Store images B) Encode structured data efficiently C) Encrypt communications D) Compress audio files Answer: B Explanation: Protobufs serialize structured data in a compact binary format. Question 21.Which command extracts a BLOB column from a SQLite database into a file using the sqlite3 CLI? A) .output file.bin; SELECT blob FROM table; B) .dump table > file.bin C) .mode binary; .once file.bin; SELECT blob FROM table;
D) .save file.bin SELECT blob FROM table; Answer: C Explanation: .mode binary and .once write the binary output to a file. Question 22.What Python statement correctly calculates the MD5 hash of a file named “image.dd”? A) hashlib.md5(open('image.dd','rb').read()).hexdigest() B) md5('image.dd') C) hashlib.sha1('image.dd') D) hash('image.dd') Answer: A Explanation: MD5 is computed via hashlib on the binary contents. Question 23.In a hex editor, the file signature for a PNG image starts with which byte sequence? A) 89 50 4E 47 0D 0A 1A 0A B) FF D8 FF E C) 42 4D D) 25 50 44 46 Answer: A Explanation: PNG files begin with the 8‑byte signature shown. Question 24.What does the Python expression struct.unpack('>I', b'\x00\x00\x01\x00') return? A) (256,) B) (65536,) C) (1024,)
D) Both A and B Answer: D Explanation: Both a try/finally block and the context manager (with) guarantee closure. Question 28.In a variable‑length record format, which element typically indicates the start of the next record? A) Fixed byte count B) Length header preceding the record data C) Null byte only D) File offset table Answer: B Explanation: A length field tells a parser how many bytes to read for the current record. Question 29.What is the default encoding used by Python 3 when opening a text file without specifying encoding? A) ASCII B) UTF‑ 8 C) Latin‑ 1 D) UTF‑ 16 Answer: B Explanation: Python 3 defaults to UTF‑8 for text I/O. Question 30.Which of the following is NOT a valid SQLite data type? A) INTEGER B) TEXT
Answer: D Explanation: SQLite uses storage classes; CHARSET is not a defined type. Question 31.What does the SQLite command VACUUM; accomplish? A) Deletes all tables B. Rebuilds the database file to reclaim unused space C) Optimizes indexes only D) Imports external data Answer: B Explanation: VACUUM copies live data into a new file, compacting it. Question 32.In forensic analysis, why is endian conversion important when interpreting raw memory dumps? A) To change the file extension B) To correctly reconstruct multi‑byte values according to the device’s architecture C) To encrypt the data D) To compress the dump Answer: B Explanation: Endianness determines byte order for integers; incorrect order yields wrong values. Question 33.What Python module provides functions for generating SHA‑256 hashes? A) hashlib
A) Multiply by 1000 and add epoch offset B) Convert to seconds by dividing by 10,000,000 then add 1601‑ 01 ‑01 offset C) Directly interpret as Unix epoch D) Use base‑64 decoding Answer: B Explanation: FILETIME counts 100‑nanosecond intervals since 1601‑ 01 ‑01 UTC. Question 37.In Python, which function converts a hexadecimal string “0x1A3F” to an integer? A) int('0x1A3F', 16) B) hex('0x1A3F') C) float('0x1A3F') D) bin('0x1A3F') Answer: A Explanation: int(string, base) parses the string using the given base. Question 38.What is the purpose of the SQLite sqlite_sequence table? A) Stores AUTOINCREMENT counters for tables B) Holds user passwords C) Lists attached databases D) Contains query logs Answer: A Explanation: When a table uses AUTOINCREMENT, the current max rowid is kept in sqlite_sequence. Question 39.Which Python statement correctly writes a list of dictionaries to a CSV file?
A) csv.writer(file).writerows(dict_list) B) csv.DictWriter(file, fieldnames=keys).writerows(dict_list) C) json.dump(dict_list, file) D) pickle.dump(dict_list, file) Answer: B Explanation: DictWriter maps dictionary keys to CSV columns. Question 40.What does the regular‑expression token \b represent? A) Word boundary B) Backspace character C) Byte order mark D) Beginning of line Answer: A Explanation: \b matches the position between a word character and a non‑word character. Question 41.In a mobile forensic image, the string “com.apple.mobilebackup” is most likely found in which type of file? A) SQLite database B) Property List (plist) C) JPEG image D) MP3 audio file Answer: B Explanation: Bundle identifiers are stored in plist files on iOS.
Question 45.How can you programmatically determine if a file is a valid SQLite database in Python? A) Check if first 16 bytes equal “SQLite format 3\0” B) Open with os.startfile() C) Look for .sqlite extension D) Search for “CREATE TABLE” strings Answer: A Explanation: SQLite files start with the magic header “SQLite format 3\0”. Question 46.What does the Python expression datetime.utcfromtimestamp(0).isoformat() return? A) '1970- 01 - 01T00:00:00' B) '1970- 01 - 01T00:00:00Z' C) '1969- 12 - 31T23:59:59' D) '1970- 01 - 01' Answer: A Explanation: UTC epoch 0 formatted in ISO‑8601 without the trailing Z. Question 47.In a hex editor, the ASCII string “PK” at offset 0 indicates the file is likely what type? A) ZIP archive or related (e.g., .docx, .apk) B) PNG image C) PDF document D) MP3 audio Answer: A Explanation: “PK” are the initials of Phil Katz, the creator of the ZIP format.
Question 48.Which Python standard library module can be used to parse ISO‑8601 timestamps? A) dateutil B) datetime C) time D) calendar Answer: B Explanation: datetime.fromisoformat() parses ISO‑8601 strings (Python 3.7+). Question 49.What is the primary advantage of using parameterized queries in SQLite via Python’s sqlite3 module? A) Faster execution B) Prevents SQL injection and handles data quoting automatically C) Reduces file size D) Enables multithreading Answer: B Explanation: Parameter substitution safely escapes user data. Question 50.How do you compute the SHA‑256 hash of a string variable s in Python? A) hashlib.sha256(s.encode()).hexdigest() B) hashlib.sha256(s).hexdigest() C) sha256(s) D) hash(s) Answer: A
D) LINK DATABASE 'file.db'; Answer: A Explanation: ATTACH makes a second file accessible under an alias. Question 54.What is the purpose of the .mode csv command in the sqlite3 CLI? A) Set output format to CSV for subsequent queries B) Import a CSV file into a table C) Convert the database to CSV D) Change internal storage mode Answer: A Explanation: .mode csv tells sqlite3 to emit query results as CSV. Question 55.In Python, which built‑in function returns an iterator over key‑value pairs of a dictionary? A) dict.items() B) dict.keys() C) dict.values() D) dict.iter() Answer: A Explanation: items() yields (key, value) tuples. Question 56.What does the hex pattern “FF D8 FF E0” signify at the start of a file? A) JPEG image header B) PNG image header
C) GIF image header D) BMP image header Answer: A Explanation: JPEG files begin with the SOI marker FF D8 followed by APP0 FF E0. Question 57.Which SQLite pragma can be used to enable foreign‑key constraints? A) PRAGMA foreign_keys = ON; B) PRAGMA enable_fk = TRUE; C) PRAGMA foreign_key_check; D) PRAGMA foreign_keys ON; Answer: A Explanation: Setting foreign_keys pragma to ON enforces FK constraints. Question 58.How can you extract all email addresses from a text file using Python’s re module? A) re.findall(r'[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,}', text) B) re.search('email', text) C) re.match('.@.', text) D) re.sub('@', '', text) Answer: A Explanation: The pattern matches typical email structures. Question 59.What is the primary difference between bytes and bytearray objects in Python? A) bytes is immutable; bytearray is mutable B) bytearray is immutable; bytes is mutable