Is it okay to say I don't know in a job interview?

I applied for a position a little beyond my skills (years of experience/expertise). During the interview, I was asked questions I could answer well, and I was asked questions I did not know anything about.

It is more than okay to say I do not know. Let me share a personal experience from my interview exactly a month ago. I applied for a position a little beyond my skills (years of experience/expertise). During the interview, I was asked questions I could answer well, and I was asked questions I did not know anything about. At the end of the interview, I asked for the feedback, regardless of the outcome. They told me right there on the spot, that a lot of candidates try to avoid answering directly when they do not have an answer, they go around and beat the bush, hoping to avoid embarrassment of saying 'I do not know'. They thanked me for being direct and honest (especially in technical interviews, either you know the answer or not. They can see through your bs if you are dodging questions), because it is very annoying for them to listen senseless blabla when they know you cannot answer. I can also tell you I was offered a job there and I am starting in 2 weeks, so my personal advice, please be honest and say 'I do not know'. There is no shame in that. Nobody knows everything.