"I worked for that company for three years."
間 is required for some durations of time such as the number of hours but for others it's optional. 間 is optional after 年. You can add it but it's not required. https://www.learn-japanese-adventure.com/japanese-numbers-durations.html
From the Japanese thesaurus:
【１】「働く」は、からだや頭を使って仕事をする意。「盗みを働く」のように、悪事をする場合にも使う。 【２】「勤める」は、金銭を得るためにある組織の一員となり、定まった仕事をする意。 1) "hataraku" means to do a job using the body, head, etc. As with "to steal" (lit. to work stealing), it can also be used with malevolent deeds. 2) "tsutomeru" means to work in an established job as a unit of the group, for the purpose of earning money.
In terms of employment, hataraku often refers to blue collar jobs such as a factory worker, a convenience store clerk or a street sweeper. Tsutomeru refers to white collar employment, such as a bank employee, a university professor, or a systems analyst.
This is just me trying to make sense! Please correct me if I am wrong.
In English the topic is: "for that company" therefore starts with, そのかいしゃには つとめる means to work (for), so that's why "worked for three years" translates in Japanese as: 三年つとめました I think it wouldn't be wrong if you put 三年 in front of the line while placing the , with it --> 三年, その会社には勤めました。
I feel like that is wrong, because you're making the three years the subject and not the place. To translate what you wrote, it would be something Iike "As for three years, I've worked in that company." By specifying the company (as a place) as the subject, then saying you've worked for three years, you become more clearer in meaning. "As for in that company, I've worked for three years."
There's another sentence in this lesson that does use "wo" with it. It looks like it indicates the specific job, which makes sense, if you think of how "wo" indicates what you're doing the verb to.
The other sentence (working from memory) is 高校で先生を勤めています "De" tells us it was AT the high school, and "wo" tells us that "teacher" is the job you're doing. Except at this point we don't have the vocabulary for many jobs, so there aren't a lot of examples Duo can give us.
i'm not sure, but i think the nuance of the english and japanese don't match up here. starting the sentence with その会社には feels like that makes "that company", rather than "me", the subject and therefore a more accurate translation would be "as for that company, i worked there for 3 years".