I am currently working in a consulting role, officially employed by company A, and am currently working on a project in collaboration with one of my current company's clients, company X. When looking at other positions, I noticed a couple of positions with this company and have applied. While filling out the application, there was a question which asked "Have you been employed by company X, Y or Z?", where one of the companies listed was the client which I am working for under the consulting company. I'm slightly confused as to whether I should say yes or no, as officially, I work for company A and not company X, but I'm worried as to whether if I say "no" it could cause any problems as far as conflicts of interest go if I were to move on in the hiring process, since I have worked with company X in some capacity as part of working at Company A.
You have worked with company X.
You have maybe* worked for company X.
But you have not been employed by company X.
If it's a simple yes/no question then the answer is no. If they give you space for a more lengthy response, then mention the collaboration.
* Depending on how different people interpret the word 'for' as it relates to your consulting relationship.
"Employed by" means equally "the name of the company who signs your paycheque" or "the name of the company co-signer of your employment contract". Both of these are the consulting company, not the client. Therefore you have not been employed by the client. The answer is no.
If something comes up in an interview setting where you may want to mention you've done work for this company before, then feel free to mention it (if you're allowed to; I worked for a consulting company once where part of my NDA was to not disclose the names of my client companies), but for the purposes you're asking, the answer is no.
Just be transparent and honest.
While employed by A, I collaborated with X from September 2020 until the present.
Legally, it's clearly not the same thing to be employed by X as opposed to collaborating with X - you have a contract of employment with A, not X. But the company you're applying to will have a reason they've put this question on the form, and they possibly aren't actually concerned about the legal pedantry. However, nobody here can tell you what the reason for including the question is, so the best thing you can do to ensure you don't end up in hot water in the future is to be fully transparent about what the situation is.
Be honest, and use initiative to contact the employer and clarify ambiguities.
The long read
To offer an alternative perspective here, a crucial mistake people often make is to assume that the party putting a question (typically an organisation) has, like Humpty Dumpty in Through the Looking-Glass, the right to decide on the meaning of any words they use, and that the party putting an answer to that question (typically a person conducting their own affairs) has no such right.
In law, the opposite is often the case, as with the contra proferentem rule, where it is the person interpreting the material who is given the benefit of the doubt, not the person drafting the material.
I don't think "who have you been employed by" is any different from "who have you worked for". If the question were legally specific about contractual relations, it could say "have you previously entered into an employment contract directly with companies X, Y, or Z?".
But candidates would usually find this sort of wording vexatious, and difficult to parse precisely because it is legalistic and precise in a way that doesn't correspond to everyday forms of communication. Some might ask what the distinction is between direct and indirect. Legal eagles might wonder whether a transfer of undertaking counts as an "entering into".
As it stands, the question could perhaps be answered in either fashion, by saying either yes or no. A person attributing a legalistic meaning to the word "employed" can rightfully say no, and a person whose contract is with a connected company but who works substantially at a workplace where the name above the door or at the end of the telephone is Company X, can equally say yes.
If there is reason to believe that the company is asking the question for the purposes of establishing a conflict of interest, the bias towards yes answers would also be the most desirable for triggering further enquiries into possible conflicts at the earliest stage.
This is not to promote obtuse or absurd interpretations of words - such as an electrician claiming to have worked for an insurer because he was once called in to fix a light bulb there - but to emphasise that words often carry a range of possible and plausible meanings, and questioners themselves often do not intend a narrowly legalistic meaning, nor are answerers bound (even in law itself) to attribute only a narrow legalistic meaning.
And except amongst practising legal professionals, people cannot be assumed to even have a correct knowledge of the law or the subtle conceptualisations that exist there.
Of course a HR department can play Humpty Dumpty with new applicants, and reject on a whim before they have offered any employment to the applicant, but they can do that equally with candidates who employ legalistic responses to questions which are asked in a broad and commonsense way.
The lesson here for candidates is to be honest, and if there is an appreciable lack of clarity as to how a question applies to particular circumstances, and a job hangs in the balance, then use initiative to seek clarification and reach a meeting of minds with the would-be employer about the purpose of the question.
For those drafting application forms, the lesson is to be prepared to interact. Ensure that you are easily accessible to candidates completing application forms who may have questions, don't make them tiringly long or difficult to parse (as people will start having to economise on the attention paid to any particular answer), and ask questions only at appropriate stages in the process where candidates have enough perceived investment to chase clarifications (or ask simple questions early, but in ways that are unambiguously biased towards getting the things you are trying to find out, and then target further questions later to filter out the things you don't actually care about).
Unless this is a particularly small/new company, they have had plenty of opportunity to revise (in both the British and American sense) their application questions. Think about how much time it would take them to go over their questions and make sure that the questions meet their needs for clarity. And think about how small that amount is amortized over all their applicants. Now think about how much time it took you to think about the question, go to SE, post your question about the question, and peruse the answers.
I expect that the ratio between those two times is rather large. Is your time really that much less valuable than theirs? If your answer causes them to have a false belief about you, whose fault is that really, and how much responsibility do you have to prevent that?
Make your best guess what it means, and move on. The flip side of "HR is not your friend" is "You aren't HR's friend". If they made a mistake as far as making something sufficiently clear, you aren't obligated to bend over backwards to fix it for them.