
Yes, it's okay to ask after a rejection, and it doesn't bother reasonable people when you keep it short. Many companies have a policy not to give feedback because of time and legal risk, so expect no reply or a generic one. Still, I've gotten useful notes maybe one out of four times, more often from smaller companies or when I had a take home. Send it within a couple of days of the rejection while you're still fresh in their mind. Aim it at the recruiter or the last person you spoke with, not a random inbox.
Keep it to three or four lines. You can use a subject like "Thanks and quick feedback request." In the body, thank them for their time, say you're not asking them to revisit the decision, and ask if there's one thing you could improve for next time, optionally naming the area you care about like system design or behavioral examples. Add a line that you understand if policy prevents sharing. That framing shows you respect their time and focuses them on one concrete note instead of an essay, and in my experience it yields short but actionable tips when they're able to respond.