← Akuna Capital Interview Insights

Akuna Capital·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Interviewed for a software engineering role at Akuna Capital and ran into a MySQL foreign key question that seemed straightforward but had a subtle wrinkle worth thinking through.

Questions Asked (1)

Q1

In MySQL, which of the following is false: (A) a column can have a foreign key reference to itself, (B) MySQL supports foreign key references between columns within the same table, (C) the data types of corresponding foreign key and referenced key columns must be compatible, or (D) all of the above are correct?

Data ModelingTechnical Trade-offs
Author's notes

I second-guessed myself on this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Evaluate each statement independently based on MySQL's foreign key capabilities, then determine which, if any, is false. Since the question asks for the false statement, verify that all statements are actually true and select (D) if none are false.

Pro tip: In MySQL, a foreign key can reference the same table (self-referencing), which is useful for hierarchical data like employee-manager relationships. Also, note that MySQL requires compatible data types, but not necessarily identical ones (e.g., INT and BIGINT are compatible).

1. Understand the question

Identify that the question asks for the false statement among the options, and that option (D) claims all are correct. So, if all statements are true, (D) is the correct answer.

2. Evaluate statement A

Check if a column can have a foreign key reference to itself. In MySQL, a self-referencing foreign key is allowed, e.g., an employee table where manager_id references employee_id.

3. Evaluate statement B

Determine if MySQL supports foreign key references between columns within the same table. This is essentially the same as self-referencing foreign keys, which are supported.

4. Evaluate statement C

Verify if data types of foreign key and referenced key columns must be compatible. MySQL requires compatible data types, but they need not be identical (e.g., INT and BIGINT are compatible).

5. Conclude

Since all statements A, B, and C are true, the false statement is none of them, so option (D) 'all of the above are correct' is the correct answer.

Key Points to Mention

  • Self-referencing foreign keys are allowed in MySQL (e.g., employee-manager relationship).
  • Foreign key references within the same table are supported.
  • Data types of foreign key and referenced key must be compatible, but not necessarily identical.
  • InnoDB storage engine supports foreign keys; MyISAM does not.
  • Foreign key constraints can be disabled or enabled, and they enforce referential integrity.
  • The correct answer is (D) because all statements are true.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.