
Could you provide feedback? Would you consider hiring me?
I recently had an interview for a senior data engineer position. Below is the question and code I had to write within a 30-minute timeframe without using Google. I managed to solve the problem, but unfortunately, the company didn't proceed with my application. I understand that the code might not have been production-ready or easily testable. Would the code I wrote be acceptable for an interview coding test for a senior data engineer? I am trying to improve my coding skills for interviews.
Required Out Put:- // Ali with ID 11 and OrgName IT // JOHN with ID 11 and OrgName NOT FOUND
case class Fact(name: String, id: Int, orgId: Int)
case class Org(name: String, id: Int)
object Solution extends App {
val factD = List(Fact("ali", 11, 123), Fact("david", 12, 88), Fact("John", 12, 121)) val orgD = List(Org("IT", 123), Org("Engineering", 88)) //factD.foreach(println) val orgDM = orgD.map(x => (x.id, x.name)).toMap //println(orgDM.getOrElse(123,None)) val op = factD.map(x => (x.name, x.id, orgDM.getOrElse(x.orgId, None))) println(op) val op2 = factD.map(x => (x.name + " with ID " + x.id + " and OrgName " + orgDM.getOrElse(x.orgId, None).toString.replaceAll("None", "NOT FOUND"))) println(op2.mkString("\n")) }
Talking product sense with Ridhi
9 min AI interview5 questions

You're early. There are no comments yet.
Be the first to comment.