1

Unsure about switching between C and Java

Profile picture
Senior Software Engineer at Taro Communitya month ago

Hi all! I have an upcoming Apple interview round, for which I have been asked to interview in C language. I have been working in C at work, so I wouldn’t mind. But there are some questions which require DS which I am comfortable with in Java but not in C[Example: Hashsets] .

Did anyone have any similar experiences?

46
2

Discussion

(2 comments)
  • 2
    Profile picture
    Tech Lead/Manager at Meta, Pinterest, Kosei
    a month ago

    Since you're being asked to interview in C, you don't a choice to switch to a new language (this is rare, but does happen for interview loops on teams that only care about 1 language).

    Spend some time sharpening your C muscles, but I have two thoughts that can hopefully relieve some of your stress:

    • The types of problems you are expected to solve are likely to be different since the interviewer knows if something will be very cumbersome in C. Their goal is to maximize signal from the interview, so they shouldn't ask you to write something that has 30 min of boilerplate code.
    • If there is something very tedious/slow, one smart strategy is to "invent the API", something like this:

    In Java, here's the syntax I'd use for the Hashset. I forget the exact syntax in C, but I'll assume some library exists for this so I can make progress on the core problem. If you'd like me to come back and flesh that portion out in more detail, let me know.

    Alex talks about Programming Language Selection in his course as well.

  • 0
    Profile picture
    Tech Lead @ Robinhood, Meta, Course Hero
    a month ago

    I have heard that Apple in particular will require certain languages for interviews often. Since you have been asked to interview in C, you should definitely do everything in C. As Rahul mentioned, you should leverage the interviewer to sidestep boilerplate DSA coding - There isn't much signal on them having you create the HashSet data structure from scratch.

    I talk about this all more in-depth in this lesson of my DSA course: https://www.jointaro.com/course/master-the-data-structures-and-algorithms-interview/missing-what-matters/