If someone with F-2 visa status wants to work for free as an engineer or computer programmer for a company or startup within the US, to improve his/her work experience, skills and resume also maybe finding a work visa sponsor, is it also illegal even when he/she has no income from the job?
An F-2 visa holder cannot work unless they get a work permit.
They are allowed to volunteer but volunteering is only legal for the ‘employer’ in the not-for-profit/charity sector.
Unpaid internships are legal but only where the relationship is primarily for the benefit of the intern. An “internship” where the intern is doing work that could/should be done by a paid employee is illegal. (And, yes, I’m aware this is often abused)