After a postdoc period, how to understand if you should go for a second postdoc or apply for a permanent position? I'm a postdoctoral fellow working on computer science. I've been a postdoc for one year and three months so far, and I think my job will last for three years in total.

Thinking about the future, I suppose I'll apply for a second postdoc position after this, in another university or scientific research institute. But some days ago I met a colleague of mine who is in her third postdoc year, and she said that at the end of the year she will start to apply for some permanent position, such as research associate or principal investigator.
I was quite surprised because I always thought that a second postdoc position was normal in our computer science field.

So my question is: after a first postdoc period of three years, should you apply for a second postdoc position or for a permanent position?

What is the best choice for you?

And how do you understand if you should apply for a second postdoc position or a permanent position?
This can vary greatly by subfield, country, etc., so there's no universal answer to whether a second postdoc is necessary or a good idea.  People typically make the decision based on several factors:


You should ask your mentors (your postdoctoral advisor, Ph.D. advisor, and other faculty you know) for advice.  They can offer insight that takes into account both your accomplishments so far and the job market you will be applying in.
You should compare yourself with other people you know who have gotten jobs recently.  Making these sorts of comparisons is tricky, so you shouldn't take this too seriously, but it will give you a feeling for where you might stand.  If your colleagues regularly get permanent positions after three years with accomplishments like yours, then you should try applying for such jobs too.  If they don't, then you shouldn't expect to be so lucky yourself.
Most people aren't quite certain, and they end up applying for a mixture of postdoctoral and permanent positions.  That's fine, and it's counterproductive to focus 100% on one type of job unless you are sure the other would be unavailable or undesirable.