ヤマを張(は)る (yama o haru) is a Japanese idiom that means “make a guess/guestimate”.
This expression is particularly used when you guestimate the questions/topics/subjects you will be asked in an exam, and focus on studying them to prepare for it. For instance, if you have a Japanese exam tomorrow, you may focus on studying keigo only, hoping that there will be many keigo-related questions. Some people are audacious enough to take a hit-or-miss strategy and study only what they guess will be asked in the exam while completely ignoring the other subjects.
In fact, ヤマを張る is also written as “山を張る”, where 山 means “mountain”. One of the theories of the origin has it that this idiom refers to how miners used to “strike gold” in the old days. There is also another related word, “山勘 (やまかん)”, which means “a random guess” and sounds more random and less reliable than just 勘 (かん), meaning “guess/intuition”. When you make a right guess, you can say “ヤマ/山勘/勘が当(あ)たった” and when you make a wrong one, that is “ヤマ/山勘/勘が外(はず)れた”.
明日 (あした) 、日本語の試験(しけん)があるけど、時間(じかん)がないから ヤマを張って敬語(けいご)だけ勉強 (べんきょう)しよう。
I have a Japanese exam tomorrow, but I don’t have much time left so I’ll guestimate the questions and study keigo only.
I made the right guess and could get good marks